{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Posts & Newsletters Scraper",
    "description": "Scrape Substack posts and find newsletters by category leaderboard: titles, dates, likes, comments, free-post text, subscriber counts, prices, author social links and recommendations.",
    "version": "0.1",
    "x-build-id": "5eZJcMmYmozHUZ0QL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thisisb3~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thisisb3-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/thisisb3~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-thisisb3-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/thisisb3~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-thisisb3-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": "Newsletters to scrape. Paste the address as you see it: name.substack.com, a custom domain such as www.astralcodexten.com, or any link to the publication. You get its latest posts and, unless you switch it off below, one row with the publication's details.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories (find newsletters)",
            "type": "array",
            "description": "Discover newsletters by Substack category. Each category returns its top publications as publication rows: name, leaderboard rank, subscriber count, prices, authors and their social links. Posts are not scraped for these; paste the ones you like into Publications.",
            "items": {
              "type": "string",
              "enum": [
                "culture",
                "technology",
                "business",
                "us-politics",
                "finance",
                "food",
                "sports",
                "art",
                "world-politics",
                "health-politics",
                "news",
                "fashionandbeauty",
                "music",
                "faith",
                "climate",
                "science",
                "literature",
                "fiction",
                "health",
                "design",
                "travel",
                "parenting",
                "philosophy",
                "comics",
                "international",
                "crypto",
                "history",
                "humor",
                "education",
                "film-and-tv",
                "home-garden",
                "games"
              ],
              "enumTitles": [
                "Culture",
                "Technology",
                "Business",
                "U.S. Politics",
                "Finance",
                "Food & Drink",
                "Sports",
                "Art & Illustration",
                "World Politics",
                "Health Politics",
                "News",
                "Fashion & Beauty",
                "Music",
                "Faith & Spirituality",
                "Climate & Environment",
                "Science",
                "Literature",
                "Fiction",
                "Health & Wellness",
                "Design",
                "Travel",
                "Parenting",
                "Philosophy",
                "Comics",
                "International",
                "Crypto",
                "History",
                "Humor",
                "Education",
                "Film & TV",
                "Home & Garden",
                "Games"
              ]
            }
          },
          "postUrls": {
            "title": "Post URLs",
            "type": "array",
            "description": "Individual posts to scrape, e.g. https://name.substack.com/p/post-title. Links copied from the Substack app (substack.com/@name/p-123456789) work too.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerPublication": {
            "title": "Max posts per publication",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Latest posts to scrape from each publication in Publications, newest first. Set to 0 to skip posts and get only the publication rows.",
            "default": 20
          },
          "includeFullText": {
            "title": "Include full text of free posts",
            "type": "boolean",
            "description": "Adds the post text (plain text and HTML) for free, public posts. Paywalled and subscriber-only posts never include text. Rows with text are billed as \"post with full text\".",
            "default": false
          },
          "includePublicationInfo": {
            "title": "Include publication details",
            "type": "boolean",
            "description": "Adds one row per publication in Publications: name, category, leaderboard rank, subscriber count, prices, authors and their public social links.",
            "default": true
          },
          "includeRecommendations": {
            "title": "Include recommended newsletters",
            "type": "boolean",
            "description": "Adds the newsletters each publication recommends (its recommendation network) to its publication row. One extra request per publication.",
            "default": false
          },
          "categoryRanking": {
            "title": "Category list",
            "enum": [
              "bestsellers",
              "all"
            ],
            "type": "string",
            "description": "Bestsellers is Substack's paid leaderboard for the category (ranked, with the leaderboard rank in each row). All newsletters lists every publication in the category, including free ones, without a leaderboard rank.",
            "default": "bestsellers"
          },
          "maxPublicationsPerCategory": {
            "title": "Max publications per category",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How many publications to return from each category, from the top of the list. Substack's leaderboard pages show the top 25.",
            "default": 25
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after this many rows in total (posts plus publications). Set to 0 for no limit. You are only charged for rows you receive.",
            "default": 1000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many requests run in parallel; also the most requests started per second. The default is deliberately polite, and the scraper slows down automatically if Substack asks it to.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}