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

The Substack Scraper exports public posts and publication profiles from any Substack newsletter, including custom domains and hidden sections: titles, dates, free/paid status, authors, reactions, subscriber counts, paid plans and optional free-post text. Ideal for creator research and monitoring.

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

## Pricing

from $1.50 / 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 — Publication Discovery & Public Archives

Collect public posts and publication profiles from any Substack newsletter, including those on custom domains like `www.lennysnewsletter.com`. Search Substack for newsletters on a topic, then export their recent posts. You can also get one profile row per publication, with its subscriber count, paid plans, sections and recent activity.

### ✨ Features

- 📚 **Section-aware archives**: many publications keep posts in sections that their main archive never lists. The scraper reads every section, including ones hidden from the navigation, and merges them into one newest-first list. On Lenny's Newsletter, 20 of the 25 newest posts only appear in sections.
- 🔍 **Publication discovery**: search Substack by keyword, such as `technology` or `climate`. Each publication that matches appears only once and lists every query that found it.
- 🏷️ **Publication profiles**: name, author, language, custom domain and the public subscriber count as Substack shows it ("Over 1,200,000 subscribers"). Profiles also include monthly, yearly and founding-member plans, sections, first post date, and how many recent posts are free or paid.
- 📰 **Post metadata**: title, subtitle, URL, date, free or paid audience, type (newsletter, podcast, thread), section, authors, tags, word count, reactions, comments, restacks and the public preview.
- 📝 **Full text of free posts** (optional): plain text and HTML for posts anyone can read. Paid posts are never unlocked; they keep the public preview only.
- 📅 **Date filter**: return only posts published after a given date.
- 🌐 **Custom domains and aliases**: `name.substack.com`, a custom domain and a post link all resolve to the same publication.

### 🛠️ How It Works

1. **Add publications or search terms**: paste newsletter addresses (`name.substack.com`, a custom domain or any post link), or type keywords into **Search publications**.
2. **Choose what to collect**: **Posts** returns one row per post; **Publication profiles** returns one row per newsletter.
3. **Set limits**: **Maximum results** caps the whole run, and **Maximum posts per publication** takes the newest N posts from each newsletter.
4. **Run the scraper**: results appear in the dataset. The `SUMMARY` record in the key-value store shows which sections were read for each publication and why each one stopped (limit, date or end of archive).

### 💰 Pricing

Pay only for results:

| Event | Price |
| --- | --- |
| Post | $0.0015 per post ($1.50 per 1,000) |
| Free post full text | +$0.001 per free post delivered with its full text (only when enabled) |
| Publication profile | $0.003 per publication |
| Run start | $0.00005 per run |

The default input (2 publications, 50 posts) costs about $0.08.

### 📊 Sample Output Data

Posts:

```json
[
    {
        "postId": 215710129,
        "title": "How Warp ships 2,000 PRs a month with AI factories | Zach Lloyd (CEO, Warp)",
        "url": "https://www.lennysnewsletter.com/p/how-warp-ships-2000-prs-a-month-with",
        "postDate": "2026-09-21T12:04:11.791Z",
        "audience": "everyone",
        "isFree": true,
        "type": "podcast",
        "section": "How I AI",
        "foundIn": "how-i-ai",
        "authors": ["Claire Vo"],
        "tags": [],
        "wordCount": 454,
        "reactionCount": 3,
        "commentCount": 0,
        "restackCount": 0,
        "podcastDurationSeconds": 2811,
        "publicationId": 10845,
        "publicationName": "Lenny's Newsletter",
        "publicationUrl": "https://www.lennysnewsletter.com",
        "contentStatus": "not_requested"
    },
    {
        "postId": 161510512,
        "title": "Co-Existence and the End of Co-Intelligence",
        "subtitle": "Also: how pitch a book to an AI!",
        "url": "https://www.oneusefulthing.org/p/co-existence-and-the-end-of-co-intelligence",
        "postDate": "2026-06-04T21:13:42.065Z",
        "audience": "everyone",
        "isFree": true,
        "type": "newsletter",
        "section": null,
        "foundIn": "archive",
        "authors": ["Ethan Mollick"],
        "wordCount": 1450,
        "reactionCount": 967,
        "commentCount": 125,
        "restackCount": 81,
        "previewText": "It has been two years since Co-Intelligence, my book about AI, was published…",
        "publicationId": 1180644,
        "publicationName": "One Useful Thing",
        "contentStatus": "not_requested"
    }
]
```

Publication profile:

```json
{
    "publicationId": 10845,
    "name": "Lenny's Newsletter",
    "url": "https://www.lennysnewsletter.com",
    "substackUrl": "https://lenny.substack.com",
    "customDomain": "www.lennysnewsletter.com",
    "language": "en",
    "authorName": "Lenny Rachitsky",
    "subscriberCountDisplay": "Over 1,200,000 subscribers",
    "subscriberCountLowerBound": 1200000,
    "paidPlans": [
        { "interval": "month", "price": 20, "currency": "USD", "isFoundingMember": false },
        { "interval": "year", "price": 200, "currency": "USD", "isFoundingMember": false },
        { "interval": "year", "price": 400, "currency": "USD", "isFoundingMember": true }
    ],
    "hasPodcast": true,
    "firstPostDate": "2019-06-14T15:00:48.833Z",
    "sections": [
        { "name": "How I AI", "slug": "how-i-ai", "hiddenFromNavigation": false },
        { "name": "Podcast summaries", "slug": "podcast-summaries", "hiddenFromNavigation": true }
    ],
    "latestPostDate": "2026-09-22T12:45:14.998Z",
    "recentPostsSampled": 23,
    "recentFreePosts": 5,
    "recentPaidPosts": 18,
    "matchedQueries": [],
    "inputUrls": ["https://lenny.substack.com"]
}
```

### ❓ Good to Know

- Subscriber counts are Substack's rounded public figures, so `subscriberCountLowerBound` is a floor, not an exact audience. When a publication hides its count, the value is `null`, not zero.
- `recentFreePosts` and `recentPaidPosts` describe the latest page of the main archive, not the whole history.
- Some podcast episodes appear only in a publication's podcast feed and may be missing from its archives.
- Only public data is collected: no logins, no paid content, and no subscriber or commenter lists.

Start exploring Substack publications with the **Substack Scraper** today! 🚀

# Actor input Schema

## `publicationUrls` (type: `array`):

Newsletter addresses: name.substack.com or a custom domain such as www.lennysnewsletter.com. Post links work too.

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

Keywords to find publications on Substack, e.g. "technology" or "climate". This searches publications, not the text of posts.

## `mode` (type: `string`):

Posts: one row per post from each publication's archive. Publications: one profile row per publication with subscriber count, paid plans, sections and recent activity.

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

Maximum number of rows (posts or publications) across the whole run.

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

Newest posts returned from each publication (posts mode).

## `maxPublicationsPerQuery` (type: `integer`):

How many publications to take from each search query.

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

Only return posts published on or after this date (posts mode).

## `includeSections` (type: `boolean`):

Also read every section of the publication, including sections hidden from its navigation. The main archive alone can miss many posts.

## `includeFreeContent` (type: `boolean`):

Add the full text and HTML of posts that are free to read. Paid posts are never unlocked; they keep the public preview only. Charged per post with content.

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

Proxy servers used to load pages.

## Actor input object example

```json
{
  "publicationUrls": [
    "https://www.lennysnewsletter.com",
    "https://www.oneusefulthing.org"
  ],
  "mode": "posts",
  "maxItems": 50,
  "maxPostsPerPublication": 25,
  "maxPublicationsPerQuery": 10,
  "includeSections": true,
  "includeFreeContent": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (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 = {
    "publicationUrls": [
        "https://www.lennysnewsletter.com",
        "https://www.oneusefulthing.org"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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