# Substack Scraper - Posts, Authors & Publications (`pink_comic/substack-scraper`) Actor

Scrape Substack posts from any publication or custom domain: title, subtitle, author, date, paywall flag, excerpt, comments and reactions. No login, no API key.

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

## Pricing

from $1.00 / 1,000 substack 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 - Posts, Authors & Publications

Scrape **Substack** posts from any publication, including custom domains. Every post comes back with the title, subtitle, canonical URL, authors, publish time, paywall flag, excerpt, word count, comment and reaction counts. No login and no API key.

### Why this Substack scraper

- **Custom domains work.** Pass `lennysnewsletter.com`, `lenny.substack.com`, or a full post URL. Other actors often only handle `*.substack.com`.
- **Paywall flag, excerpt and engagement** in one table: audience, comment count, reactions, restacks and word count.
- **Fast and reliable.** Uses Substack's public publication archive API, with cursor pagination past the first page.
- **Cheap, predictable pricing.** $0.001 per post + $0.002 per run. 1,000 posts cost about $1.00. Comparable Store actors charge $0.00115–$0.005 per post plus $0.005–$0.09 to start.

### Use cases

- **Creator and competitor monitoring**: watch newsletters you care about and get notified when a new post goes out.
- **PR and media lists**: find who writes about a beat and how often they publish.
- **AI agents and RAG**: feed dated, attributed newsletter excerpts to an LLM.
- **Research**: build a dataset of titles, authors and engagement over time.

### Input examples

Latest posts from one newsletter:

```json
{ "publications": ["https://www.lennysnewsletter.com"], "maxResults": 20 }
```

Several publications, including a Substack subdomain:

```json
{ "publications": ["platformer.substack.com", "https://www.lennysnewsletter.com"], "maxResults": 50 }
```

Public posts only:

```json
{ "publications": ["lenny"], "includePaywalled": false, "maxResults": 20 }
```

### Sample output

```json
{
  "publication": "lennysnewsletter.com",
  "publicationUrl": "https://lennysnewsletter.com",
  "title": "State of the tech job market: late 2026",
  "url": "https://www.lennysnewsletter.com/p/state-of-the-tech-job-market-late",
  "authors": "Lenny Rachitsky",
  "isPaywalled": true,
  "postDate": "2026-11-10T15:04:03.497Z",
  "commentCount": 33,
  "wordCount": 2183
}
```

| Field | Description |
|---|---|
| title / subtitle / url / slug | Post identity and link |
| authors | Byline names |
| publication / publicationUrl | Host you asked for |
| postDate | Publish time |
| isPaywalled / audience | Paid-only vs everyone |
| excerpt | Public truncated body |
| wordCount / commentCount / reactionCount / restacks | Engagement |

### Pricing

Pay per event: **$0.001 per post** and **$0.002 per run start**. Default input (20 posts) costs about $0.022. Set a max charge on the run and the actor stops before exceeding it.

### FAQ

**Do I need a Substack login?** No. Paywalled posts still return title, excerpt and metadata; full body is not included.

**Can I search all of Substack by keyword?** This actor scrapes publications you name. Pass one or more publication URLs or subdomains.

**Can I schedule it?** Yes. Use Apify Schedules and de-duplicate on `postId`.

**Something broke?** Open an issue on the Issues tab. We usually respond within a day.

# Actor input Schema

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

Publication URLs, custom domains or Substack subdomains, e.g. 'https://www.lennysnewsletter.com', 'lenny.substack.com', or 'lenny'.

## `includePaywalled` (type: `boolean`):

If off, only posts marked for everyone (not paid-only) are returned. Titles and excerpts of paywalled posts are still public either way.

## `maxResults` (type: `integer`):

Maximum posts, split across publications. Default 20 = about $0.022.

## Actor input object example

```json
{
  "publications": [
    "https://www.lennysnewsletter.com"
  ],
  "includePaywalled": true,
  "maxResults": 20
}
```

# Actor output Schema

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

All records from this run in the default dataset, shown with the Overview table view.

# 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": [
        "https://www.lennysnewsletter.com"
    ],
    "maxResults": 20
};

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

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

```

## MCP server setup

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