{
  "openapi": "3.0.1",
  "info": {
    "title": "Substack Scraper",
    "description": "Scrape any Substack. Get full articles in Markdown, text or HTML, plus comments, aut\nhor profiles, subscriber counts, pricing and category leaderboards, no login. Made for sales teams build\ning sponsor lists, analysts benchmarking newsletters, and AI teams gathering clean long form training da\nta.",
    "version": "1.0",
    "x-build-id": "GuFaOzpkY3pciCziq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/normdata~substack-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-normdata-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/normdata~substack-scraper/runs": {
      "post": {
        "operationId": "runs-sync-normdata-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/normdata~substack-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-normdata-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Type of data",
            "enum": [
              "posts",
              "publications",
              "leaderboard",
              "author",
              "notes"
            ],
            "type": "string",
            "description": "**Articles** — the posts from one or more newsletters (choose them by link, or find them by topic).\n**Newsletter profiles** — one row per newsletter: subscribers, subscription price, how often it posts, who writes it.\n**Top newsletters (Leaderboard)** — the biggest newsletters in a category. Great for exploring a niche.\n**Writer profile** — everything about a person from their @handle: bio, links, follower count, and every newsletter they run.\n**Notes** — a newsletter's short posts (the Notes feed).\n\n_On the Apify **Free** plan every run is limited to a fixed 10‑row sample; upgrade to run your own settings._"
          },
          "urls": {
            "title": "Newsletter links — for Articles, Newsletter profiles, Notes",
            "type": "array",
            "description": "Paste one or more newsletter addresses, e.g. `https://www.lennysnewsletter.com` or `https://mynewsletter.substack.com`. A link to a single article works too.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "…or topics to find newsletters by — for Articles",
            "type": "array",
            "description": "No links? Type one or more topics and the scraper pulls the top newsletters in that area from Substack's own category rankings — e.g. `artificial intelligence`, `crypto`, `investing`, `climate`, `marketing`, `politics`, `health`. Newsletters that mention your exact words are listed first. Can be combined with the links above.",
            "items": {
              "type": "string"
            }
          },
          "authorHandles": {
            "title": "Writer handles — for Writer profile",
            "type": "array",
            "description": "The person's Substack handle, with or without the `@` (e.g. `lenny`). You get their bio, links, follower and subscriber counts, and every newsletter they run.",
            "items": {
              "type": "string"
            }
          },
          "leaderboardCategory": {
            "title": "Category — for Top newsletters",
            "type": "string",
            "description": "One category name. Examples: Technology, Business, Finance, Culture, U.S. Politics, News, Health & Wellness, Faith & Spirituality, Food & Drink, Sports, Music, Fiction, Art & Illustration, Climate & Environment, Education, Fashion & Beauty, Travel, Parenting, Humor, Crypto, Science, Literature."
          },
          "leaderboardType": {
            "title": "Rank by — for Top newsletters",
            "enum": [
              "paid",
              "free"
            ],
            "type": "string",
            "description": "Rank the newsletters by their number of paying subscribers, or by their whole audience (free readers included)."
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "type": "integer",
            "description": "Stop once this many rows are in the dataset. Leave empty to get everything. _(Free plan: always capped at 10.)_"
          },
          "maxPostsPerNewsletter": {
            "title": "Articles per newsletter",
            "minimum": 0,
            "type": "integer",
            "description": "Newest first. Use `0` for a newsletter's entire archive (paid Apify plans)."
          },
          "maxNewslettersPerKeyword": {
            "title": "Newsletters to find per topic",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "When you search by topic, how many newsletters to take for each topic you typed."
          },
          "includeContent": {
            "title": "Full article text",
            "type": "boolean",
            "description": "Include the whole article body. Turn this off for a quick, cheap run with just the headline, author and stats."
          },
          "contentFormat": {
            "title": "Text format",
            "enum": [
              "markdown",
              "text",
              "html",
              "all"
            ],
            "type": "string",
            "description": "**Markdown** — clean and easy to reuse (recommended). **Plain text** — no formatting. **HTML** — the original web markup. **Everything** — all three."
          },
          "includePublicationInfo": {
            "title": "Newsletter stats (subscribers, price, author)",
            "type": "boolean",
            "description": "Add the newsletter's subscriber count, subscription price (monthly / yearly / founding) and author details to every article row."
          },
          "includeRecommendations": {
            "title": "Recommended newsletters",
            "type": "boolean",
            "description": "The other newsletters this one recommends — handy for mapping out a niche."
          },
          "includeComments": {
            "title": "Reader comments",
            "type": "boolean",
            "description": "Include the comment threads under each article, with replies, authors and likes. Slower."
          },
          "maxCommentsPerPost": {
            "title": "Comments per article",
            "minimum": 0,
            "type": "integer",
            "description": "Cap the number of comments (replies included) collected per article. `0` means no comments."
          },
          "includeNotes": {
            "title": "Notes",
            "type": "boolean",
            "description": "Attach the newsletter's recent Notes when they're public."
          },
          "contentType": {
            "title": "Only this kind of post",
            "enum": [
              "all",
              "newsletter",
              "podcast",
              "thread"
            ],
            "type": "string",
            "description": "Keep only regular posts, podcast episodes, or discussion threads."
          },
          "publishedAfter": {
            "title": "Published on or after",
            "type": "string",
            "description": "Only articles from this date onward. Format: `YYYY-MM-DD` (e.g. `2025-01-01`)."
          },
          "publishedBefore": {
            "title": "Published on or before",
            "type": "string",
            "description": "Only articles up to this date. Format: `YYYY-MM-DD`."
          },
          "onlyFree": {
            "title": "Skip paywalled articles",
            "type": "boolean",
            "description": "Only include articles that are free to read in full."
          },
          "onlyNewerThan": {
            "title": "Only articles newer than (for scheduled runs)",
            "type": "string",
            "description": "For a scheduled run: only pick up articles published after this date, so each run returns just what's new. Format: `YYYY-MM-DD`."
          },
          "outputMode": {
            "title": "How should the rows be organized?",
            "enum": [
              "post",
              "comment"
            ],
            "type": "string",
            "description": "**One row per article** — comments stay nested inside the article row.\n**One row per comment** — every comment gets its own row with the article details repeated on it, ready for a spreadsheet or CRM."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}