{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper: Posts, Comments, Stats & Ranks, No Login",
    "description": "Substack scraper, $0.50 per 1,000 rows. Posts from any publication (title, date, free or paid, likes, comments, restacks, words, free text), public comment threads, publication stats (subscribers shown, paid band, prices), search and leaderboards with ranks. Only new posts on schedules. No login.",
    "version": "0.1",
    "x-build-id": "cxH8Ycc6MN2HUS8DW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/locaihost~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-locaihost-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/locaihost~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-locaihost-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/locaihost~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-locaihost-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, posts or profiles",
            "type": "array",
            "description": "Substack publications to read posts from. Paste a link (https://example.substack.com or a custom domain like https://www.example.com), just the subdomain (example), a post link (/p/...) for one post, or a profile link (substack.com/@handle) for that writer's main publication.",
            "items": {
              "type": "string"
            }
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Words to search Substack for, the same search as the site's search box. Returns the publications writing about it, or the matching posts (see the next field).",
            "items": {
              "type": "string"
            }
          },
          "leaderboards": {
            "title": "Leaderboard categories",
            "type": "array",
            "description": "Substack leaderboard categories, e.g. technology, business, finance, culture, us-politics, food, sports, science, health, crypto, history. Each returns the ranked publications with their rank.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerPublication": {
            "title": "Posts per publication",
            "minimum": 0,
            "type": "integer",
            "description": "Newest posts to return from each publication. 0 = the whole archive.",
            "default": 20
          },
          "maxPerList": {
            "title": "Rows per search or leaderboard",
            "minimum": 0,
            "type": "integer",
            "description": "Most rows from each search term or leaderboard. 0 = as many as Substack lists.",
            "default": 25
          },
          "includeComments": {
            "title": "Add public comments",
            "type": "boolean",
            "description": "Also return the public comments under each free post, one row per comment or reply: commenter's display name and handle, text, date, likes and reply count. Paid posts are skipped (Substack shows their comments to subscribers only). Each comment is a row at the same price as a post.",
            "default": false
          },
          "includePublicationInfo": {
            "title": "Add a row for each publication",
            "type": "boolean",
            "description": "For the publications above, also return one row with the name, writer, description, subscriber figures the site shows, paid band and subscription prices.",
            "default": false
          },
          "searchFor": {
            "title": "Search returns",
            "enum": [
              "publications",
              "posts"
            ],
            "type": "string",
            "description": "What a search returns: one row per publication found, or one row per matching post.",
            "default": "publications"
          },
          "leaderboardType": {
            "title": "Leaderboard",
            "enum": [
              "paid",
              "trending"
            ],
            "type": "string",
            "description": "Bestsellers ranks publications by paid subscribers. Rising ranks the ones growing fastest.",
            "default": "paid"
          },
          "sortBy": {
            "title": "Post order",
            "enum": [
              "new",
              "top"
            ],
            "type": "string",
            "description": "Newest posts first, or Substack's Top order: the posts it ranks most popular on the publication's archive page (publication archives only).",
            "default": "new"
          },
          "archiveSearch": {
            "title": "Search inside these publications",
            "type": "string",
            "description": "Only posts from the publications above that match these words, the same search as a publication's own archive search. Results come by relevance. Empty = every post."
          },
          "maxCommentsPerPost": {
            "title": "Comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Most comments (replies included) per post when comments are on. 0 = all Substack returns.",
            "default": 20
          },
          "postedAfter": {
            "title": "Posted after",
            "type": "string",
            "description": "Only posts published after this: a date (2026-10-01) or a span back from now (24 hours, 7 days, 2 weeks, 3 months). Empty = no date limit."
          },
          "postedBefore": {
            "title": "Posted before",
            "type": "string",
            "description": "Only posts published before this: a date (2026-10-01) or a span back from now (7 days, 3 months). With Posted after it makes a date window. Posts left out are free. Empty = no end date."
          },
          "audience": {
            "title": "Post audience",
            "enum": [
              "all",
              "free",
              "paid"
            ],
            "type": "string",
            "description": "Free posts are open to everyone. Paid posts are for paying subscribers: you get their title, date, counts and link, never their text.",
            "default": "all"
          },
          "postTypes": {
            "title": "Post types",
            "type": "array",
            "description": "Only these kinds of post. Empty = all. Posts left out are free.",
            "items": {
              "type": "string",
              "enum": [
                "newsletter",
                "podcast",
                "thread",
                "video"
              ],
              "enumTitles": [
                "Newsletter",
                "Podcast",
                "Thread",
                "Video"
              ]
            }
          },
          "minLikes": {
            "title": "Minimum likes",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many likes. Posts left out are free. 0 = no minimum.",
            "default": 0
          },
          "minComments": {
            "title": "Minimum comments",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts with at least this many comments. 0 = no minimum.",
            "default": 0
          },
          "minRestacks": {
            "title": "Minimum restacks",
            "minimum": 0,
            "type": "integer",
            "description": "Only posts restacked at least this many times. 0 = no minimum.",
            "default": 0
          },
          "includeBody": {
            "title": "Include post text (free posts)",
            "type": "boolean",
            "description": "Add the full text of each free post as plain text. Paid posts never include text. Costs one extra request per free post, so runs take longer.",
            "default": false
          },
          "bodyFormat": {
            "title": "Post text format",
            "enum": [
              "text",
              "html",
              "markdown"
            ],
            "type": "string",
            "description": "Plain text only, or also the post as cleaned HTML (`bodyHtml`) or Markdown (`bodyMarkdown`, with headings, lists, links and images). Either turns on post text. Free posts only; paid posts never include text.",
            "default": "text"
          },
          "includePodcastUrl": {
            "title": "Add podcast audio links",
            "type": "boolean",
            "description": "Adds `podcastUrl`, the audio file of free podcast episodes. Paid episodes never get a link.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new since the last run",
            "type": "boolean",
            "description": "Skip rows this same setup returned before, so a scheduled run returns (and charges for) new posts only. On leaderboards it returns only new entrants.",
            "default": false
          },
          "trackSubscriberChanges": {
            "title": "Track subscriber-band changes",
            "type": "boolean",
            "description": "Remembers each publication's subscriber band and bestseller tier between runs and adds `previousSubscriberBand`, `previousBestsellerTier` and `changedAt` to publication rows. With Only new on, a publication you already have comes back when its band or tier changes.",
            "default": false
          },
          "maxResults": {
            "title": "Max rows in total",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many charged rows. 0 = no limit.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}