{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper – Newsletter Posts, Full Text & Comments",
    "description": "Substack scraper without login: newsletter posts with full text of free posts (paywalled posts flagged, free preview only), likes, comment counts, tags and cover images, full comment threads, publication info (subscribers, author) and category leaderboards. Works with custom domains.",
    "version": "1.0",
    "x-build-id": "ecG1mzer6gPwqZWhE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/openharvest~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-openharvest-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/openharvest~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-openharvest-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/openharvest~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-openharvest-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "posts",
              "postDetails",
              "comments",
              "discover"
            ],
            "type": "string",
            "description": "<b>posts</b> = latest posts of each publication (newest first). <b>postDetails</b> = specific posts by URL. <b>comments</b> = comment threads of posts (by URL, or of the latest posts of each publication). <b>discover</b> = top publications of a Substack category (leaderboards).",
            "default": "posts"
          },
          "publications": {
            "title": "Publications",
            "type": "array",
            "description": "Modes <b>posts</b> and <b>comments</b>: Substack newsletters. Accepted: subdomain (<code>lenny</code>), <code>lenny.substack.com</code>, any URL of the newsletter, custom domains (<code>www.astralcodexten.com</code>) or an author handle (<code>@lenny</code>).",
            "default": [
              "astralcodexten"
            ],
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "Post URLs",
            "type": "array",
            "description": "Modes <b>postDetails</b> and <b>comments</b>: post links such as <code>https://name.substack.com/p/post-slug</code>, custom-domain post links, <code>open.substack.com/pub/name/p/slug</code> or <code>substack.com/home/post/p-123456</code>.",
            "items": {
              "type": "string"
            }
          },
          "category": {
            "title": "Category (discover)",
            "type": "string",
            "description": "Mode <b>discover</b>: Substack category slug, name or ID, e.g. <code>technology</code>, <code>business</code>, <code>finance</code>, <code>culture</code>, <code>us-politics</code>, <code>science</code>, <code>health</code>, <code>crypto</code>, <code>history</code>, <code>sports</code>, <code>music</code>, <code>food</code>. Subcategories work too.",
            "default": "technology"
          },
          "ranking": {
            "title": "Ranking (discover)",
            "enum": [
              "paid",
              "trending",
              "all"
            ],
            "type": "string",
            "description": "Mode <b>discover</b>: which list to read. <b>paid</b> = Bestseller leaderboard (most paid subscribers). <b>trending</b> = Rising leaderboard. <b>all</b> = all publications Substack lists for the category.",
            "default": "paid"
          },
          "onlyNewerThan": {
            "title": "Only posts newer than",
            "type": "string",
            "description": "Modes <b>posts</b> and <b>comments</b>: skip posts older than this. Absolute date (YYYY-MM-DD) or relative period such as <code>7 days</code>, <code>1 month</code>."
          },
          "maxPostsPerPublication": {
            "title": "Max posts per publication",
            "minimum": 0,
            "type": "integer",
            "description": "Modes <b>posts</b> and <b>comments</b>: how many of the newest posts to read from each publication. 0 = the whole archive.",
            "default": 20
          },
          "includeFullText": {
            "title": "Include full text",
            "type": "boolean",
            "description": "Mode <b>posts</b>: load the body of each post as plain text (<code>bodyText</code>). Free posts get the full article; paid posts only the free preview (<code>paywalled: true</code>). Mode <b>postDetails</b> always includes it.",
            "default": true
          },
          "includeHtml": {
            "title": "Include body HTML",
            "type": "boolean",
            "description": "Also save the original HTML of the post body in <code>bodyHtml</code> (only when the full text is loaded).",
            "default": false
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Modes <b>posts</b> and <b>postDetails</b>: after each post, also return its public comments (each comment is charged as a 'comment' event).",
            "default": false
          },
          "maxCommentsPerPost": {
            "title": "Max comments per post",
            "minimum": 0,
            "type": "integer",
            "description": "Limit comments per post (threads are returned depth-first in Substack's 'best first' order). 0 = all comments.",
            "default": 100
          },
          "includePublicationInfo": {
            "title": "Include publication info",
            "type": "boolean",
            "description": "Mode <b>posts</b>: add one item per publication with name, author, description, subscriber count, language and logo (charged as a 'publication' event).",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of items in total (posts + comments + publications). You pay per item, so this also caps your cost.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Usually not needed. Enable Apify Proxy only if you scrape thousands of posts and see HTTP 429 (rate limit) warnings.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}