# Substack Scraper (`moving_beacon-owner1/substack-scraper`) Actor

Extract posts from any Substack publication, including subdomains like `*.substack.com` and custom domains such as `www.thefp.com`. You can optionally fetch the full HTML body of each post. The tool supports session cookies for accessing paid content from publications you're subscribed to.

- **URL**: https://apify.com/moving_beacon-owner1/substack-scraper.md
- **Developed by:** [Jamshaid Arif](https://apify.com/moving_beacon-owner1) (community)
- **Categories:** Automation, Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 7 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 results

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 — Apify Actor

Scrape posts from any Substack publication. Works with `*.substack.com` subdomains and with custom domains (e.g. `www.thefp.com`). Optionally fetches each post's full HTML body. Supports a session cookie for accessing paid content of publications you're subscribed to.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `publications` | `array<string>` | — (required) | Subdomain (e.g. `platformer`), full host (`www.thefp.com`), or URL. |
| `postsPerPublication` | `integer` | `10` | Number of most recent posts per publication. |
| `fetchFullContent` | `boolean` | `false` | If true, fetches each post's full HTML body (extra request per post). |
| `sinceDate` | `string` (YYYY-MM-DD) | — | Skip posts older than this date. |
| `substackSid` | `string` (secret) | — | Your `substack.sid` cookie value, for paid content you're subscribed to. |
| `maxConcurrency` | `integer` | `5` | Parallel requests when `fetchFullContent` is on. |

#### Example input

```json
{
    "publications": ["platformer", "astralcodexten", "www.thefp.com"],
    "postsPerPublication": 25,
    "fetchFullContent": true,
    "sinceDate": "2025-01-01",
    "maxConcurrency": 5
}
```

### Output

One dataset row per post:

```json
{
    "publication_host": "platformer.substack.com",
    "post_id": 12345678,
    "slug": "the-ai-takeover",
    "title": "The AI takeover of search",
    "subtitle": "What changes when answers replace links",
    "description": "A short summary of the post...",
    "url": "https://www.platformer.news/the-ai-takeover/",
    "type": "newsletter",
    "audience": "everyone",
    "published": "2026-05-18T10:00:00.000Z",
    "author": "Casey Newton",
    "author_handle": "caseynewton",
    "reactions": 234,
    "comments": 56,
    "cover_image": "https://...",
    "word_count": 1842,
    "body_html": "<p>...</p>",
    "truncated_body_text": null
}
```

For paywalled posts you don't have access to, `body_html` will be a short preview and `truncated_body_text` will contain it as plain text.

### Getting your `substack.sid` cookie (for paid content)

1. Log into Substack in your browser.
2. Open DevTools → Application → Cookies → `https://substack.com`.
3. Copy the value of the `substack.sid` cookie.
4. Paste it into the `substackSid` field. Treat it like a password.

You'll only get paid posts for publications you actually pay for.

# Actor input Schema

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

List of Substack publications to scrape. Use the subdomain only (e.g. 'platformer' for platformer.substack.com) or the full host for custom domains (e.g. 'www.thefp.com'). Full URLs also work.

## `postsPerPublication` (type: `integer`):

How many of the most recent posts to fetch per publication.

## `fetchFullContent` (type: `boolean`):

If enabled, makes an extra request per post to fetch its full HTML body and word count. Slower but gives you the actual text.

## `sinceDate` (type: `string`):

Optional cutoff — posts older than this date will be skipped. Leave empty to fetch all.

## `substackSid` (type: `string`):

Value of your `substack.sid` cookie. Only needed to access paid content of publications you're subscribed to. Leave empty for free content only.

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

Maximum number of concurrent HTTP requests when fetching full post content.

## Actor input object example

```json
{
  "publications": [
    "platformer",
    "astralcodexten"
  ],
  "postsPerPublication": 10,
  "fetchFullContent": false,
  "maxConcurrency": 5
}
```

# 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": [
        "platformer",
        "astralcodexten"
    ]
};

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

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

```

## MCP server setup

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