{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper — Publication Feeds and Posts",
    "description": "Extract Substack feeds, bounded archive metadata and public year-sitemap links. Custom domains, explicit coverage and checkpoints.",
    "version": "0.2",
    "x-build-id": "xEsgWO0V5V1iUCQKs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thescrapelab~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thescrapelab-substack-scraper",
        "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/thescrapelab~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-thescrapelab-substack-scraper",
        "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/thescrapelab~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-thescrapelab-substack-scraper",
        "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": {
          "newsletterUrls": {
            "title": "Newsletter or post URLs",
            "type": "array",
            "description": "Paste public newsletter or post links, one per line. Custom domains and /feed links work too. Leave empty to use existing API startUrls, or the Simon Willison example by default. When non-empty, this list replaces startUrls. Hosted URL-list files, private feeds and Notes are unsupported.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxItems": {
            "title": "Total results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum saved results across all newsletters in this run. Collection stops when this limit or another run limit is reached. Increase Results per newsletter too if you want more than 10 posts from one newsletter.",
            "default": 10
          },
          "maxPostsPerPublication": {
            "title": "Results per newsletter",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum new or updated posts from each newsletter, also limited by Total results. Recent feeds may contain fewer posts. Ignored when returning newsletter details.",
            "default": 10
          },
          "keyword": {
            "title": "Contains keyword",
            "type": "string",
            "description": "Optional word or phrase in the post title or description. Leave blank for all posts. Filters only your supplied newsletters; it does not search all of Substack.",
            "default": ""
          },
          "publishedAfter": {
            "title": "From date (inclusive)",
            "type": "string",
            "description": "Include posts published on or after this date, in UTC. Leave blank for no start date. JSON/API input also accepts ISO timestamps. Exact date filters are unavailable for year-index links."
          },
          "publishedBefore": {
            "title": "Before date (exclusive)",
            "type": "string",
            "description": "Include posts published before this date, in UTC. The selected day is excluded. Leave blank for no end date. JSON/API input also accepts ISO timestamps."
          },
          "mode": {
            "title": "Return",
            "enum": [
              "posts",
              "publications"
            ],
            "type": "string",
            "description": "Choose newsletter posts, or one details record per newsletter. Newsletter details require Recent posts as the source.",
            "default": "posts"
          },
          "textMode": {
            "title": "Text to include",
            "enum": [
              "none",
              "excerpt",
              "feed"
            ],
            "type": "string",
            "description": "Short excerpt uses the feed description or archive subtitle. Feed text uses text already supplied in RSS/Atom; it may be incomplete or a preview. Year indexes provide no text.",
            "default": "excerpt"
          },
          "maxTextCharacters": {
            "title": "Text length per post",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum plain-text characters per post. The default is 300. Truncation is reported in the output; this setting has no effect when text is omitted.",
            "default": 300
          },
          "collection": {
            "title": "Where to find posts",
            "enum": [
              "feed",
              "archive",
              "sitemap"
            ],
            "type": "string",
            "description": "Recent posts uses the current RSS/Atom feed. Older posts uses an experimental, undocumented archive route with limited coverage. Links by year returns titles and URLs from public year indexes. Older posts and year indexes require Newsletter posts and cannot include feed text.",
            "default": "feed"
          },
          "maxArchivePages": {
            "title": "Older-post pages per newsletter",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Only for Older posts. Each page requests up to 12 metadata entries, plus one feed lookup per newsletter. Two pages is the default. Raise the result limits as well to return more posts. Continuing rescans these pages and skips unchanged records.",
            "default": 2
          },
          "sitemapYears": {
            "title": "Years for post-link discovery",
            "type": "array",
            "description": "Only for Post links by year: enter one to five years, such as [2026]. These indexes return titles and URLs, without exact dates, text, authors or engagement. Leave empty for the other sources.",
            "items": {
              "type": "integer",
              "minimum": 2000,
              "maximum": 2100
            },
            "default": []
          },
          "maxRequests": {
            "title": "Source request limit",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum source requests, including redirects, retries and publication lookups. The default is 20. Requests run one at a time, at least 1.1 seconds apart. Collection stops on denial, throttling or a challenge.",
            "default": 20
          },
          "maxRunSeconds": {
            "title": "Collection time limit (seconds)",
            "minimum": 1,
            "maximum": 3600,
            "type": "integer",
            "description": "Maximum collection work time; the default is 90 seconds. The Actor also reserves 35 seconds before the Apify timeout to save progress. A limit can return partial results with a checkpoint. Set the Apify timeout long enough for collection and cleanup.",
            "default": 90
          },
          "resumeState": {
            "title": "Continue from checkpoint",
            "type": "object",
            "description": "Leave {} for a new selection. To collect new or changed records, paste CHECKPOINT JSON from an earlier run with the same source, filters, output and text settings. Limits may change. State is not automatically shared between runs.",
            "default": {}
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}