# Substack Scraper - Posts, Dates, Subtitles, Subscriber Counts (`anatoliandata/substack-scraper`) Actor

Scrape any Substack newsletter by name or URL: post title, URL, publish date, subtitle, free preview snippet, paywall flag, likes, comments, restacks, word count and the publication's public subscriber count. No login, no browser, no proxy needed.

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

## Pricing

from $1.00 / 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.

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, Dates, Subtitles, Subscriber Counts

Get the post list of any Substack newsletter as clean JSON, CSV or Excel. Give a newsletter **name**, **subdomain** or **URL**; the Actor returns one row per post with title, URL, publish date, subtitle, the free preview snippet, paywall flag, likes, comments, restacks and word count, plus the publication's public subscriber count.

- No login, no cookies, no browser, no proxy needed
- Works with custom domains (e.g. `www.lennysnewsletter.com`) and `*.substack.com`
- Filters: newest or top posts, free-only or paywalled-only, keyword, date range
- Fast: ~100 posts in about 10 seconds

### What it does not collect

Only data that Substack shows publicly on the newsletter's archive page:

- **No paywalled content.** For paid posts you get the title, subtitle, date and the public free preview only.
- **No full article text, no subscriber or email lists, no author or reader personal data.**

### Input

| Field | Description |
|---|---|
| `publications` | List of newsletters: `noahpinion`, `Lenny's Newsletter`, `https://www.lennysnewsletter.com`, `https://example.substack.com`, or any post URL. Names are matched with Substack's own search; unrelated matches are rejected. |
| `maxPostsPerPublication` | Max posts per newsletter (default 50). |
| `sort` | `new` (newest first) or `top` (most popular). |
| `audience` | `all`, `free` or `paid`. |
| `keyword` | Optional, uses the newsletter's own archive search. |
| `dateFrom`, `dateTo` | Optional date range, e.g. `2026-01-01`. |

Example:

```json
{
  "publications": ["noahpinion", "https://www.lennysnewsletter.com"],
  "maxPostsPerPublication": 50,
  "sort": "new",
  "dateFrom": "2026-01-01"
}
```

### Output

One row per post:

```json
{
  "publicationName": "The Pragmatic Engineer",
  "publicationUrl": "https://newsletter.pragmaticengineer.com",
  "subscriberCount": 1100000,
  "subscriberCountText": "Over 1,100,000 subscribers",
  "paidSubscribersText": null,
  "postId": 183694080,
  "title": "When AI writes almost all code, what happens to software engineering?",
  "subtitle": "No longer a hypothetical question, this is a mega-trend set to hit the tech industry",
  "url": "https://newsletter.pragmaticengineer.com/p/when-ai-writes-almost-all-code-what",
  "publishedAt": "2026-01-06T17:41:49.383Z",
  "type": "newsletter",
  "audience": "everyone",
  "isPaywalled": false,
  "freeSnippet": "This article was originally a paid one...",
  "wordCount": 6843,
  "reactionCount": 1076,
  "commentCount": 41,
  "restackCount": 104,
  "coverImage": "https://substack-post-media.s3.amazonaws.com/...",
  "tags": [],
  "scrapedAt": "2026-10-17T21:00:00.000Z"
}
```

Other fields: `publicationId`, `publicationSubdomain`, `publicationTagline`, `publicationLanguage`, `hasCustomDomain`, `slug`, `description`, `section`, `language`, `podcastDurationSecs`, `input`.

`subscriberCount` is the number Substack displays on the newsletter page ("Over 460,000 subscribers"). It is `null` when the publication hides it.

A run summary (posts per newsletter, skipped inputs) is saved in the key-value store as `RUN_SUMMARY`.

### Pricing

Pay per result: **$0.001 per post** (that is $1 per 1,000 posts) plus a tiny start fee. Platform usage is included. Set a maximum cost per run in the Apify console and the Actor stops exactly there.

### Use cases

- Track competitors' or partners' publishing frequency and engagement
- Build a list of newsletters in a niche with their subscriber counts for sponsorship outreach
- Monitor new posts from a set of newsletters (schedule the Actor daily with `dateFrom`)
- Research datasets of titles, subtitles and engagement over time

### Notes

- If a name matches no newsletter, the run skips it and tells you why; use the URL instead.
- Newsletters that left Substack (e.g. moved to Ghost) are skipped with a clear message.
- Questions or a missing field? Open an issue on the Actor page.

# Actor input Schema

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

Substack newsletters to scrape. Each line can be a subdomain (noahpinion), a publication name (Lenny's Newsletter), a URL (https://example.substack.com or the newsletter's own domain such as https://www.lennysnewsletter.com) or any post URL from the newsletter.

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

Stop after this many posts from each publication.

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

Newest first, or the publication's most popular posts first.

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

All posts, only free posts, or only paywalled posts (paywalled posts return public metadata and the free preview snippet only).

## `keyword` (type: `string`):

Optional. Only posts matching this word in the publication's own archive search.

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

Optional. Date like 2026-01-01.

## `dateTo` (type: `string`):

Optional. Date like 2026-12-31.

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

Optional. Not needed normally: the Actor connects directly and switches to Apify Proxy only if Substack starts rate-limiting.

## Actor input object example

```json
{
  "publications": [
    "noahpinion",
    "https://www.lennysnewsletter.com"
  ],
  "maxPostsPerPublication": 50,
  "sort": "new",
  "audience": "all"
}
```

# Actor output Schema

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

No description

## `summary` (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": [
        "noahpinion",
        "https://www.lennysnewsletter.com"
    ]
};

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

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

```

## MCP server setup

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