# Substack Scraper: Posts, Likes, Comments & Full Text (`kuezi/substack-scraper`) Actor

Scrape any Substack newsletter: every post with date, likes, comments, restacks, paywall status, authors and tags, plus the full text of free posts. Search inside a publication, stop at a date, or monitor new posts. $0.50 per 1,000 posts.

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

## Pricing

Pay per event

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, likes, comments and full text

Scrape any **Substack** newsletter: on substack.com or a custom domain. Every post comes with:

- title, subtitle, date, URL, authors, tags and section;
- **likes, comments and restacks**;
- **paywall status** (free vs paid), post type (newsletter, podcast, thread) and word count;
- cover image and podcast audio URL;
- optionally the **full text** (HTML and plain text) of free posts.

**Why this one:**

- **$0.50 per 1,000 posts.** No start fee, no monthly rent. Full text is an optional $0.0005 per free post. Paywalled posts are never charged for text.
- **Any publication format:** `astralcodexten`, `@astralcodexten`, `https://www.lennysnewsletter.com` or any post URL.
- **Search inside a publication** (`searchQuery`) and **stop at a date** (`dateFrom`), so you don't pay for older posts.
- **Monitoring mode** (`onlyNewPosts`): schedule it and each run returns only new posts.
- **Reliable paging:** Substack's archive silently skips posts with large page sizes, so the Actor pages 12 at a time. That's the size that returns every post.

### Use cases

- **Competitor and creator research:** which topics get the most likes and comments, how often they publish, what share is paywalled.
- **Newsletter monitoring:** new posts from a list of newsletters into Slack, Sheets or a feed reader.
- **AI and RAG pipelines:** clean full text of free posts with dates and authors.
- **Media and market research:** track how a newsletter's engagement changes over time.

### Ready-made tasks (one click to run)

- [Compare Substack newsletters: likes, comments, paywall](https://apify.com/kuezi/substack-scraper/examples/compare-substack-newsletters-engagement)
- [Get new posts from Substack newsletters (monitoring)](https://apify.com/kuezi/substack-scraper/examples/monitor-new-substack-posts)
- [Export a Substack newsletter's posts with full text](https://apify.com/kuezi/substack-scraper/examples/export-substack-full-text)

### Input

| Field | What it does |
|---|---|
| `publications` | Names, handles or URLs (custom domains work). |
| `maxPostsPerPublication` | Newest first. Default 50. |
| `searchQuery` | Optional. Only posts matching this text. |
| `dateFrom` | Optional `YYYY-MM-DD`. Paging stops here. |
| `includeContent` | Full text of free posts (`contentHtml`, `contentText`). |
| `onlyNewPosts` | Monitoring: skip posts seen in earlier runs. |

```json
{
  "publications": ["astralcodexten", "https://www.lennysnewsletter.com"],
  "maxPostsPerPublication": 40
}
```

### Output

One row per post (a real result from 2026-10-04):

```json
{
  "publication": "www.lennysnewsletter.com",
  "postId": 216168140,
  "title": "Advanced evals: How to find (and fix) hidden AI failures in your product",
  "subtitle": "Why you should never skip error discovery",
  "url": "https://www.lennysnewsletter.com/p/advanced-evals-how-to-find-and-fix",
  "postDate": "2026-09-22T12:45:14.998Z",
  "audience": "only_paid",
  "isPaid": true,
  "type": "newsletter",
  "wordcount": 3807,
  "reactionCount": 344,
  "commentCount": 4,
  "restacks": 20,
  "authors": ["Hamel Husain", "Shreya Shankar"],
  "tags": ["AI"],
  "coverImage": "https://substackcdn.com/image/fetch/…png",
  "language": "en",
  "slug": "advanced-evals-how-to-find-and-fix"
}
```

With `includeContent`, free posts also get `contentHtml` and `contentText`.

The status message summarises each publication (real run):

```
Saved 80 posts from 2 publication(s). astralcodexten.substack.com: 40 posts (2026-08-03 to 2026-10-02), 3 paywalled;
top "The Foothills Of Bay Area House Party" (1164 likes, 132 comments). www.lennysnewsletter.com: 40 posts (2025-11-04 to 2026-09-29), 32 paywalled; …
```

### Pricing (pay per event)

| Event | Price |
|---|---|
| Post saved (`post`) | **$0.0005** ($0.50 per 1,000) |
| Full text of a free post (`post-content`) | $0.0005 |

Failed publications are never charged. Set a maximum cost per run and the Actor stops cleanly.

### Notes

- Only public data: the Actor reads Substack's public archive and post endpoints, without login. Paid posts show metadata and Substack's public preview only.
- `reactionCount` is the post's like count as Substack shows it.
- Comment threads and subscriber counts aren't included.

### More from the same developer

- [Google News Scraper](https://apify.com/kuezi/google-news-scraper): articles with real publisher URLs, any country, new-article monitoring.
- [Telegram Channel Scraper](https://apify.com/kuezi/telegram-channel-scraper): posts, views and reactions from public channels, no login.
- [Google Trends Scraper](https://apify.com/kuezi/google-trends-scraper): interest over time for unlimited keywords, breakouts and Trending Now.
- [Google Ads Transparency Scraper](https://apify.com/kuezi/google-ads-transparency-scraper): every ad a competitor runs on Google, with ad text and landing pages.

# Actor input Schema

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

Substack names (astralcodexten), handles (@astralcodexten) or URLs, including custom domains (https://www.lennysnewsletter.com).

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

Newest first.

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

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

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

Optional, YYYY-MM-DD. Paging stops at this date, so you don't pay for older posts.

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

Adds contentHtml and contentText for posts open to everyone (paywalled posts are skipped and not charged).

## `onlyNewPosts` (type: `boolean`):

Skip posts returned by previous runs. Schedule the Actor to get each new post once.

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

Used when fetching full text.

## `maxRetries` (type: `integer`):

Each retry uses a fresh IP.

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

Apify datacenter proxy works for Substack.

## Actor input object example

```json
{
  "publications": [
    "astralcodexten"
  ],
  "maxPostsPerPublication": 50,
  "includeContent": false,
  "onlyNewPosts": false,
  "maxConcurrency": 4,
  "maxRetries": 4,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One row per post: date, title, paywall, words, likes, comments, restacks, authors, link.

## `fullResults` (type: `string`):

Every field, including full text when requested.

## `summary` (type: `string`):

Per publication stats and top post.

# 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": [
        "astralcodexten"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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