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

Scrape every post from any Substack newsletter, including custom domains: title, date, authors, tags, likes, comments, restacks, paid/free status and optional full text. No login, no browser.

- **URL**: https://apify.com/tidyrow/substack-scraper.md
- **Developed by:** [Tidyrow Data](https://apify.com/tidyrow) (community)
- **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

Returns every post from any Substack newsletter as a table you can export to CSV, Excel or JSON or read through the API.

Give it a newsletter name, a `substack.com` address, a custom domain or any post link. It reads the publication's public archive, newest posts first, and can also pull the full text of each post.

### How it behaves

It uses Substack's public JSON endpoints with plain HTTP requests. There's no browser, no login and no proxy, so runs are fast and cheap, and the default memory is 256 MB.

Custom domains work the same as `*.substack.com` addresses. A post link is turned into its publication, so you can paste whatever URL you have.

Posts that show up twice in the archive (pinned posts, for example) are saved once.

Paid posts are listed with all their metadata. Their text is only the free preview a logged-out reader sees, and those rows have `contentIsPreview: true`.

If one publication fails (a typo, or a site that isn't on Substack), the error goes to the log and the Actor moves on to the next one.

### What people use it for

- Newsletter research: what a writer publishes, how often, and which posts get the most likes, comments and restacks
- Competitor and market tracking: schedule it with "Posted since" to get only new posts
- Sponsorship and outreach: sizing up newsletters before pitching them
- Content analysis and AI datasets: the full text of free posts as HTML and plain text
- Archiving a newsletter you write or subscribe to

### Input

| Field | What it does |
|---|---|
| Substack publications | Names (`lenny`), handles (`@lenny`), subdomains (`lenny.substack.com`), custom domains (`www.lennysnewsletter.com`) or any post URL. |
| Max posts per publication | Newest posts first. `0` means the whole archive. |
| Posted since | Keeps only posts published on or after this date, for example `2026-01-31`. |
| Include full post text | Adds `contentHtml` and `contentText`. This makes one extra request per post. |

Example input:

```json
{
    "publications": ["www.lennysnewsletter.com", "astralcodexten"],
    "maxPostsPerPublication": 50,
    "postedSince": "2026-01-01",
    "includeContent": false
}
```

### Output

One row per post:

```json
{
    "id": 219482066,
    "publication": "https://www.lennysnewsletter.com",
    "url": "https://www.lennysnewsletter.com/p/how-to-tell-if-a-startup-has-a-moat",
    "title": "How to tell if a startup has a moat",
    "subtitle": "A framework for assessing whether the company you're considering joining is built to last",
    "slug": "how-to-tell-if-a-startup-has-a-moat",
    "postDate": "2026-10-13T12:45:41.160Z",
    "type": "newsletter",
    "audience": "only_paid",
    "isPaid": true,
    "authors": ["Dan Hockenmaier"],
    "tags": ["Career"],
    "section": null,
    "wordcount": 4153,
    "reactionCount": 350,
    "commentCount": 2,
    "restacks": 18,
    "coverImage": "https://substackcdn.com/image/fetch/...",
    "description": "A framework for assessing whether the company you're considering joining is built to last"
}
```

With "Include full post text" on, each row also has `contentHtml`, `contentText` and `contentIsPreview`.

`type` is `newsletter`, `podcast` or `thread`. `audience` is `everyone` for free posts, and `only_paid` or `founding` for paid ones.

### Pricing

You pay per post saved. Posts with full text cost more because each one needs an extra request. See the pricing tab for current prices. If you set a spending limit on the run, the Actor stops before going over it.

### Limits

- Only public data. It can't read paid content, subscriber lists or private posts.
- Substack doesn't publish this API, so it may change. If a run breaks, report it in the Issues tab.
- Comments and Substack Notes aren't included.

# Actor input Schema

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

Substack names (lenny), handles (@lenny), subdomains (lenny.substack.com), custom domains (www.lennysnewsletter.com) or any post URL.

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

Newest posts first. 0 means the whole archive.

## `postedSince` (type: `string`):

Only posts published on or after this date, e.g. 2026-01-31.

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

Adds contentHtml and contentText. One extra request per post. Paid posts return only the free preview.

## Actor input object example

```json
{
  "publications": [
    "www.lennysnewsletter.com"
  ],
  "maxPostsPerPublication": 50,
  "includeContent": false
}
```

# Actor output Schema

## `results` (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": [
        "www.lennysnewsletter.com"
    ],
    "maxPostsPerPublication": 50
};

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

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

```

## MCP server setup

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