# Substack Scraper: Posts, Newsletters & Comments (`mastertools/substack-scraper`) Actor

Scrape any Substack newsletter with no login: full text of free posts as text, Markdown or HTML, likes, comments, restacks, author and paid flag. Search all of Substack, list top newsletters by category with subscribers, prices and social links, and get only new posts.

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

## Pricing

from $0.80 / 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: Posts, Newsletters & Comments

**Any Substack newsletter in clean rows: full post text, likes, comments, restacks and author — plus newsletter search with subscribers and prices.**

Scrape Substack with no login, no cookies and no API key. Paste newsletter links — custom domains like `lennysnewsletter.com` work too — press Start and get one flat row per post: title, date, author, the whole text of free posts in plain text, Markdown or HTML, likes, comments, restacks, word count and a clear paid flag. Add reader comments with whole reply threads, search all of Substack by keyword, or pull the leading newsletters of any category with subscribers, subscription prices and the author's social links. The example input finishes in seconds.

### What you get

- **Full text, ready for AI** — every free post whole, as clean plain text, Markdown for RAG and LLM pipelines, or the original HTML. Share buttons, subscribe boxes and tracking links are stripped out.
- **The engagement numbers** — likes, comments, restacks, word count and reading time in every row, next to the newsletter's subscriber count. Find the posts that took off.
- **Clear paid flag** — `isPaid` and `access` on every post; paid posts come with the part anyone can read before the paywall, and `isFullText` tells you which is which.
- **Comments with whole threads** — every comment and reply as its own row: text, author, likes, date, reply level and a link. Thousands of comments arrive in seconds.
- **Search all of Substack** — keywords bring posts from every newsletter on the platform, or the newsletters that write about your topic.
- **Newsletter lists with contacts** — Substack's category leaderboards (Technology, Business, Finance and 31 more) and keyword search give one row per newsletter: subscribers, paid subscribers, monthly and yearly price, author, followers, leaderboard rank and links to X, YouTube, TikTok, Instagram and websites. Built for sponsorships, outreach and market maps.
- **Any period, top posts, only new** — newest first or the most popular posts of all time, a date range that jumps straight to the dates you need, and "only new" for schedules.
- **Every input line answered** — a deleted post, a site that is not on Substack or a typo comes back as a short row with the reason, free of charge.
- **Light and fast** — plain HTTP to Substack's public data instead of a browser.

### How to use

1. Press **Start** — the example newsletters work as is.
2. Put your own newsletters, post links or author profiles in place of the example — or clear them and type keywords to search all of Substack, or pick categories.
3. Download the results as JSON, CSV, Excel or HTML, send them to Google Sheets, or take them through the API.

### Input

| Field | What it does | Example |
|---|---|---|
| `urls` | Newsletters, posts or authors, one per line: a newsletter link (custom domain or `name.substack.com`), its Substack name, a post link or an author profile. | `https://www.lennysnewsletter.com`, `garymarcus`, `https://substack.com/@lenny` |
| `searchQueries` | Keywords. With newsletter links — posts of those newsletters that match. Without links — search across all of Substack. | `ai agents`, `pricing` |
| `maxResults` | Posts per newsletter or per keyword; newsletters per search or category. | `100` |
| `includeComments` | Adds comments and replies of every post as their own rows. | `true` |
| `textFormat` | `text` (default), `markdown`, `html`, or `none` for titles and numbers only. | `markdown` |
| `sort` | `new` — newest first; `top` — the newsletter's most popular posts. | `top` |
| `postAccess` | `all`, `free` (full text only) or `paid`. | `free` |
| `postedAfter`, `postedBefore` | A date range: a date or a period like `30 days`. | `2026-01-01` |
| `onlyNew` | Each run returns only posts (or newsletters) that previous runs have not returned. | `true` |
| `categories` | Top newsletters of Substack categories. | `["technology", "finance"]` |
| `searchFor` | What a Substack-wide search returns: `posts` or `newsletters`. | `newsletters` |
| `includeNewsletterDetails` | One extra row per newsletter from your links, with subscribers, prices and links. | `true` |
| `maxCommentsPerPost` | Comments and replies per post, best first. | `500` |

```json
{
  "urls": ["https://www.lennysnewsletter.com", "garymarcus", "https://www.oneusefulthing.org"],
  "maxResults": 50,
  "textFormat": "markdown",
  "includeComments": true,
  "postedAfter": "90 days"
}
```

Find newsletters for a sponsorship campaign:

```json
{
  "searchQueries": ["personal finance", "investing"],
  "searchFor": "newsletters",
  "categories": ["finance", "business"],
  "maxResults": 100
}
```

### Output

Every row has a `type`: `post`, `comment` or `newsletter`. A post (text shortened):

```json
{
  "type": "post",
  "title": "Fable 5.2 and Jagged AGI",
  "subtitle": "General, often expert, and sometimes jagged",
  "url": "https://www.oneusefulthing.org/p/fable-52-and-jagged-agi",
  "postedAt": "2026-11-09T19:04:26.112Z",
  "author": "Ethan Mollick",
  "authorHandle": "oneusefulthing",
  "newsletter": "One Useful Thing",
  "newsletterUrl": "https://www.oneusefulthing.org",
  "newsletterSubscribers": 505000,
  "isPaid": false,
  "access": "free",
  "likes": 1426,
  "comments": 226,
  "restacks": 161,
  "wordCount": 3170,
  "readingTimeMinutes": 13,
  "postType": "newsletter",
  "tags": null,
  "excerpt": "Before getting started, I wanted to thank my readers for making my new book…",
  "text": "Before getting started, I wanted to thank my readers for making my new book, Co-Existence, a New York Times bestseller…",
  "textFormat": "text",
  "isFullText": true,
  "coverImage": "https://substackcdn.com/image/fetch/…",
  "audioUrl": null,
  "language": "en",
  "postId": 220479835,
  "input": "https://www.oneusefulthing.org",
  "scrapedAt": "2026-11-16T18:31:37.981Z"
}
```

A comment:

```json
{
  "type": "comment",
  "text": "Open source code for Portals: https://github.com/emollick/ai-portals",
  "author": "Ethan Mollick",
  "authorHandle": "oneusefulthing",
  "isPostAuthor": true,
  "likes": 28,
  "replies": 1,
  "postedAt": "2026-11-09T19:44:02.044Z",
  "depth": 0,
  "parentCommentId": null,
  "url": "https://www.oneusefulthing.org/p/fable-52-and-jagged-agi/comment/383111922",
  "postTitle": "Fable 5.2 and Jagged AGI",
  "postUrl": "https://www.oneusefulthing.org/p/fable-52-and-jagged-agi"
}
```

A newsletter:

```json
{
  "type": "newsletter",
  "name": "Marcus on AI",
  "url": "https://garymarcus.substack.com",
  "author": "Gary Marcus",
  "subscribers": 124000,
  "subscribersText": "Over 124,000 subscribers",
  "paidSubscribersText": "Thousands of paid subscribers",
  "authorFollowers": 157858,
  "hasPaidPlan": true,
  "priceMonthly": 8,
  "priceYearly": 80,
  "currency": "USD",
  "leaderboard": "#3 trending in Technology",
  "bestsellerTier": 1000,
  "links": "https://x.com/GaryMarcus",
  "createdAt": "2022-05-14T14:09:01.902Z"
}
```

- `isFullText` — `true`: the whole post; `false`: a paid post, given up to the paywall.
- `newsletterSubscribers`, `subscribers` — as Substack shows them, as a whole number (`1.2M+` becomes `1200000`); exact when Substack shows the exact count.
- `depth` and `parentCommentId` rebuild the comment thread; `isPostAuthor` marks the author's own replies.
- `searchQuery` — the keyword that found the row; `input` — your line it came from.

The Output tab has three views: **Posts**, **Comments** and **Newsletters**.

### Monitor newsletters

Switch on `onlyNew`, add newsletters, keywords or categories and set a schedule — every hour or every day. Each run brings only what the previous runs have not returned, so a webhook, Google Sheets, Slack or your CRM gets every new post once. Typical jobs: competitor and industry newsletters, brand mentions, AI news digests, research archives, new newsletters to sponsor.

### Use it with AI agents

Add the Actor as a tool in Claude, ChatGPT, Cursor, n8n or any MCP client through the Apify MCP server (`mcp.apify.com`). One field is enough — `urls` or `searchQueries` — and `textFormat: "markdown"` gives text your model reads well. Feed whole newsletter archives into RAG, summaries and trend reports.

### Integrations

Google Sheets, Make, Zapier, n8n, Slack, Airbyte, webhooks and the Apify API — the results are flat rows, so they go straight into a table, a database or a BI tool.

### FAQ

**Do I need a Substack account or API key?** No. Add newsletters and press Start.

**Do custom domains work?** Yes — `lennysnewsletter.com`, `oneusefulthing.org` and any other Substack newsletter on its own domain, as well as `name.substack.com`, `open.substack.com` links and author profiles.

**What about paid posts?** Every post is in the results with its title, numbers and the paid flag. The text is the part Substack shows to everyone before the paywall; `isFullText` says whether it is the whole post. Choose `postAccess: free` to get only posts with full text.

**How far back can I go?** The whole archive of a newsletter. Set `maxResults` high, or use `postedAfter` and `postedBefore` for one period — the scraper jumps straight to the dates.

**Can I get the most popular posts?** Yes: `sort: top` gives the newsletter's most liked posts of all time.

**How do I find newsletters about a topic?** Clear the links, type keywords and set `searchFor` to `newsletters`, or pick categories. Each newsletter comes with subscribers, prices, author, followers and social links.

**How fresh is the data?** Every run reads Substack live: likes, comments and subscribers are the numbers at that moment.

### Need data at scale?

Daily exports of thousands of newsletters, complete archives with comments, a pipeline into your CRM, data warehouse or BI tool, or a custom scraper for another platform — we build it for you.

# Actor input Schema

## `urls` (type: `array`):

One per line: a newsletter link (https://www.lennysnewsletter.com, https://name.substack.com), its Substack name (lenny), a post link (…/p/post-name) or an author profile (https://substack.com/@lenny). Custom domains work. Leave empty to search all of Substack or list categories.

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

Optional. With newsletter links above — posts of those newsletters that match. Without links — Substack-wide search: posts (or newsletters, see "Search for") from all of Substack. One search per line.

## `maxResults` (type: `integer`):

How many posts to take from each newsletter (and from each keyword), or how many newsletters from each search or category.

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

Adds the readers' comments and replies of every post as their own rows: text, author, likes, date, thread.

## `textFormat` (type: `string`):

Full text of free posts (paid posts up to the paywall): clean plain text, Markdown for AI and RAG, or the original HTML. "No text" is the fastest — titles, stats and links only.

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

Newest posts first, or the newsletter's most popular posts of all time.

## `postAccess` (type: `string`):

All posts, only free ones (full text), or only paid ones (text up to the paywall).

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

Optional. Only posts newer than this: a date like 2026-01-01 or a period like 30 days.

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

Optional. Only posts older than this date — the scraper jumps straight to it, so old periods are fast too.

## `onlyNew` (type: `boolean`):

For schedules and monitoring: each run returns only posts (or newsletters) that the previous runs with the same newsletters, keywords or categories have not returned yet.

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

Optional. Substack's own category leaderboards — the leading newsletters with subscribers, prices, author, links and rank. Great for sponsorships, outreach and market maps.

## `searchFor` (type: `string`):

What a Substack-wide keyword search returns: posts, or the newsletters that write about it (one row per newsletter with subscribers, prices and links).

## `includeNewsletterDetails` (type: `boolean`):

One extra row per newsletter from your links: subscribers, paid subscribers, prices, author, followers, leaderboard rank and social links.

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

With comments on: how many comments and replies to take from each post, best first.

## Actor input object example

```json
{
  "urls": [
    "https://www.oneusefulthing.org",
    "https://www.lennysnewsletter.com"
  ],
  "searchQueries": [],
  "maxResults": 5,
  "includeComments": false,
  "textFormat": "text",
  "sort": "new",
  "postAccess": "all",
  "onlyNew": false,
  "searchFor": "posts",
  "includeNewsletterDetails": false,
  "maxCommentsPerPost": 100
}
```

# Actor output Schema

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

All rows of this run in the default dataset.

# 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 = {
    "urls": [
        "https://www.oneusefulthing.org",
        "https://www.lennysnewsletter.com"
    ],
    "searchQueries": [],
    "maxResults": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("mastertools/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 = {
    "urls": [
        "https://www.oneusefulthing.org",
        "https://www.lennysnewsletter.com",
    ],
    "searchQueries": [],
    "maxResults": 5,
}

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

```

## MCP server setup

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