{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper - Newsletter Posts, Full Text & RAG Chunks",
    "description": "Scrape Substack newsletters: posts with likes, comments, paywall flag and authors; full text as markdown with RAG chunks; publication search, post search and category rankings with subscriber counts. Only new posts on daily runs. Error rows are free.",
    "version": "0.1",
    "x-build-id": "dVXGEVkC8EzyuzFur"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapewise~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapewise-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/scrapewise~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapewise-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/scrapewise~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapewise-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": {
          "startUrls": {
            "title": "Substack publications or posts",
            "type": "array",
            "description": "Publications or posts, one per line: a publication address on substack.com or on its own domain (for example https://www.noahpinion.blog, https://www.oneusefulthing.org or https://name.substack.com), a post link (.../p/post-name), an author's @handle, or just the newsletter name. Upper case, missing https and extra paths are fine. Each publication returns its latest posts (title, date, likes, comments, restacks, paywall flag). Leave every list empty to run an example publication. Also accepts 'urls', 'publications', 'publicationUrls' or 'postUrls'.",
            "items": {
              "type": "string"
            }
          },
          "searchPosts": {
            "title": "Search posts",
            "type": "array",
            "description": "Search terms, one per line (for example AI agents, interest rates, college football). Searches posts across all of Substack, most relevant first, up to 'Max results per search or category'. Each row keeps the term it came from. Also accepts 'postSearch' or 'searchTerms'.",
            "items": {
              "type": "string"
            }
          },
          "searchPublications": {
            "title": "Search publications",
            "type": "array",
            "description": "Search terms, one per line (for example climate, venture capital, personal finance). Returns matching newsletters with author, subscriber count when public and paid plan prices, charged as publication rows. Add 'Latest posts of each publication found' to also get their posts. Also accepts 'publicationSearch'.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories (rankings)",
            "type": "array",
            "description": "Substack categories, one per line, as named on Substack: Technology, Business, Finance, Culture, U.S. Politics, World Politics, Science, Health & Wellness, Sports, Food & Drink, Crypto, History, Fiction, Music, Education and more. Returns the category ranking chosen below with each publication's rank, charged as publication rows. Also accepts 'category'.",
            "items": {
              "type": "string"
            }
          },
          "categoryRanking": {
            "title": "Category ranking",
            "enum": [
              "bestsellers",
              "rising",
              "all"
            ],
            "type": "string",
            "description": "Which list to read for each category: Bestsellers (default, Substack's paid leaderboard), Rising (the trending list) or All (every publication Substack lists in the category). Used only with Categories.",
            "default": "bestsellers"
          },
          "maxPostsPerPublication": {
            "title": "Max posts per publication",
            "minimum": 0,
            "type": "integer",
            "description": "Stop each publication after this many posts (default 20). 0 means the whole archive, up to 10,000 posts. You pay per post delivered, so start low for large archives. Also accepts 'maxPosts' or 'maxItems'.",
            "default": 20
          },
          "maxResultsPerSearch": {
            "title": "Max results per search or category",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many results to take from each search or category (1 to 1,000, default 20): posts for a post search, publications for a publication search or category.",
            "default": 20
          },
          "postsPerFoundPublication": {
            "title": "Latest posts of each publication found",
            "minimum": 0,
            "type": "integer",
            "description": "For publication searches and categories: also delivers this many latest posts of every publication found (for example 5). 0 (default) returns publications only. Each post is charged as a post, so 50 publications with 5 posts each adds 250 posts.",
            "default": 0
          },
          "sortBy": {
            "title": "Posts order",
            "enum": [
              "newest",
              "top"
            ],
            "type": "string",
            "description": "Order of each publication's posts: Newest (default, newest first) or Top (the publication's most popular posts). With a post limit it decides which posts you get. 'Only new posts' always reads newest first. Also accepts 'sort'.",
            "default": "newest"
          },
          "includePublicationDetails": {
            "title": "Publication details for the URLs",
            "type": "boolean",
            "description": "Also delivers one row per publication given in the URLs above with its name, description, author, subscriber count when public, paid plan prices and podcast. Charged as a publication row. Off by default. Also accepts 'includePublication'.",
            "default": false
          },
          "includeFullText": {
            "title": "Full post text (markdown)",
            "type": "boolean",
            "description": "Also delivers the full text of every public post as clean Markdown (headings, lists, links, images), with its word count. One extra request per post, charged as a separate 'Full post text' event. Paid posts come with the free public preview only, marked textIsPreview, and are not charged for text. Off by default. Also accepts 'fullText'.",
            "default": false
          },
          "chunkSizeWords": {
            "title": "RAG chunks: words per chunk",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "0 (default) means off. Above 0, each post also gets a 'chunks' array ready for embeddings and RAG: pieces of about this many words (up to 5,000), cut only between paragraphs (or sentences in a long paragraph), each with its section heading, post id, title and URL. Turns on the full text (and its charge). 300 is a good start. The 'RAG chunks' dataset view shows one row per chunk.",
            "default": 0
          },
          "chunkOverlapWords": {
            "title": "RAG chunks: overlap words",
            "minimum": 0,
            "maximum": 2500,
            "type": "integer",
            "description": "Words repeated from the end of each chunk at the start of the next one (default 50), so an idea cut in two keeps its context. Capped at half the chunk size. 0 for no overlap. Used only when 'RAG chunks: words per chunk' is above 0.",
            "default": 50
          },
          "onlyNew": {
            "title": "Only new posts since the last run",
            "type": "boolean",
            "description": "For scheduled runs. Remembers which posts each publication (and each search or category) already delivered, in a named key-value store in your account ('substack-scraper-state'), and delivers only what was not delivered before. The first run delivers up to the limit and marks what it read as seen. Seen items are not delivered and not charged. Publications are read newest first. Delete the store to start over. Also accepts 'onlyNewPosts'.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "The default Apify Proxy works. Keep the default.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}