# Substack Scraper: Newsletters, Posts, Full Text, Comments (`zhtech/substack-scraper`) Actor

Scrape Substack newsletters and posts from public JSON endpoints: author, public subscriber count, prices, social links, contact email, post likes, comments and full text of free posts. Find newsletters by keyword or category. No login. Paywalled text never returned.

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

## Pricing

from $0.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: Newsletters, Posts, Full Text, Comments

Scrape any Substack newsletter without logging in. Get the **newsletter profile** (author, description, public
subscriber count, paid subscriber range, prices, social links, public contact email), its **posts** (title,
subtitle, date, URL, likes, comments, restacks, paywall flag) with the **full text of every free post**, and
optionally the **public comments**. Find new newsletters by **keyword** or by **category leaderboard**.

Works with `name.substack.com` addresses and custom domains (like `www.lennysnewsletter.com`), author handles
(`@handle`) and single post links. Data comes from the same public JSON that Substack's own website loads, so
results are fast and clean. Paywalled posts return metadata only: their text is never fetched into the output.

### What you get

- **Newsletter profiles**: name, URL, custom domain, tagline, about text, language, author name, handle, bio,
  photo and follower count, contributors, public subscriber count (as a number and as Substack's wording), paid
  subscriber range ("Thousands of paid subscribers"), bestseller tier, monthly, yearly and founding member price,
  podcast, sections, launch date, social links (X, YouTube, LinkedIn, Instagram, TikTok, website...), and the
  contact email when the newsletter shows one publicly.
- **Posts**: title, subtitle, URL, publish and update date, type (newsletter, podcast, thread), audience, paywall
  flag, likes, reaction breakdown, comment count, restacks, word count, authors, tags, section, cover image,
  podcast length, and for free posts the preview and the **full article as clean plain text** (HTML optional).
- **Comments** (optional): text, author, handle, likes, reply count, depth and parent comment, and whether the
  commenter is the post author.
- **Discovery** (optional): newsletters matching a keyword, or the "Top in Technology / Finance / ..." category
  leaderboards (overall or paid), each with its rank. Optionally scrape the posts of every newsletter found.

### Use cases

- **Sponsorship and partnership prospecting**: list newsletters in a niche with subscriber counts, prices, social
  links and public contact emails.
- **Competitor and market research**: track what top newsletters publish, how often, and which posts get the most
  likes, comments and restacks.
- **AI, RAG and text analysis**: the full text of free posts as clean plain text, ready for embeddings,
  summaries or topic models.
- **Media monitoring**: watch a list of newsletters daily with "Posted after: 1 day".
- **Audience research**: read public comment threads on free posts.

### How to use

1. Add one or more newsletters to **Newsletters** (a URL, a subdomain like `platformer`, a custom domain, or an
   author handle like `@noahpinion`). Or add **Post URLs**, **keywords** or **categories**.
2. Set **Posts per newsletter** (0 = the whole archive) and any filters.
3. Click **Start**. Download the results as JSON, CSV, Excel or HTML, or read them with the API.

The dataset has ready made views: **Newsletters**, **Posts**, **Comments** and **Inputs without results**.

### Input example

```json
{
  "newsletters": ["https://garymarcus.substack.com", "https://www.lennysnewsletter.com", "@noahpinion"],
  "maxPostsPerNewsletter": 25,
  "postedAfter": "90 days",
  "includeFullText": true,
  "includeComments": true,
  "maxCommentsPerPost": 20
}
```

Find newsletters about a topic and in a category leaderboard:

```json
{
  "searchQueries": ["climate tech"],
  "categories": ["technology", "finance"],
  "categoryRanking": "paid",
  "maxNewslettersPerSearch": 50,
  "scrapePostsOfDiscovered": false
}
```

#### Main input fields

| Field | What it does |
|---|---|
| `newsletters` | Newsletter URLs, subdomains, custom domains or `@handles`. Profile row plus posts. |
| `postUrls` | Single post links (`/p/slug`, `open.substack.com/pub/...`, `substack.com/@handle/p-123`). |
| `searchQueries` | Find newsletters by keyword. |
| `categories` | Category leaderboards by slug or name (technology, business, finance, culture, ...). |
| `categoryRanking` | `all` (top overall) or `paid` (bestseller leaderboard). |
| `maxNewslettersPerSearch` | Newsletters per keyword and per category (default 20). |
| `scrapePostsOfDiscovered` | Also scrape posts of newsletters found by keyword or category. |
| `maxPostsPerNewsletter` | Posts per newsletter after filters (default 10, 0 = all). |
| `postSort` | `new` (newest first) or `top` (most popular first). |
| `postSearch` | Only posts matching a keyword (the newsletter's own archive search). |
| `postType` | `all`, `newsletter`, `podcast` or `thread`. |
| `audience` | `all`, `free` (only free posts) or `paid` (only paywalled posts, metadata). |
| `postedAfter`, `postedBefore` | Dates (`2026-01-31`) or relative periods (`30 days`, `6 months`). |
| `minLikes` | Skip posts with fewer likes. |
| `includeFullText` | Full plain text of free posts (default on). |
| `includeHtml` | Also the original HTML of free posts (default off). |
| `includeComments`, `maxCommentsPerPost`, `commentSort` | Public comments on free posts. |
| `includeNewsletterProfile` | The newsletter profile row for inputs in Newsletters (default on). |
| `includeAuthorProfile` | Author social links, bio and follower count (default on). |
| `maxItems` | Stop after this many rows in total (0 = no limit). |
| `proxyConfiguration` | Optional. Not needed for normal runs. |

### Output example

Newsletter row (shortened):

```json
{
  "type": "newsletter",
  "newsletterId": 888615,
  "name": "Marcus on AI",
  "url": "https://garymarcus.substack.com",
  "authorName": "Gary Marcus",
  "authorHandle": "garymarcus",
  "authorProfileUrl": "https://substack.com/@garymarcus",
  "authorFollowerCount": 158135,
  "subscriberCount": 125000,
  "subscriberCountText": "Over 125,000 subscribers",
  "subscriberRange": "Hundreds of thousands of subscribers",
  "paidSubscriberRange": "Thousands of paid subscribers",
  "bestsellerTier": 1000,
  "paymentsEnabled": true,
  "priceMonthly": 8.0,
  "priceYearly": 80.0,
  "priceFounding": 150.0,
  "currency": "USD",
  "socialLinks": [{ "platform": "twitter", "url": "https://x.com/GaryMarcus", "owner": "author" }],
  "contactEmail": null,
  "aiCrawlersBlocked": false,
  "firstPostDate": "2022-05-14T17:02:35.848Z",
  "source": "newsletter",
  "scrapedAt": "2026-11-18T04:38:51.177Z"
}
```

Free post row (text shortened):

```json
{
  "type": "post",
  "postId": 225343416,
  "title": "Wake up! America's infrastructure is melting. And AI appears to be partly responsible.",
  "subtitle": "Hundreds of companies have been hit.",
  "url": "https://garymarcus.substack.com/p/wake-up-americas-infrastructure-is",
  "publishedAt": "2026-11-17T14:21:39.954Z",
  "postType": "newsletter",
  "audience": "everyone",
  "isPaywalled": false,
  "likes": 357,
  "commentCount": 137,
  "restacks": 70,
  "wordCount": 533,
  "authorName": "Gary Marcus",
  "bodyText": "Last week I got stuck in Newark for almost 48 hours ...",
  "textStatus": "FULL_TEXT",
  "newsletterName": "Marcus on AI"
}
```

Paywalled post row: same fields, with `"isPaywalled": true`, `"textStatus": "PAYWALLED"` and no `previewText`,
`bodyText` or `bodyHtml`.

Comment row:

```json
{
  "type": "comment",
  "commentId": 123919381,
  "postId": 165417845,
  "postTitle": "A knockout blow for LLMs?",
  "parentCommentId": 123768367,
  "depth": 1,
  "authorName": "Dakara",
  "authorHandle": "dakara",
  "isPostAuthor": false,
  "text": "Yes, they are incredible pretenders of capability. ...",
  "likes": 32,
  "replyCount": 4,
  "publishedAt": "2025-06-08T14:55:54.625Z"
}
```

Inputs that return nothing get one free explanation row (`"type": "error"`) with an `errorCode` such as
`NEWSLETTER_NOT_FOUND`, `NOT_SUBSTACK`, `POST_NOT_FOUND`, `INVALID_INPUT`, `INVALID_CATEGORY`, `NO_RESULTS`,
`RATE_LIMITED` or `BLOCKED`. A run summary is saved in the key-value store as `RUN_SUMMARY`.

### Pricing

Pay per event, so you only pay for rows you receive:

- a small fee when the run starts (`actor-start`),
- one event per **newsletter** profile row (`newsletter`),
- one event per **post** row (`post`), the same price with or without full text,
- one event per **comment** row (`comment`), only when comments are turned on.

Explanation rows for inputs without results are never charged. Posts removed by your filters are never charged.
The run stops by itself when it reaches the maximum cost per run you set in Apify. See the Pricing tab for the
current prices.

### FAQ

**Do I need a Substack account?** No. The Actor never logs in and uses no cookies.

**Can it get the text of paid posts?** No, by design. Paywalled and subscriber only posts come back with their
public metadata (title, subtitle, date, likes, comment count, word count) and `isPaywalled: true`. Their text and
preview are never returned, even when Substack sends a preview.

**How accurate is the subscriber count?** It is exactly what Substack shows publicly on the newsletter, for example
"Over 125,000 subscribers", which becomes `125000` in `subscriberCount` (a lower bound). Many newsletters hide the
count; then it is `null`. Paid subscriber numbers are never public, only the bestseller range, which is in
`paidSubscriberRange`. Counts are read from each newsletter's own page, so authors with several newsletters get the
right count for each one.

**Where do contact emails come from?** Only from what the newsletter shows publicly: its support email, or an
address the author wrote in the about text, tagline or bio. No guessing and no email finding.

**How many posts can I get?** The whole archive: set Posts per newsletter to 0. Large archives take longer
because Substack limits request speed.

**How fast is it?** The default input (one newsletter, 10 posts with full text) finishes in about 5 seconds. About
150 posts with full text take about 20 seconds. Discovery is slower (about one newsletter every 3 seconds when
author profiles are on), because substack.com itself is strictly rate limited.

**Does it work with custom domains?** Yes, for any newsletter hosted on Substack.

**What about Substack Notes?** Not included yet.

### Limitations

- Only public data. No paid content, no subscriber lists, no private emails.
- Substack limits request rates per IP. The Actor waits and retries automatically; very large runs take time.
- Keyword search: Substack's newsletter search sometimes returns nothing to automated tools. The Actor then uses
  Substack's public post and notes search to find matching newsletters, which can rank results differently from
  the website.
- Newsletters found by keyword or category do not include `aboutText` unless "Also scrape posts of found
  newsletters" is on.
- Comments are read for free posts only.
- Substack can change its public endpoints at any time. The Actor is monitored daily and fixed quickly.

### API and integrations

Run it from your code with the Apify API or client libraries and get the dataset as JSON, CSV or Excel:

```bash
curl -X POST "https://api.apify.com/v2/acts/zhtech~substack-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"newsletters": ["https://garymarcus.substack.com"], "maxPostsPerNewsletter": 10}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("zhtech/substack-scraper").call(run_input={
    "categories": ["technology"], "categoryRanking": "paid", "maxNewslettersPerSearch": 25,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["type"], item.get("name") or item.get("title"))
```

Works with Make, Zapier, n8n, Google Sheets and webhooks through Apify integrations.

**LLM and MCP use**: the Actor is available to AI agents through the Apify MCP server
(`https://mcp.apify.com`), so assistants like Claude or ChatGPT can call it as a tool, for example "find the top
paid finance newsletters on Substack and their prices" or "get the last 20 free posts of this newsletter as text".
The plain text `bodyText` field is made for AI pipelines.

### Responsible use

The Actor reads only what any logged out visitor can see and follows Substack's robots.txt. Commenter names and
author details are personal data in some jurisdictions; use them in line with GDPR, CCPA and anti spam laws, and
respect authors who turn on Substack's "block AI training" setting (shown in `aiCrawlersBlocked`).

Made by ZH Tech. Questions or ideas: open an issue on the Issues tab.

# Actor input Schema

## `newsletters` (type: `array`):

Newsletter URLs (https://name.substack.com or a custom domain like https://www.lennysnewsletter.com), bare subdomains (name), or author profiles (@handle, https://substack.com/@handle). Each one returns a newsletter profile row (author, description, public subscriber count, prices, social links, public contact email) and its latest posts.

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

Links to single posts, like https://name.substack.com/p/post-slug, https://open.substack.com/pub/name/p/post-slug or https://substack.com/@handle/p-123456. Free posts come with full text; paywalled posts with metadata only.

## `searchQueries` (type: `array`):

Uses Substack's public newsletter search. Returns newsletter profile rows in search order (rank). Turn on "Also scrape posts of found newsletters" to get their posts too.

## `categories` (type: `array`):

Substack category leaderboards (the "Top in ..." lists). Use the category slug or name, for example technology, business, finance, culture, us-politics, world-politics, food, sports, health, science, history, crypto, education, music, art, fiction, literature, design, climate, parenting, philosophy, travel, faith, humor, comics, fashion, news, international, film-and-tv, games, home-garden, beauty, photography. Subcategory names work too.

## `categoryRanking` (type: `string`):

Which leaderboard to read for each category.

## `maxNewslettersPerSearch` (type: `integer`):

Maximum newsletters returned for each keyword and each category.

## `scrapePostsOfDiscovered` (type: `boolean`):

For newsletters found by keyword or category, also return their posts (using the post settings below). Off: only the newsletter profile rows.

## `includePosts` (type: `boolean`):

Turn off to get only newsletter profile rows.

## `maxPostsPerNewsletter` (type: `integer`):

Maximum posts per newsletter after filters. 0 = the whole archive.

## `postSort` (type: `string`):

Same as the Latest and Top tabs of the newsletter archive.

## `postSearch` (type: `string`):

Optional keyword. Uses the newsletter's own archive search.

## `postType` (type: `string`):

Keep only this kind of post.

## `audience` (type: `string`):

Filter by paywall status.

## `postedAfter` (type: `string`):

A date (2026-01-31) or a relative period (30 days, 6 months, 1 year). With "Newest first" the scan stops at the first older post, so this is fast.

## `postedBefore` (type: `string`):

A date (2026-01-31) or a relative period (30 days).

## `minLikes` (type: `integer`):

Skip posts with fewer likes (hearts).

## `includeFullText` (type: `boolean`):

Adds bodyText (clean plain text, ready for AI) to every free post. Costs one extra request per free post. Never applies to paywalled posts.

## `includeHtml` (type: `boolean`):

Adds bodyHtml (the original article HTML) to free posts. Makes the dataset much larger.

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

Adds one row per public comment (with replies, depth and parent) for free posts. Charged per comment.

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

Maximum comments per post, replies included. 0 = all.

## `commentSort` (type: `string`):

Order in which comments are read (and cut off by Comments per post).

## `includeNewsletterProfile` (type: `boolean`):

One row per newsletter in Newsletters with author, description, about text, public subscriber count, paid subscriber range, prices, social links and public contact email. Rows found by keyword or category are always returned.

## `includeAuthorProfile` (type: `boolean`):

Reads the author's public Substack profile for social links (X, YouTube, LinkedIn, website...), bio and follower count. One extra request per newsletter.

## `maxItems` (type: `integer`):

Stop after this many result rows (newsletters, posts and comments together). 0 = no limit. The run also stops when your maximum cost per run is reached.

## `includeErrorItems` (type: `boolean`):

Add a free (never charged) row for each input that returned nothing, explaining why (not found, not a Substack site, no matches, blocked).

## `maxConcurrency` (type: `integer`):

How many inputs to process at the same time. Requests are rate limited either way.

## `maxRequestsPerSecond` (type: `integer`):

Polite request rate across all inputs. Substack rate limits fast clients, so the Actor also slows down by itself (and waits) whenever Substack asks it to.

## `proxyConfiguration` (type: `object`):

Usually not needed: the data comes from Substack's public JSON endpoints. Turn on Apify Proxy (datacenter first) only if runs report RATE_LIMITED or BLOCKED. A blocked request switches to a new proxy session automatically.

## Actor input object example

```json
{
  "newsletters": [
    "https://garymarcus.substack.com",
    "https://www.lennysnewsletter.com",
    "platformer",
    "@noahpinion"
  ],
  "postUrls": [
    "https://garymarcus.substack.com/p/a-knockout-blow-for-llms"
  ],
  "searchQueries": [
    "climate tech",
    "personal finance"
  ],
  "categories": [
    "technology",
    "finance"
  ],
  "categoryRanking": "all",
  "maxNewslettersPerSearch": 20,
  "scrapePostsOfDiscovered": false,
  "includePosts": true,
  "maxPostsPerNewsletter": 10,
  "postSort": "new",
  "postSearch": "AI",
  "postType": "all",
  "audience": "all",
  "postedAfter": "90 days",
  "postedBefore": "2026-06-30",
  "minLikes": 0,
  "includeFullText": true,
  "includeHtml": false,
  "includeComments": false,
  "maxCommentsPerPost": 50,
  "commentSort": "best_first",
  "includeNewsletterProfile": true,
  "includeAuthorProfile": true,
  "maxItems": 0,
  "includeErrorItems": true,
  "maxConcurrency": 3,
  "maxRequestsPerSecond": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `newsletters` (type: `string`):

No description

## `posts` (type: `string`):

No description

## `comments` (type: `string`):

No description

## `runSummary` (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 = {
    "newsletters": [
        "https://garymarcus.substack.com"
    ],
    "maxPostsPerNewsletter": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhtech/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 = {
    "newsletters": ["https://garymarcus.substack.com"],
    "maxPostsPerNewsletter": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("zhtech/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 '{
  "newsletters": [
    "https://garymarcus.substack.com"
  ],
  "maxPostsPerNewsletter": 10
}' |
apify call zhtech/substack-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zhtech/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/DvaftNNaochoSt77F/builds/tljXIIvtsft1uUzys/openapi.json
