{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper & Research Archive — Markdown, JSON, CSV",
    "description": "Collect publicly accessible Substack articles into source-linked Markdown, JSON, CSV and ZIP research packs. Full/preview labels, coverage reports and incremental collection. Full articles from $3/1,000 by tier, plus $0.005/GB startup (minimum one event). No article fee for previews. By TubeText.",
    "version": "0.3",
    "x-build-id": "Nfd1Skf2SXUojUhFR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tubetext~substack-research-archive/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tubetext-substack-research-archive",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/tubetext~substack-research-archive/runs": {
      "post": {
        "operationId": "runs-sync-tubetext-substack-research-archive",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/tubetext~substack-research-archive/run-sync": {
      "post": {
        "operationId": "run-sync-tubetext-substack-research-archive",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "publications": {
            "title": "Newsletters",
            "type": "array",
            "description": "Homepage URLs, custom domains, or Substack handles. Provide this and/or postUrls. Maximum 100 sources in total.",
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Article URLs",
            "type": "array",
            "description": "Public article links such as https://name.substack.com/p/article. Supports custom publication domains.",
            "items": {
              "type": "string"
            }
          },
          "publishedAfter": {
            "title": "Published on or after",
            "type": "string",
            "description": "Optional YYYY-MM-DD or UTC ISO timestamp. Inclusive lower bound."
          },
          "publishedBefore": {
            "title": "Published before / through date",
            "type": "string",
            "description": "YYYY-MM-DD includes that full UTC day; a UTC ISO timestamp is exclusive. No implicit date cutoff stops archive enumeration."
          },
          "maxArticles": {
            "title": "New articles per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum new records added per invocation, including previews. Resume renews this allowance; previously saved records remain in the resumed bundle.",
            "default": 100
          },
          "maxArticlesPerPublication": {
            "title": "New articles per publication",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Per-invocation limit for each input publication host.",
            "default": 100
          },
          "maxRequests": {
            "title": "HTTP request budget",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Includes archive pages, post requests, redirects and retries.",
            "default": 500
          },
          "maxArchivePages": {
            "title": "Archive pages per source",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Limits enumeration, including filtered and previously seen pages. Short pages do not stop the crawl.",
            "default": 100
          },
          "maxRunSeconds": {
            "title": "Collection time budget",
            "minimum": 1,
            "maximum": 3600,
            "type": "integer",
            "description": "Stops collection after this elapsed time. Requests also stop 60 seconds before the platform timeout to reserve confirmation and export time. External delays can still prevent export completion.",
            "default": 300
          },
          "maxDownloadMb": {
            "title": "Response download budget in MB",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Compressed HTTP response bodies. Headers, TLS and platform storage traffic are not included.",
            "default": 50
          },
          "maxOutputMb": {
            "title": "Article data budget in MB",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum combined serialized article records, including previously resumed records. CSV, Markdown, ZIP and checkpoints use additional storage.",
            "default": 50
          },
          "maxPackBytes": {
            "title": "Markdown file size in bytes",
            "minimum": 1200,
            "maximum": 2000000,
            "type": "integer",
            "description": "Maximum UTF-8 bytes per Markdown file. Long articles repeat source metadata in every part. Very small values create more files and may reach the export resource budget.",
            "default": 200000
          },
          "groupBy": {
            "title": "Group research files by",
            "enum": [
              "publication-month",
              "publication"
            ],
            "type": "string",
            "description": "Each file retains the individual article sources.",
            "default": "publication-month"
          },
          "onlyNew": {
            "title": "Incremental collection",
            "type": "boolean",
            "description": "With previousRunId, skip IDs previously delivered as full text. Without a previous run, establish the initial history. Previews are rechecked. Does not detect changes to old full articles.",
            "default": false
          },
          "previousRunId": {
            "title": "Previous successful run for incremental collection",
            "type": "string",
            "description": "Requires onlyNew. Must be a successful run of this Actor by the same user, using the same sources, dates and grouping. Its stored output must still exist."
          },
          "resumeFromRunId": {
            "title": "Continue an interrupted or limited run",
            "type": "string",
            "description": "Copies saved articles and unfinished work from a terminal run of this Actor by the same user, subject to output and copy/export resource checks. Old records have no article fee; startup still applies. Keep sources, dates, grouping and onlyNew unchanged. Do not combine with previousRunId."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}