# Substack Scraper — Posts, Notes, Profiles & Leaderboards (`automation_craft/substack-scraper`) Actor

Scrape Substack: full posts with article HTML, comment threads, Notes search, author & publication profiles with subscriber signals, and category leaderboards. Honest paywall handling.

- **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
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Substack Scraper — Posts, Notes, Profiles & Leaderboards

One actor for **every public Substack surface**: 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.

### 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 & duration, paywall flag |
| **Full article content** | toggle *Include full article content* | Complete `bodyHtml` + clean `bodyText` + 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` + `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 |

Works with **custom domains** (`astralcodexten.com`, `slowboring.com`), `*.substack.com` subdomains, bare names, and full URLs — all input forms auto-normalize, and redirect/`www` variants are retried automatically instead of failing with a 404.

### 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 metadata price only.
- This Actor does **not** bypass paywalls, ever. If you need paid-post bodies, subscribe to the publication.

### 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. Export JSON, CSV, Excel, or read via API.

### Pricing — what a run actually costs

Pay per delivered record. Zero results = zero record charges, with a status record explaining why.

| Event | Price |
|---|---|
| Actor start | $0.005 |
| Post (metadata) | $0.002 |
| + Full article content (only when actually delivered) | +$0.002 |
| Comment | $0.0005 |
| Note | $0.001 |
| Author profile | $0.005 |
| Publication profile | $0.005 |
| Leaderboard entry | $0.001 |

Worked examples: 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 + their 50 recent notes = **$0.06**.

### 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, or 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/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 ~2 s).
- Polite pacing + automatic retry with backoff on rate limits.
- Every cap (`maxPostsPerPublication`, `maxItemsTotal`, …) 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 & 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.

***

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

### More data tools by Automation Craft

- [ATS Job Scraper](https://apify.com/automation_craft/ats-jobs-scraper) — Greenhouse, Lever, Ashby, Workable & SmartRecruiters in one unified schema.
- [LinkedIn Jobs Scraper](https://apify.com/automation_craft/linkedin-jobs-scraper) — LinkedIn public job search, no login.
- [G2 Reviews Scraper](https://apify.com/automation_craft/g2-reviews-scraper) — G2 reviews without DataDome headaches.

# 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/QrPns4txNy1chVige/openapi.json
