# Substack Archive Scraper (`axery/substack-archive-scraper`) Actor

Scrape a Substack publication's post archive - title, author, tags, engagement counts, and full text for free posts. No login, no API key.

- **URL**: https://apify.com/axery/substack-archive-scraper.md
- **Developed by:** [Axery](https://apify.com/axery) (community)
- **Categories:** News, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 5.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 result items

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

Scrapes a Substack publication's post archive — title, author, tags, engagement counts, and full text for free posts. No login, no API key.

Useful for content research, newsletter competitor tracking, topic monitoring across a publication, and building a reading archive.

### What makes this different

**Full text for genuinely free posts, not just an excerpt — because Substack itself decides, not this scraper.** The archive list only ever carries a short preview. But Substack's own per-post detail endpoint returns the *complete* article body for posts marked free to read — this Actor requests it and passes through exactly what Substack serves. A paywalled post's detail response comes back truncated to Substack's own preview length; the Actor doesn't try to get around that, it just reports what's actually there.

**`full_text_available` tells you which is which, correctly.** A paywalled post's free preview can itself run to several hundred words — long enough that a naive length check would mistake it for the full piece. This Actor compares the returned word count against the post's own stated `wordcount` and only marks it complete above a 90% threshold, so a generous preview isn't misreported as the whole article.

**Works from either the Substack subdomain or a custom domain.** A publication that has moved to its own domain (`astralcodexten.com`) still only serves its API from the `.substack.com` subdomain underneath — the custom domain itself just 404s on the API path. This Actor resolves either form correctly.

**A non-Substack site fails clearly, not silently.** Pointing this at a domain that merely resembles a newsletter — or one that has migrated off Substack entirely — returns a normal HTML page with HTTP 200, which a content-type-blind scraper would read as "zero results" rather than "wrong platform." This Actor checks the response type and reports the real cause.

### Input

| Field | Type | Notes |
|---|---|---|
| `publications` | array | Substack subdomain or custom domain. |
| `maxItems` | integer | Per publication. `0` = entire archive. |
| `includeFullText` | boolean | Full text for free posts only, one extra request per post. |
| `sort` | enum | Newest, most popular, or community picks — same as the archive page itself. |
| `incremental` | boolean | Only posts not seen in previous runs. |
| `proxyConfiguration` | object | Not normally needed. |

### Output

```json
{
  "post_id": "substack:212214205",
  "title": "Harry and Meghan's Awkward Homecoming...",
  "authors": ["The Free Press"],
  "audience": "everyone",
  "is_paywalled": false,
  "published_at": "2026-08-22T10:02:32.256Z",
  "tags": ["United Kingdom", "The Weekend Press", "Crime"],
  "reaction_count": 68,
  "comment_count": 16,
  "wordcount": 1053,
  "full_text_available": true,
  "url": "https://www.thefp.com/p/harry-and-meghans-awkward-homecoming"
}
```

Each run also writes a `RUN_COVERAGE` record to the key-value store with what was requested, what came back, and any per-publication failures — so a partial run is visible rather than silent.

### Local development

```bash
pip install -r requirements.txt
python test_local.py bariweiss --max 12 --full-text --out sample_output.json
python test_local.py astralcodexten.com --max 10
```

`sample_output.json` is real output from a live run with full-text enrichment on.

# Actor input Schema

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

A publication's Substack subdomain (e.g. `bariweiss` from `bariweiss.substack.com`) or its custom domain (e.g. `astralcodexten.com`) - either works. Each is fetched independently into the same dataset.

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

Cap on posts returned per publication. `0` returns the entire archive.

## `includeFullText` (type: `boolean`):

Fetch full article text where Substack itself serves it - free (non-paywalled) posts only. Paywalled posts stay truncated to whatever preview length Substack shows a logged-out reader; this option does not change that. One extra request per post.

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

Same options as the publication's own archive page.

## `incremental` (type: `boolean`):

Remember post IDs between runs and return only posts not seen before.

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

Not normally needed - this is the same public API the publication's own archive page calls.

## Actor input object example

```json
{
  "publications": [
    "bariweiss"
  ],
  "maxItems": 30,
  "includeFullText": false,
  "sort": "new",
  "incremental": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per post: title, author, tags, engagement counts, and full text where Substack itself makes the post free.

# 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": [
        "bariweiss"
    ],
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("axery/substack-archive-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": ["bariweiss"],
    "maxItems": 30,
}

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

```

## MCP server setup

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