# Substack Scraper (`tplugge/substack-scraper`) Actor

Scrape any Substack newsletter: posts with full text, reactions, comments, tags and authors, plus publication stats like subscriber counts. Search Substack by keyword. Fast, no login, no browser.

- **URL**: https://apify.com/tplugge/substack-scraper.md
- **Developed by:** [Timon](https://apify.com/tplugge) (community)
- **Categories:** Social media, News, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 result scrapeds

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?

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

Scrape any Substack newsletter: every post with title, date, authors, tags, likes, comments and
restacks, the full text ready for AI and RAG, all comments and replies, and the newsletter itself
with author and subscriber count. Find newsletters by keyword with the built-in Substack search.

The scraper reads Substack's public JSON API with plain HTTP requests through Apify Proxy. No
login, no browser. A newsletter with 100 posts takes a few seconds.

### What you can use it for

- **Content and trend research:** pull the archive of the newsletters in your niche and see which
  topics get the most likes, comments and restacks.
- **AI and RAG:** feed clean post text into your vector database, chatbot or summarizer.
- **Sponsor and partner research:** find newsletters by keyword and compare subscriber counts.
- **Audience research:** read what readers actually say in the comments.
- **Monitoring:** schedule a daily run with `dateFrom` and get only the new posts.

### Input

| Field | Description | Default |
|---|---|---|
| `startUrls` | Newsletters or posts, one per line: `https://name.substack.com`, a custom domain, just `name`, or a post URL `.../p/slug` | |
| `searchQueries` | Keywords to find newsletters on Substack | |
| `maxPublicationsPerSearch` | Newsletters taken from each search | 10 |
| `maxPostsPerPublication` | Newest posts first, `0` reads the whole archive | 20 |
| `dateFrom` | Only posts published on or after this date, `YYYY-MM-DD` | |
| `onlyFree` | Skip paid posts | false |
| `includeContent` | Add `bodyText` and `bodyHtml` | false |
| `includeComments` | Add comments and replies as rows | false |
| `maxCommentsPerPost` | Comments per post, `0` means no limit | 100 |
| `includePublicationInfo` | One row per newsletter with subscriber count | true |

At least one start URL or search query is required.

```json
{
    "startUrls": ["https://www.lennysnewsletter.com", "astralcodexten"],
    "searchQueries": ["climate"],
    "maxPostsPerPublication": 50,
    "dateFrom": "2026-01-01",
    "includeContent": true,
    "includeComments": true
}
```

### Output

Every row has a `type`: `post`, `comment` or `publication`. The dataset has a view for each.

A post:

```json
{
    "type": "post",
    "postId": 208730073,
    "title": "Announcing Lenny’s Jobs: The best place in the world to find, vet, and land your dream job",
    "subtitle": "Where product managers, engineers, designers, and growth/marketing professionals discover high-quality open roles at tech companies",
    "url": "https://www.lennysnewsletter.com/p/announcing-lennys-jobs-the-best-place",
    "postDate": "2026-08-18T15:40:06.921Z",
    "postType": "newsletter",
    "audience": "everyone",
    "isPaywalled": false,
    "wordCount": 933,
    "reactionCount": 378,
    "commentCount": 18,
    "restackCount": 9,
    "authors": ["Lenny Rachitsky"],
    "authorHandles": ["lenny"],
    "tags": ["Career"],
    "section": null,
    "coverImage": "https://substackcdn.com/image/fetch/...png",
    "podcastUrl": null,
    "language": "en",
    "publicationId": 10845,
    "publicationName": "Lenny's Newsletter",
    "publicationUrl": "https://www.lennysnewsletter.com",
    "bodyText": "Each week, I share deeply researched product, growth, and career advice...",
    "bodyHtml": "<p>...</p>",
    "isFullText": true
}
```

A comment:

```json
{
    "type": "comment",
    "commentId": 319080271,
    "parentCommentId": 317678273,
    "postId": 208730073,
    "postUrl": "https://www.lennysnewsletter.com/p/announcing-lennys-jobs-the-best-place",
    "postTitle": "Announcing Lenny’s Jobs: ...",
    "authorName": "Lenny Rachitsky",
    "authorHandle": "lenny",
    "date": "2026-08-20T21:05:49.819Z",
    "body": "Will think about this...",
    "reactionCount": 1,
    "replyCount": 0,
    "publicationName": "Lenny's Newsletter"
}
```

A newsletter:

```json
{
    "type": "publication",
    "publicationId": 10845,
    "publicationName": "Lenny's Newsletter",
    "publicationUrl": "https://www.lennysnewsletter.com",
    "subdomain": "lenny",
    "customDomain": "www.lennysnewsletter.com",
    "description": "Deeply researched product, growth, and career advice for product leaders, founders, and ambitious builders.",
    "language": "en",
    "authorName": "Lenny Rachitsky",
    "authorHandle": "lenny",
    "authorBio": "Writing • Angel investing • Advising",
    "freeSubscriberCount": 1200000,
    "subscriberRanking": "Millions of subscribers",
    "paidSubscriberRanking": "Tens of thousands of paid subscribers",
    "paidSubscriptionsEnabled": true,
    "createdAt": "2019-06-01T15:35:37.885Z"
}
```

Export the results as JSON, CSV, Excel or HTML, or pull them through the Apify API, n8n, Make
or Zapier.

### Pricing

You pay per row in the dataset (post, comment or newsletter), see the pricing tab. Full text costs
nothing extra. Newsletters that return no posts cost only their newsletter row, which you can
switch off.

### Limits

- Paid posts contain only the public preview that Substack shows to non-subscribers.
  `isFullText` tells you which rows are complete. Some paid posts have no preview at all, then
  `bodyText` is `null`.
- `freeSubscriberCount` is the number Substack displays publicly. Not every newsletter shows one.
- Profile pages (`substack.com/@name`) and Notes are not supported. Use the newsletter address.

### FAQ

**Do I need a Substack account?** No. Only public data is read.

**Can I scrape a whole archive?** Yes, set `maxPostsPerPublication` to `0`.

**How do I get only new posts every day?** Schedule the Actor and set `dateFrom`, or keep
`maxPostsPerPublication` small, since the newest posts come first.

# Actor input Schema

## `startUrls` (type: `array`):

One per line. A newsletter address (https://name.substack.com or its own domain like https://www.lennysnewsletter.com), just the subdomain ("lenny"), or a single post URL (.../p/post-slug).

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

Keywords to find newsletters, e.g. "climate" or "product management". Every newsletter found is scraped like a start URL.

## `maxPublicationsPerSearch` (type: `integer`):

How many newsletters to take from each search.

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

Newest posts first. 0 reads the whole archive.

## `dateFrom` (type: `string`):

Skip older posts. Leave empty for no date limit.

## `onlyFree` (type: `boolean`):

Skip posts behind the paywall.

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

Adds the post text (bodyText, ready for AI and RAG) and the original HTML. Paid posts contain the public preview only. One extra request per post.

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

Adds every comment and reply as its own row with author, date, reactions and parent comment.

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

Replies count as comments. 0 means no limit.

## `includePublicationInfo` (type: `boolean`):

Adds one row per newsletter: name, author, description, free subscriber count and subscriber ranking.

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

Apify datacenter proxy is on by default. Without a proxy Substack starts blocking after a few dozen requests.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.lennysnewsletter.com"
  ],
  "maxPublicationsPerSearch": 10,
  "maxPostsPerPublication": 20,
  "onlyFree": false,
  "includeContent": false,
  "includeComments": false,
  "maxCommentsPerPost": 100,
  "includePublicationInfo": true,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All rows, posts view.

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

Comment rows.

## `publications` (type: `string`):

Newsletter rows.

# 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 = {
    "startUrls": [
        "https://www.lennysnewsletter.com"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tplugge/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 = {
    "startUrls": ["https://www.lennysnewsletter.com"],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("tplugge/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 '{
  "startUrls": [
    "https://www.lennysnewsletter.com"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call tplugge/substack-scraper --silent --output-dataset

```

## MCP server setup

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