# Substack Scraper - Newsletter Posts, Full Text & Comments (`scrolahdata/substack-scraper`) Actor

Substack newsletter scraper (incl. custom domains): Substack posts with full text, likes, restacks, authors and tags, plus Substack comments. Top/newest, keyword search, date range. No login. $1 per 1,000 posts.

- **URL**: https://apify.com/scrolahdata/substack-scraper.md
- **Developed by:** [Leping Gong](https://apify.com/scrolahdata) (community)
- **Categories:** Social media, News, AI
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 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 — Newsletter Posts, Full Text & Comments

Scrape **any Substack newsletter** — including custom domains like `www.lennysnewsletter.com` — without login or API keys. Get every post with **full text, likes, comments count, restacks, word count, authors, tags, cover image and links**, plus the **comments and replies**.

### Why this scraper?

- 🌐 **Works with custom domains** — not only `*.substack.com`
- 📝 **Full clean text** of free posts (Markdown-like headings and lists), optional raw HTML
- 🔥 **Top posts or newest** — find a newsletter's most popular posts in one click
- 🔎 **Keyword search** inside a newsletter, **date range**, **free posts only**
- 💬 **Comments & replies** with author, likes and thread depth
- ⚡ Fast & cheap — public JSON API, no browser, no start fee
- 💸 **Pay per post** — invalid newsletters and errors are free

### Input

```json
{
  "newsletters": ["simonw", "www.lennysnewsletter.com", "https://www.astralcodexten.com/p/some-post"],
  "maxPostsPerNewsletter": 100,
  "sortBy": "top",
  "searchQuery": "AI",
  "postsFrom": "2026-01-01",
  "maxCommentsPerPost": 20
}
```

Accepted formats: `name`, `name.substack.com`, custom domain, `substack.com/@handle`, `open.substack.com/pub/name/p/slug`, post URL.

### Output

Post:

```json
{
  "type": "post",
  "newsletter": "https://simonw.substack.com",
  "postId": 224270395,
  "title": "Locating the source of a mysterious beep with Claude",
  "subtitle": "Plus Hide your slop PR descriptions behind <details><summary>",
  "url": "https://simonw.substack.com/p/locating-the-source-of-a-mysterious",
  "date": "2026-11-10T07:41:51.409Z",
  "audience": "everyone",
  "isPaid": false,
  "bodyIsFull": true,
  "author": "Simon Willison",
  "tags": ["ai"],
  "wordcount": 5034,
  "reactions": 30,
  "comments": 11,
  "restacks": 2,
  "text": "In this newsletter: ...",
  "links": ["https://github.com/simonw/beep-locator"]
}
```

Comment:

```json
{
  "type": "comment",
  "postUrl": "https://simonw.substack.com/p/locating-the-source-of-a-mysterious",
  "commentId": 383527088,
  "parentId": null,
  "depth": 0,
  "date": "2026-11-10T08:22:06.052Z",
  "authorName": "Harish Gupta",
  "text": "The carbon monoxide detector was an important find...",
  "reactions": 1
}
```

### Use cases

- **Content research & competitor analysis** — which posts of a newsletter get the most likes and comments
- **AI / RAG datasets** — clean full text of thousands of newsletter posts for LLMs
- **Media monitoring** — schedule daily runs with *Posts from date* and a keyword
- **Audience research** — comments show what readers care about
- **Lead generation** — find active writers in your niche

### Limits

Paid posts return only the public preview (`isPaid: true`, `bodyIsFull: false`). Only public data is collected — no login, no subscriber data.

### Pricing

- **Post** — per post row (full text included)
- **Comment** — per comment row (only if you set *Max comments per post*)

Discounts for Apify Silver, Gold and higher plans.

### How to use Substack Scraper

1. Click **Try for free** (the Apify free plan includes monthly credit).
2. Fill in the input — the example input is already pre-filled, so you can just press **Start**.
3. Download results as **JSON, CSV, Excel or HTML**, or open them in the dataset table view.

### Integrations & API

- **API** — run it from Python, Node.js or any language with the Apify API / `apify-client` and get results as JSON.
- **Schedules & monitoring** — run it hourly, daily or weekly and get only fresh data.
- **Zapier, Make, n8n, Google Sheets, Slack, webhooks** — send results to your tools automatically.
- **AI agents (MCP)** — use it from Claude, ChatGPT, Cursor or any MCP client through the Apify MCP server.

### FAQ

**Do I need an API key, login or cookies?** No. It reads publicly available data only.

**How much does it cost?** You pay only for results (see the Pricing tab), no start fee. Error rows are free. Higher Apify plans get automatic discounts.

**Is it legal?** It collects public data only. Make sure your use complies with the website's terms and data-protection laws (e.g. GDPR) — don't collect personal data without a legal basis.

**Something doesn't work or you need a feature?** Open an issue in the **Issues** tab — we usually reply within a day.

### More from ScrolahData

- [Telegram Channel Scraper](https://apify.com/scrolahdata/telegram-channel-scraper)
- [Google News Scraper](https://apify.com/scrolahdata/google-news-scraper)
- [YouTube Transcript Scraper](https://apify.com/scrolahdata/youtube-transcript-scraper)
- [App Store & Google Play Reviews Scraper](https://apify.com/scrolahdata/app-store-reviews-scraper)

# Actor input Schema

## `newsletters` (type: `array`):

Substack names (lenny), subdomains (simonw.substack.com), custom domains (www.lennysnewsletter.com) or post URLs (.../p/slug).

## `maxPostsPerNewsletter` (type: `integer`):

Posts per newsletter (ignored for post URLs).

## `sortBy` (type: `string`):

Newest posts or the newsletter's most popular posts.

## `searchQuery` (type: `string`):

Optional. Only posts matching this keyword (Substack's own archive search).

## `postsFrom` (type: `string`):

Only posts on or after this date (YYYY-MM-DD).

## `postsTo` (type: `string`):

Only posts on or before this date (YYYY-MM-DD).

## `freeOnly` (type: `boolean`):

Skip paid posts (paid posts only have a preview text).

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

0 = no comments. Comments and replies are charged per comment.

## `fullText` (type: `boolean`):

Fetch the complete text of every free post (one extra request per post). Off = listing preview only, faster.

## `includeHtml` (type: `boolean`):

Add the raw post HTML in addition to clean text.

## `maxConcurrency` (type: `integer`):

Newsletters scraped in parallel.

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

Apify Proxy recommended.

## Actor input object example

```json
{
  "newsletters": [
    "simonw.substack.com",
    "www.lennysnewsletter.com"
  ],
  "maxPostsPerNewsletter": 50,
  "sortBy": "new",
  "freeOnly": false,
  "maxCommentsPerPost": 0,
  "fullText": true,
  "includeHtml": false,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

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

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

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

```

## MCP server setup

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