{
  "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.1",
    "x-build-id": "fJktvrhdmLDOpNdeL"
  },
  "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": "What do you want to get?",
            "enum": [
              "posts",
              "publications",
              "leaderboard",
              "author",
              "notes"
            ],
            "type": "string",
            "description": "**Articles**: posts from newsletters you choose or find by topic.\n**Newsletter profiles**: one row per newsletter with subscribers, price and how often it posts.\n**Top newsletters (Leaderboard)**: the biggest newsletters in a category. Best way to explore a niche.\n**Writer profile**: everything a person publishes, from their @handle.\n**Notes**: a newsletter's short posts (Notes feed)."
          },
          "urls": {
            "title": "Newsletter links",
            "type": "array",
            "description": "Paste one or more newsletter addresses, for example `https://www.lennysnewsletter.com` or `https://mynewsletter.substack.com`. A single article link works too. Used for Articles, Newsletter profiles and Notes.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "…or find newsletters by topic",
            "type": "array",
            "description": "Don't have the 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. You can combine this with the links above.",
            "items": {
              "type": "string"
            }
          },
          "authorHandles": {
            "title": "Writer handles",
            "type": "array",
            "description": "Only for **Writer profile**. The person's Substack handle, with or without the @ (for example `lenny`). You get their bio, links, follower and subscriber counts, and every newsletter they run.",
            "items": {
              "type": "string"
            }
          },
          "leaderboardCategory": {
            "title": "Category",
            "type": "string",
            "description": "Only for **Top newsletters**. For example: Technology, Business, Finance, Culture, Politics, U.S. Politics, News, Health & Wellness, Faith & Spirituality, Food & Drink, Sports, Music, Fiction, Art & Illustration, Climate & Environment, Education, Fashion & Beauty, Travel, Parenting, Humor, Crypto."
          },
          "leaderboardType": {
            "title": "Rank by",
            "enum": [
              "paid",
              "free"
            ],
            "type": "string",
            "description": "Rank newsletters by paying subscribers, or by their whole audience (free readers included)."
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many rows. Leave empty to get everything. On the Apify Free plan every run is limited to the sample (10)."
          },
          "maxPostsPerNewsletter": {
            "title": "Articles per newsletter",
            "minimum": 0,
            "type": "integer",
            "description": "Newest first. Set to `0` for the entire archive (paid Apify plans)."
          },
          "maxNewslettersPerKeyword": {
            "title": "Newsletters to find per topic",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "When searching by topic, how many newsletters to take for each one."
          },
          "includeContent": {
            "title": "Full article text",
            "type": "boolean",
            "description": "Include the whole article. Turn this off for a quick, low-cost run with just the headline and stats."
          },
          "contentFormat": {
            "title": "Text format",
            "enum": [
              "markdown",
              "text",
              "html",
              "all"
            ],
            "type": "string",
            "description": "**Markdown** is clean and easy to reuse (recommended). **Plain text** has no formatting. **HTML** is the original web markup. **Everything** includes 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."
          },
          "includeComments": {
            "title": "Reader comments",
            "type": "boolean",
            "description": "Include the comment threads under each article, with replies, authors and likes."
          },
          "maxCommentsPerPost": {
            "title": "Comments per article",
            "minimum": 0,
            "type": "integer",
            "description": "Limit how many comments (including replies) to collect per article. `0` means no comments."
          },
          "includeRecommendations": {
            "title": "Recommended newsletters",
            "type": "boolean",
            "description": "The other newsletters this one recommends, useful for mapping a niche."
          },
          "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 after",
            "type": "string",
            "description": "Only articles from this date onward. Format: YYYY-MM-DD (for example 2025-01-01)."
          },
          "publishedBefore": {
            "title": "Published 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."
          },
          "onlyNewerThan": {
            "title": "Only articles newer than",
            "type": "string",
            "description": "For scheduled runs: only pick up articles published after this date. Format: YYYY-MM-DD."
          },
          "outputMode": {
            "title": "How should the rows be organized?",
            "enum": [
              "post",
              "comment"
            ],
            "type": "string",
            "description": "**One row per article** keeps comments nested inside. **One row per comment** spreads comments out with the article details on each, 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}