# Substack Posts Scraper (`gogumaa/substack-posts-scraper`) Actor

Posts from any Substack newsletter (name.substack.com or custom domain): title, date, authors, paywall flag, reactions, comments, optional full body. Public JSON archive API, no login, no browser.

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

## Pricing

$2.00 / 1,000 post scrapeds

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 Posts Scraper

**Substack scraper for full newsletter archives, with no login and no API key.** Pull every post from any Substack publication (`name.substack.com` or a custom domain like `newsletter.pragmaticengineer.com`): title, date, authors, paywall flag, reactions, comments, and optionally the full body as HTML and plain text. It uses Substack's public JSON archive API, so runs are fast and you pay per result.

### What you can do with it

- **Newsletter monitoring** — schedule `sort: new` for the publications you follow, push new posts to Slack, email or an LLM summarizer.
- **Competitor & creator research** — compare posting cadence, wordcount, reactions, comments and restacks across publications; `sort: top` lists a newsletter's most popular posts.
- **Content datasets** — `includeBody: true` adds `body_html` and `body_text` for RAG, topic analysis or archiving.
- **Paywall mapping** — `paywalled` shows which posts are paid-only, so you can measure a publication's free / paid mix.
- **Automated feeds** — Schedule it on Apify and pipe results to Google Sheets, Slack, n8n or Make via the Apify integration.
- **Podcast episode lists** — filter rows by `post_type: podcast` to get a publication's episodes with `podcast_url`.

### Output example

```json
{
  "type": "post",
  "publication": "newsletter.pragmaticengineer.com",
  "id": 222810010,
  "title": "The Pulse: Anthropic kills the coding interview",
  "subtitle": "AI is rendering the Leetcode-style interview pointless …",
  "slug": "the-pulse-anthropic-kills-the-coding",
  "url": "https://newsletter.pragmaticengineer.com/p/the-pulse-anthropic-kills-the-coding",
  "post_date": "2026-10-30T16:37:51.401Z",
  "post_type": "newsletter",
  "audience": "only_paid",
  "paywalled": true,
  "authors": ["Gergely Orosz"],
  "description": "AI is rendering the Leetcode-style interview pointless …",
  "cover_image": "https://substackcdn.com/image/fetch/…",
  "wordcount": 4545,
  "reactions": 49,
  "comment_count": 2,
  "restacks": 1,
  "podcast_url": null
}
```

With `includeBody: true` each row also has `body_html` and `body_text`.

### Input

| Field | Description |
|---|---|
| `publications` | List of newsletters: `stratechery`, `stratechery.substack.com`, a custom domain, or any post URL (reduced to its host). |
| `sort` | `new` (default) or `top`. |
| `includeBody` | Default `false`. Adds `body_html` and `body_text` (one extra request per post). Paywalled posts only return the free preview, if any. |
| `maxItems` | Stop after N posts total across all publications. Default 100. |

### Pricing

Pay per item: one event per post row. Nothing is charged for posts that are never produced.

### Notes

- `post_type` is `newsletter`, `podcast` or `thread`; `reactions` is the sum of all reaction counts; `podcast_url` is set for podcast posts.
- Domains that are not Substack publications return no posts: a warning is logged and the run continues.
- Posts are paged 50 per request; very large archives (thousands of posts) are bounded by `maxItems`.

### FAQ

#### Do I need an API key or account?

No. It only reads Substack's public archive and post endpoints, without logging in. Requests are paged 50 posts at a time; very frequent runs on one publication may be rate-limited.

#### How much does it cost?

$0.002 per result and nothing else: with pay-per-event pricing you are not billed for Apify compute. 100 results cost $0.20, and the Apify free plan's $5 monthly credit covers about 2,500 results. Rows that are never produced are never charged.

#### How do I get the data into Google Sheets or my app?

Export the run's dataset as CSV, JSON or Excel from the Apify Console, read it from the dataset API endpoint, or connect it to Google Sheets, Slack, n8n, Make or Zapier with Apify integrations.

#### Is it legal to scrape Substack?

It only reads public data via the platform's public API and respects rate limits. You are responsible for complying with Substack's terms and applicable law.

#### Can I get the full text of paywalled posts?

No. With `includeBody: true`, paywalled posts only return the free preview the publication shows to logged-out readers, if any. The `paywalled` field tells you which posts are affected.

### Related Actors

- [Hacker News Scraper](https://apify.com/gogumaa/hacker-news-scraper)
- [Wikipedia Scraper](https://apify.com/gogumaa/wikipedia-scraper)
- [Dev.to Articles Scraper](https://apify.com/gogumaa/devto-articles-scraper)

# Actor input Schema

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

Substack newsletters: name (stratechery), name.substack.com, custom domain (newsletter.pragmaticengineer.com) or any post / publication URL.

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

new = newest first. top = most popular first.

## `includeBody` (type: `boolean`):

One extra request per post; adds body_html and body_text. Paywalled posts return only the free preview (if any).

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

Stop after this many posts (total across all publications).

## Actor input object example

```json
{
  "publications": [
    "newsletter.pragmaticengineer.com"
  ],
  "sort": "new",
  "includeBody": false,
  "maxItems": 100
}
```

# Actor output Schema

## `items` (type: `string`):

One record per post: title, subtitle, url, date, authors, paywall flag, wordcount, reactions, comments, restacks, optional body.

# 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": [
        "newsletter.pragmaticengineer.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gogumaa/substack-posts-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": ["newsletter.pragmaticengineer.com"] }

# Run the Actor and wait for it to finish
run = client.actor("gogumaa/substack-posts-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": [
    "newsletter.pragmaticengineer.com"
  ]
}' |
apify call gogumaa/substack-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gogumaa/substack-posts-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/85bWQKjJ2c5M8DYL2/builds/5xjfhn92fGp7sZyQP/openapi.json
