{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Posts Scraper",
    "description": "Scrape Substack newsletter posts from any publication on a subdomain or custom domain. Returns full post text, engagement, tags and paywall status.",
    "version": "0.4",
    "x-build-id": "VVz7Bc1Xn3w5LENd2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~substack-posts-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-substack-posts-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/khadinakbar~substack-posts-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-substack-posts-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/khadinakbar~substack-posts-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-substack-posts-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": {
          "startUrls": {
            "title": "Substack publication or post URLs",
            "type": "array",
            "description": "Substack publication URLs (e.g. 'https://platformer.substack.com' or a custom domain such as 'https://www.lennysnewsletter.com') and/or single post URLs ('https://.../p/some-post'). Each publication is read newest first, up to 'Max posts per publication'. This field takes URLs. To find posts by topic across ALL of Substack, leave it empty and use 'Search topic across Substack'. To search inside one publication, use 'Search inside the publication'.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL",
                  "description": "A Substack publication or post URL, e.g. https://platformer.substack.com"
                }
              },
              "required": [
                "url"
              ]
            }
          },
          "maxPosts": {
            "title": "Max posts per publication",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Hard cap on posts returned and billed per publication. Each post is one billable result. Defaults to 50; the prefill of 10 makes a first test cost about $0.05.",
            "default": 50
          },
          "includeBodyHtml": {
            "title": "Include full body HTML",
            "type": "boolean",
            "description": "When true (default), fetches each post's full article HTML. Public posts return the full HTML; paid posts return the public preview only. Adds one request per post.",
            "default": true
          },
          "includeBodyText": {
            "title": "Include plain text body",
            "type": "boolean",
            "description": "When true (default), includes a plain-text version of the article body (derived from the HTML). Public posts return full text; paid posts return the teaser only. Disable to reduce payload size.",
            "default": true
          },
          "publishedAfter": {
            "title": "Published after (ISO date)",
            "type": "string",
            "description": "Optional ISO 8601 date or datetime. Only posts published on or after this date are returned, e.g. '2026-01-01' or '2026-06-01T00:00:00Z'. Leave empty for no lower bound.",
            "default": ""
          },
          "publishedBefore": {
            "title": "Published before (ISO date)",
            "type": "string",
            "description": "Optional ISO 8601 date or datetime. Only posts published on or before this date are returned. Leave empty for no upper bound.",
            "default": ""
          },
          "audience": {
            "title": "Audience filter",
            "enum": [
              "all",
              "free",
              "paid"
            ],
            "type": "string",
            "description": "Filter posts by paywall audience. 'all' (default) returns every post; 'free' returns only free posts; 'paid' returns only paid/paywalled posts (metadata + teaser).",
            "default": "all"
          },
          "sort": {
            "title": "Sort order",
            "enum": [
              "new",
              "top"
            ],
            "type": "string",
            "description": "'new' (default) returns newest posts first. 'top' returns the publication's most popular posts first.",
            "default": "new"
          },
          "searchQuery": {
            "title": "Search inside the publication",
            "type": "string",
            "description": "Optional keyword or phrase. Only posts of each publication that match it are returned (Substack's own in-publication search). Leave empty for all posts."
          },
          "includeBodyMarkdown": {
            "title": "Include Markdown body",
            "type": "boolean",
            "description": "When true, adds a 'bodyMarkdown' field with the article converted to clean Markdown, ready for AI and search pipelines. Default false. Same price as without.",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "When true, returns each post's reader comments as extra rows (recordType 'comment', one row per comment, with replies marked by parentCommentId). Comments are billed per comment with the 'comment-scraped' event, which is only available once it appears on the Actor's Pricing tab. Default false.",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on comments returned and billed per post when 'Include comments' is on. Default 20.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "Optional Apify proxy. Substack's public JSON API works without one, so leave this off unless you hit a transient network block.",
            "default": {
              "useApifyProxy": false
            }
          },
          "searchTopic": {
            "title": "Search topic across Substack",
            "type": "string",
            "description": "Find posts about a topic across all of Substack (not just one publication), for example \"ai agents\". Returns the newest/most relevant public posts, billed per post like any other post. Leave Start URLs empty to use only this. Optional."
          },
          "includePublicationProfile": {
            "title": "Add publication profile row (free)",
            "type": "boolean",
            "description": "Adds one free row per publication (recordType \"publication\") with the author bio, rounded subscriber count (for example \"175K+ subscribers\"), follower count and public social links. Only public Substack profile fields; no private emails. Never billed. Default true.",
            "default": true
          },
          "includeReactors": {
            "title": "Include post likers",
            "type": "boolean",
            "description": "Adds one row per person who liked a post (recordType \"reactor\": name, profile link, publication). Substack exposes at most 100 per post. Billed per reactor with the \"reactor-scraped\" event once it appears on the Pricing tab. Default false.",
            "default": false
          },
          "maxReactorsPerPost": {
            "title": "Max likers per post",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Cap on liker rows per post (1 to 100). Used only when \"Include post likers\" is on.",
            "default": 50
          },
          "includeNotes": {
            "title": "Include author Notes",
            "type": "boolean",
            "description": "Adds the lead author's public Substack Notes (short posts) as rows (recordType \"note\": text, date, likes, restacks, replies, link). Billed per note with the \"note-scraped\" event once it appears on the Pricing tab. Default false.",
            "default": false
          },
          "maxNotesPerPublication": {
            "title": "Max Notes per publication",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Cap on Notes rows per publication (1 to 1000). Used only when \"Include author Notes\" is on.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}