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

Scrape any Substack newsletter (substack.com or custom domain): every post with title, date, authors, likes, comments, restacks, word count, tags and full text of free posts. Archive search, top posts, new-posts-only monitoring. $1.50 per 1,000 posts.

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

## Pricing

from $1.50 / 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: Newsletter Posts, Full Text & Engagement

**Export every post from any Substack newsletter to JSON, CSV or Excel**: title, subtitle, date, authors, likes, comments, restacks, word count, tags, cover image, podcast links and the **full text of free posts**. Works with `*.substack.com`, **custom domains** (e.g. lennysnewsletter.com), `@handle` profiles and single post URLs.

- **Whole archives** with automatic pagination, or just the latest N posts.
- **Top posts** (most popular) or newest first.
- **Search** inside a newsletter's archive by keyword.
- **Monitoring mode**: `onlyNewPosts` returns (and charges for) only posts you haven't seen, perfect for a daily schedule.
- Paywalled posts are included with the **public preview** Substack shows to non-subscribers (flagged with `isPaywalled` and `textIsPreviewOnly`), or skip them.

It reads the newsletter's own public JSON endpoints, the same ones its website uses. No login, no browser, no proxies, no API key.

### Who uses it

- **Marketers and growth teams.** Find what topics and formats get the most likes, comments and restacks in your niche.
- **Investors and analysts.** Track finance and industry newsletters for new ideas.
- **AI and research teams.** Build clean text datasets or a RAG knowledge base from newsletters.
- **Writers.** Benchmark your newsletter against competitors' posting frequency and engagement.
- **Sponsorship buyers.** Shortlist newsletters by engagement before you pitch.

### Input

| Field | Description |
|---|---|
| `newsletters` (required) | Newsletter URLs, subdomains (`astralcodexten`), profiles (`@noahpinion`) or post URLs. |
| `maxPostsPerNewsletter` | Default 50; `0` = whole archive. |
| `sortBy` | `new` (default) or `top`. |
| `search` | Keyword search within each newsletter. |
| `postsWithinDays` | Only recent posts. |
| `content` | `text` (default), `text_html` or `none` (metadata only, fastest). |
| `skipPaywalled` | Leave out subscriber-only posts. |
| `onlyNewPosts` | **Monitoring mode** for scheduled runs. |

```json
{
  "newsletters": ["https://www.lennysnewsletter.com", "@noahpinion", "astralcodexten"],
  "maxPostsPerNewsletter": 100,
  "sortBy": "top",
  "content": "text"
}
```

### Output (one row per post)

Real row from a test run on 2026-11-16 (text shortened):

```json
{
  "postId": 225109906,
  "title": "Bumbition",
  "subtitle": "An alternative route to success in life.",
  "url": "https://www.noahpinion.blog/p/bumbition",
  "publishedAt": "2026-11-16T09:52:30.449Z",
  "type": "newsletter",
  "audience": "everyone",
  "isPaywalled": false,
  "authors": ["Noah Smith"],
  "wordCount": 2272,
  "likes": 531,
  "comments": 64,
  "restacks": 55,
  "tags": null,
  "text": "“Hey, I’ll get a job…when I hear the true call.” — Slacker (1990)\nAbout 10 years ago, I met a woman who...",
  "textIsPreviewOnly": false,
  "newsletterUrl": "https://www.noahpinion.blog",
  "publicationId": 35345
}
```

A per-newsletter summary (posts found, inputs not found) is saved to the `RUN_SUMMARY` record in the run's key-value store.

### Pricing (pay per event)

- **$1.50 per 1,000 posts** ($0.0015 per post), full text included, plus Apify's tiny standard actor-start fee.
- Inputs that aren't Substack newsletters cost nothing.
- Example: the full archives of 10 newsletters with ~300 posts each = 3,000 posts = **$4.50**.
- Use "Maximum cost per run" in run options to cap spending.

### FAQ

**Can it read paid posts?** No. It never logs in. Paywalled posts include only the free preview that anyone can see on the web.

**Does it work with custom domains?** Yes, any newsletter hosted on Substack works, whatever its domain.

**Does it scrape subscribers or emails?** No. It only collects published posts and their public engagement counts.

**Is it legal?** It reads publicly available posts through the newsletter's own public endpoints. Respect authors' copyright when you reuse content.

# Actor input Schema

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

One per line: a newsletter URL (https://www.lennysnewsletter.com or https://name.substack.com), a subdomain (astralcodexten), a profile (@noahpinion or https://substack.com/@noahpinion) or a single post URL (.../p/slug).

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

0 = the whole archive. You are only charged for posts returned.

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

'Top' returns the newsletter's most popular posts.

## `search` (type: `string`):

Optional keyword; uses the newsletter's own archive search.

## `postsWithinDays` (type: `integer`):

0 = any date.

## `content` (type: `string`):

Full text of free posts. Paywalled posts include only the public preview that Substack shows to non-subscribers.

## `skipPaywalled` (type: `boolean`):

Leave out subscriber-only posts.

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

Remembers post IDs in a named key-value store so scheduled runs return (and charge for) new posts only.

## `stateStoreName` (type: `string`):

Named key-value store used by 'Only new posts'.

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

Parallel HTTP requests.

## Actor input object example

```json
{
  "newsletters": [
    "https://www.lennysnewsletter.com",
    "@noahpinion"
  ],
  "maxPostsPerNewsletter": 50,
  "sortBy": "new",
  "postsWithinDays": 0,
  "content": "text",
  "skipPaywalled": false,
  "onlyNewPosts": false,
  "stateStoreName": "substack-posts-seen",
  "maxConcurrency": 5
}
```

# Actor output Schema

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

No description

## `summary` (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": [
        "https://www.lennysnewsletter.com",
        "@noahpinion"
    ]
};

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

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

```

## MCP server setup

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