# Substack Scraper - Substack API for Posts, Notes (`automation_craft/substack-scraper`) Actor

Substack scraper and API, no login: newsletter posts with full article HTML and word count, nested comment threads, Notes by keyword or from an author's feed, author and publication profiles and category leaderboards. JSON, CSV, Excel. Paywalled posts are flagged and never billed as full content.

- **URL**: https://apify.com/automation_craft/substack-scraper.md
- **Developed by:** [Automation Craft](https://apify.com/automation_craft) (community)
- **Categories:** News, Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 5 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Substack Scraper: Posts, Notes and Profiles

This Substack scraper covers **every public Substack surface** in one actor: full posts with complete article HTML, nested comment threads, Substack Notes search, author profiles with subscriber signals, publication profiles, and category leaderboards. No login, no cookies, no proxy configuration, no code.

### Quick start

1. Put one or more publications in `publications`, for example `astralcodexten.com`, `slowboring.com` or a bare name. Custom domains, `*.substack.com` subdomains and full URLs all work; redirect and `www` variants are retried automatically instead of failing with a 404.
2. Turn on what you need: full article content, comment threads, the publication profile. Or skip publications entirely and use `authorHandles`, `noteSearchQueries` or `leaderboardCategories`.
3. Set `maxPostsPerPublication` or `maxItemsTotal` so the cost is bounded before you press Start, then run. Export JSON, CSV or Excel, or read the dataset over the Apify API.

### Everything this Actor covers

| What you want | How | What you get |
|---|---|---|
| **Posts from a publication** | `publications: ["astralcodexten.com"]` | Title, subtitle, date, authors, likes, comment count, restacks, cover image, podcast audio URL and duration, paywall flag |
| **Full article content** | toggle *Include full article content* | Complete `bodyHtml` plus clean `bodyText` plus word count, ready for research, RAG, and AI datasets |
| **Single posts** | `postUrls: ["https://…/p/slug"]` | The same rich record for exactly the posts you point at |
| **Comment threads** | toggle *Include comment threads* | The full nested tree, flattened with `parentId` and `depth`, author, likes |
| **Search inside a publication** | *Search within publications* | Server-side archive search (`sort: new/top`, date window) |
| **Author profiles** | `authorHandles: ["@handle"]` | Follower count, subscriber signals ("Thousands of subscribers"), bestseller tier, bio, social links, primary publication |
| **Authors' Notes** | toggle *Include authors' recent Notes* | Their recent short-form Notes with engagement |
| **Notes keyword search** | `noteSearchQueries: ["ai agents"]` | Platform-wide Notes matching your query: text, author, likes, restacks, images |
| **Category leaderboards** | `leaderboardCategories: ["technology"]` | Ranked publications per category with subscriber signals, paid tier, author: the market map of Substack |

#### Output example (post with content)

```json
{
  "type": "post",
  "publicationHost": "www.astralcodexten.com",
  "id": "212058143",
  "slug": "your-review-tomorrow-and-tomorrow",
  "title": "Your Book Review: Tomorrow, and Tomorrow, and Tomorrow",
  "url": "https://www.astralcodexten.com/p/your-review-tomorrow-and-tomorrow",
  "postDate": "2026-08-22T13:01:33.000Z",
  "postType": "newsletter",
  "audience": "everyone",
  "paywalled": false,
  "authors": [{ "id": 12009663, "name": "Scott Alexander", "handle": "astralcodexten" }],
  "reactionCount": 214,
  "commentCount": 361,
  "podcast": null,
  "bodyHtml": "<p>…full article HTML…</p>",
  "bodyText": "…clean plain text…",
  "wordCount": 5843,
  "contentRetrieved": true
}
```

Every record type (`post`, `comment`, `note`, `author-profile`, `publication-profile`, `leaderboard-entry`, `status`) is a flat, documented shape.

### Honest paywall handling, read this

- Paywalled posts are delivered as **metadata with `paywalled: true`** and an empty body.
- They are **never charged at the full-content price**. You pay the Post price only.
- This Actor does **not** bypass paywalls, ever. If you need paid-post bodies, subscribe to the publication.

### How much does it cost to scrape Substack?

You pay per delivered record, so a run costs exactly what it delivers. Zero results means zero record charges, with a status record explaining why. Apify Store tiers take 10% off (Silver) or 20% off (Gold) every result event; the Actor start event is the same for everyone.

| Event | Free and Bronze | Silver (10% off) | Gold (20% off) |
|---|---|---|---|
| Actor Start | $0.005 | $0.005 | $0.005 |
| Post | $0.002 | $0.0018 | $0.0016 |
| Article body (only when the body is actually delivered) | $0.002 | $0.0018 | $0.0016 |
| Comment | $0.0005 | $0.00045 | $0.0004 |
| Note | $0.001 | $0.0009 | $0.0008 |
| Author profile | $0.005 | $0.0045 | $0.004 |
| Publication profile | $0.005 | $0.0045 | $0.004 |
| Leaderboard entry | $0.001 | $0.0009 | $0.0008 |

Worked examples at the Free and Bronze prices: 25 latest posts with full content = **$0.105**. A 100-entry technology leaderboard = **$0.105**. 50 Notes on a keyword = **$0.055**. An author profile plus their 50 recent Notes = **$0.06**.

### Input

| Field | Type | Notes |
|---|---|---|
| `publications` | array | Publications to pull posts from: bare name, `*.substack.com`, custom domain or full URL |
| `includeContent` | boolean | Fetch each post's full body (HTML, plain text, word count) |
| `includeComments` | boolean | Fetch the nested comment tree, flattened with `parentId` and `depth` |
| `includePublicationProfile` | boolean | One publication-profile record per publication |
| `sort` | string | Archive order: `new` (latest first) or `top` (most popular first) |
| `searchInPublication` | string | Server-side keyword search inside each publication's archive |
| `publishedAfter` | string | Only posts published on or after this date (YYYY-MM-DD) |
| `maxPostsPerPublication` | integer | Cap on charged post records per publication, honored exactly |
| `postUrls` | array | Direct post URLs to fetch individually |
| `maxCommentsPerPost` | integer | Cap on charged comment records per post |
| `authorHandles` | array | Author handles: `@handle`, `handle`, or the full profile URL |
| `includeAuthorNotes` + `maxNotesPerAuthor` | boolean, integer | Each author's recent public Notes, capped |
| `noteSearchQueries` + `maxNotesPerQuery` | array, integer | Platform-wide Notes keyword search, capped |
| `leaderboardCategories` + `maxPublicationsPerCategory` | array, integer | Category leaderboards, capped |
| `maxItemsTotal` | integer | Overall cap on charged records for the run |

### What this Actor does NOT do

- ❌ **No paywall bypass.** Paid post bodies stay with paying subscribers.
- ❌ **No global post search.** Substack's site-wide post search requires a logged-in session, so it is not offered. Per-publication archive search *is* offered (server-side), and Notes search is platform-wide.
- ❌ **No people search by keyword.** That endpoint is login-gated; profile lookup by handle *is* offered.
- ❌ **No private data.** Emails, subscriber lists and revenue are not public and are not returned. Subscriber signals are the same rounded figures Substack shows publicly ("Thousands of subscribers", bestseller tiers).
- ❌ **No exact subscriber counts** where Substack publishes only rounded or hidden values. You get `null` or the public text, never a guess.

### Reliability notes

- Pure HTTP against Substack's public JSON endpoints, fast and cheap (the whole default demo run finishes in about 2 seconds).
- Polite pacing plus automatic retry with backoff on rate limits.
- Every cap (`maxPostsPerPublication`, `maxItemsTotal` and the rest) is honored exactly, so cost is bounded before you press Start.
- If anything fails (unknown publication, bad handle, unknown category) you get a plain-English `status` record and **no charge** for it.

### Fair use and compliance

This Actor reads the same public, unauthenticated endpoints that power Substack's own web pages, at a polite request rate, and collects only published content and public profile data. You are responsible for complying with applicable laws, Substack's terms, and content licenses for your use case. Respect authors: cite what you quote.

### FAQ

#### Can I see how many subscribers a Substack has?

You get the same public subscriber signals Substack itself shows, such as "Thousands of subscribers", bestseller tiers, follower counts and a publication's payments state. Substack does not publish exact subscriber numbers, so this Actor returns `null` or the public text rather than an invented figure.

#### Does this extract paid or paywalled post content?

No. Paywalled posts come back as metadata with `paywalled: true` and an empty body, and they are never charged at the Article body price. This Actor does not bypass paywalls; if you need paid bodies, subscribe to the publication.

#### Can I track a Substack newsletter's new posts automatically?

Yes. Schedule the Actor on Apify with `sort: new`, a `publishedAfter` date and a small `maxPostsPerPublication`, so each run only reaches for the newest posts. Because you pay per delivered record, a run that finds nothing new costs only the Actor start event.

#### How do I scrape a Substack newsletter archive?

Put the publication in `publications`, choose `sort: new` or `sort: top`, and raise `maxPostsPerPublication` to how deep you want to go. Add `includeContent` for the full article HTML, text and word count, `publishedAfter` to bound the window, and `searchInPublication` to run a server-side keyword search inside the archive.

#### Does Substack have a public API?

There is no documented, supported public API you can sign up for. This Actor reads the same public JSON endpoints that power Substack's own web pages, with no login, no cookies and no browser, which is why the default demo run finishes in about 2 seconds.

#### How do I find the top newsletters in a Substack category?

Use `leaderboardCategories`, for example `["technology"]`, and cap it with `maxPublicationsPerCategory`. Each entry is a ranked publication with its public subscriber signals, paid tier and author, which together read as a market map of that category.

#### Why does this Actor run with limited permissions?

Least privilege. The Actor only reads and writes its own storages: the run's dataset and key-value store. It needs no access to anything else on your account, and it never authenticates to Substack.

### More data tools by Automation Craft

- [Telegram Channel Scraper: Posts, Views, Dates](https://apify.com/automation_craft/telegram-channel-scraper) for public channel posts with a true date filter.
- [G2 Reviews Scraper: Ratings, Pros and Cons](https://apify.com/automation_craft/g2-reviews-scraper) for software reviews without blocked runs.
- [Meta Ad Library Scraper - All Placements, Filters](https://apify.com/automation_craft/meta-ads-library-scraper) for ads across every Meta placement.
- [Instagram Ads Library Scraper - Creatives, Video](https://apify.com/automation_craft/instagram-ads-library-scraper) for Instagram creatives and video ads.
- [Google Trends Scraper - Compare and Trending Now](https://apify.com/automation_craft/google-trends-scraper) for the search demand behind a topic.
- [LinkedIn Jobs Scraper - No Login, Real Dates](https://apify.com/automation_craft/linkedin-jobs-scraper) for hiring signals, no login required.

*Missing an angle you need? Open an issue on the Actor's Issues tab. The roadmap is complaint-driven.*

# Changelog

This Actor's version history is a separate document: https://apify.com/automation_craft/substack-scraper/changelog.md

# Actor input Schema

## `publications` (type: `array`):

Substack publications to pull posts from. Accepts any form: `astralcodexten`, `astralcodexten.substack.com`, `https://www.astralcodexten.com`, or a custom domain. A pasted post URL is routed to single-post mode automatically.

## `includeContent` (type: `boolean`):

Fetch each post's full body (HTML + plain text + word count). Paywalled posts are delivered as metadata with `paywalled: true` and are NEVER charged at the content price - this Actor does not bypass paywalls.

## `includeComments` (type: `boolean`):

Fetch the full nested comment tree for every delivered post (flattened records with parentId + depth).

## `includePublicationProfile` (type: `boolean`):

Emit one publication-profile record per publication: name, tagline, author, founded date, payments enabled, subscriber signals where public.

## `sort` (type: `string`):

Archive order: `new` (latest first) or `top` (most popular first).

## `searchInPublication` (type: `string`):

Keyword search inside each publication's archive (server-side). Note: Substack has no public global post search - this searches per publication.

## `publishedAfter` (type: `string`):

Only posts published on/after this date.

## `maxPostsPerPublication` (type: `integer`):

Cap on charged post records per publication. Honored exactly.

## `postUrls` (type: `array`):

Direct Substack post URLs (`https://…/p/slug`) to fetch individually - with content and (optionally) comments.

## `maxCommentsPerPost` (type: `integer`):

Cap on charged comment records per post.

## `authorHandles` (type: `array`):

Substack author handles - `@handle`, `handle`, or `https://substack.com/@handle`. Each returns a rich author-profile record: follower count, subscriber signals, bestseller tier, social links, primary publication.

## `includeAuthorNotes` (type: `boolean`):

Also pull each author's recent public Notes (their short-form feed posts).

## `maxNotesPerAuthor` (type: `integer`):

Cap on charged note records per author.

## `noteSearchQueries` (type: `array`):

Keyword queries against Substack Notes (the platform-wide short-form feed). Each query returns matching notes with author, engagement, and links.

## `maxNotesPerQuery` (type: `integer`):

Cap on charged note records per search query.

## `leaderboardCategories` (type: `array`):

Substack category leaderboards to rank, by slug or name: e.g. `technology`, `business`, `culture`, `finance`, `politics`, `health-politics`, `food`, `sports`, `music`, `climate`. Each returns ranked publications with subscriber signals.

## `maxPublicationsPerCategory` (type: `integer`):

Cap on charged leaderboard entries per category.

## `maxItemsTotal` (type: `integer`):

Overall cap on charged records for the run. Honored exactly.

## Actor input object example

```json
{
  "publications": [
    "astralcodexten.com"
  ],
  "includeContent": true,
  "maxPostsPerPublication": 25,
  "maxCommentsPerPost": 100,
  "maxNotesPerAuthor": 50,
  "maxNotesPerQuery": 50,
  "maxPublicationsPerCategory": 50,
  "maxItemsTotal": 500
}
```

# Actor output Schema

## `items` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "publications": [
        "astralcodexten.com"
    ],
    "includeContent": true,
    "maxPostsPerPublication": 25,
    "maxCommentsPerPost": 100,
    "maxNotesPerAuthor": 50,
    "maxNotesPerQuery": 50,
    "maxPublicationsPerCategory": 50,
    "maxItemsTotal": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation_craft/substack-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "publications": ["astralcodexten.com"],
    "includeContent": True,
    "maxPostsPerPublication": 25,
    "maxCommentsPerPost": 100,
    "maxNotesPerAuthor": 50,
    "maxNotesPerQuery": 50,
    "maxPublicationsPerCategory": 50,
    "maxItemsTotal": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("automation_craft/substack-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "publications": [
    "astralcodexten.com"
  ],
  "includeContent": true,
  "maxPostsPerPublication": 25,
  "maxCommentsPerPost": 100,
  "maxNotesPerAuthor": 50,
  "maxNotesPerQuery": 50,
  "maxPublicationsPerCategory": 50,
  "maxItemsTotal": 500
}' |
apify call automation_craft/substack-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation_craft/substack-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/DgHgpPcpUMh6qkr9G/builds/KHyk2IroXn0HE3ARv/openapi.json
