{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper",
    "description": "Scrape posts from any Substack newsletter, including custom domains: title, date, authors, likes, comments, restacks, word count, paywall flag and the full text of free posts. Discover newsletters by keyword or category, and monitor only new posts. No login.",
    "version": "0.0",
    "x-build-id": "h2LhUXfVJ3eKOFHDm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rjmacarthy~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rjmacarthy-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/rjmacarthy~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rjmacarthy-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/rjmacarthy~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rjmacarthy-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": {
          "publications": {
            "title": "Publications",
            "type": "array",
            "description": "Substack publications to scrape. Any of these work: a subdomain (\"lenny\"), a substack.com address (\"https://lenny.substack.com\"), a custom domain (\"www.lennysnewsletter.com\"), or a single post URL (\"https://example.substack.com/p/post-slug\"). Profile pages (substack.com/@name) are not supported.",
            "items": {
              "type": "string"
            }
          },
          "searchKeywords": {
            "title": "Discover publications by keyword",
            "type": "array",
            "description": "Optional. For each keyword, the scraper searches Substack's posts and takes the publications that wrote them (e.g. \"climate tech\", \"product management\"). Those publications are then scraped like the ones above.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Discover publications by category",
            "type": "array",
            "description": "Optional. Top publications of a Substack category, in Substack's own ranking. Use the category name or slug, e.g. \"technology\", \"business\", \"finance\", \"culture\", \"us-politics\", \"science\", \"climate\", \"health\", \"food\", \"sports\". Subcategories also work. An unknown value is reported in the log together with the valid list.",
            "items": {
              "type": "string"
            }
          },
          "maxPublicationsPerSearch": {
            "title": "Max publications per keyword or category",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many publications to take from each keyword or category.",
            "default": 10
          },
          "maxPostsPerPublication": {
            "title": "Max posts per publication",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many posts from each publication (in the chosen sort order). 0 = no limit (the whole archive).",
            "default": 0
          },
          "sort": {
            "title": "Sort",
            "enum": [
              "new",
              "top"
            ],
            "type": "string",
            "description": "\"new\" = newest first. \"top\" = the publication's most popular posts first (Substack's own ranking).",
            "default": "new"
          },
          "postedAfter": {
            "title": "Only posts published after",
            "type": "string",
            "description": "Only output posts published after this date (e.g. 2026-10-01) or within this period (e.g. \"7 days\", \"3 months\"). Leave empty for no date filter."
          },
          "includeFullText": {
            "title": "Include full text",
            "type": "boolean",
            "description": "Add the full post body as plain text (bodyText) and HTML (bodyHtml). Only free posts have public full text: paywalled posts are flagged with isPaywalled: true and get bodyText: null (every post still has previewText). Costs one extra request per free post; turn off for a faster metadata-only scrape.",
            "default": true
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Add each post's public comments (author display name, text, date, likes, replies as a flat list with parentId). One extra request per post that has comments.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Limit the comments added to each post. 0 = all.",
            "default": 0
          },
          "includePosts": {
            "title": "Include posts",
            "type": "boolean",
            "description": "Output one item per post. Turn off (and turn on \"Include publication info\") to get only a list of publications, e.g. for newsletter discovery.",
            "default": true
          },
          "includePublicationInfo": {
            "title": "Include publication info",
            "type": "boolean",
            "description": "Also output one item per publication (type: \"publication\"): name, URL, description, author, language, approximate subscriber count, paid subscriptions on/off, podcast on/off, creation date.",
            "default": false
          },
          "onlyNewPosts": {
            "title": "Only new posts (incremental mode)",
            "type": "boolean",
            "description": "Remember what was already output and only output (and charge for) posts published since the previous run. The first run outputs the matching posts and sets the baseline; later runs output only posts published after the first run. Posts are always listed newest-first in this mode.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor name (state key)",
            "type": "string",
            "description": "Name of this monitor's memory. Runs with the same name share the list of already-output posts (per publication). Use different names for independent monitors.",
            "default": "default"
          },
          "stateStoreName": {
            "title": "State key-value store name",
            "type": "string",
            "description": "Named key-value store in your account where incremental state is kept (letters, digits and dashes).",
            "default": "substack-scraper-state"
          },
          "maxConcurrency": {
            "title": "Max parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum parallel HTTP requests. Substack serves every publication from the same backend, so keep this low.",
            "default": 3
          },
          "requestIntervalMs": {
            "title": "Minimum delay between requests",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Minimum time between the start of two requests, across all publications. The default (250 ms, at most 4 requests per second) is polite and fast enough for thousands of posts per run.",
            "default": 250
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed for Substack's public API in normal use. Enable it only if Substack blocks or rate-limits the requests (HTTP 403 or 429 in the log).",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}