# Substack Newsletter, Post & Creator Scraper (`bisketapis/substack-newsletter-scraper`) Actor

Substack posts with full text, publication details, comments, and discovery by search or category leaderboard, in one actor. Works on custom domains. Free posts return full text; paid posts return the public preview.

- **URL**: https://apify.com/bisketapis/substack-newsletter-scraper.md
- **Developed by:** [Chris Lucas](https://apify.com/bisketapis) (community)
- **Categories:** Lead generation, News
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.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 Newsletter, Post & Creator Scraper

Get Substack posts, full text, publication profiles and comments, and find newsletters by keyword or category leaderboard, in one actor. It reads the same public JSON API Substack's own website uses, so it needs no login and works on custom domains (`www.lennysnewsletter.com`) as well as `name.substack.com`.

**What you get**

- **Posts**: title, subtitle, date, audience (free or paid), word count, reactions, comments, restacks, cover image, authors, tags, URL. Switch on `includeContent` for the plain text of every post (and optionally the HTML).
- **Publications**: name, author, tagline, paid tier on or off, monthly and yearly price when public, the subscriber label Substack shows ("Over 11,000 subscribers"), launch date, leaderboard rank.
- **Discovery**: search publications by keyword, or list the top / paid / trending publications of any of the ~33 Substack categories.
- **Comments**: text, date, reactions, thread position, commenter display name.

Free posts return the full article text. Paid posts return the public preview only, flagged with `textIsPreview: true`. This actor never logs in and never gets past a paywall.

### Pricing

Pay per event. No start fee.

| Event | Price | Cost per 1,000 |
|---|---|---|
| Post (metadata, and full text if you ask for it) | $0.0005 | $0.50 |
| Publication | $0.001 | $1.00 |
| Comment | $0.0002 | $0.20 |

Example: 20 latest posts with full text from 50 newsletters = 1,000 posts + 50 publication rows = $0.55.
Full text costs the same as metadata only. Platform usage (compute, proxy) is included.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `mode` | `posts` / `search` / `leaderboard` | `posts` | What to do. |
| `publications` | list | `astralcodexten`, `https://www.lennysnewsletter.com/` | Mode `posts`. Subdomain, `x.substack.com`, custom domain, or any URL on the publication. |
| `queries` | list | `machine learning` | Mode `search`. Keywords or a newsletter name. |
| `categories` | list | `Technology` | Mode `leaderboard`. Name, slug or ID (Technology, Business, Finance, Science, Culture, Crypto...). |
| `leaderboardType` | `all` / `paid` / `trending` | `all` | Mode `leaderboard`. |
| `includeContent` | bool | false | Add plain text of each post. One extra request per post. |
| `includeHtml` | bool | false | With `includeContent`, also add body HTML. |
| `includeComments` | bool | false | One `comment` row per comment, threads flattened. |
| `maxCommentsPerPost` | int | 100 | |
| `sinceDate` | `YYYY-MM-DD` | none | Skip older posts; stops paging early. |
| `sort` | `new` / `top` | `new` | Post order inside a publication. |
| `maxPostsPerPublication` | int | 50 | |
| `maxPublications` | int | 25 | Per query / per category. |
| `postsPerDiscoveredPublication` | int | 0 | Search and leaderboard: also pull the latest N posts of every publication found. |
| `includePublicationRow` | bool | true | Set false to get posts only. |
| `maxItems` | int | 500 | Hard cap on all rows. Also respects your max-spend setting. |

Example (posts with full text):

```json
{ "mode": "posts", "publications": ["astralcodexten", "https://www.lennysnewsletter.com/"],
  "maxPostsPerPublication": 20, "includeContent": true }
```

Example (find sponsorship targets): `{ "mode": "leaderboard", "categories": ["Finance"], "leaderboardType": "paid", "maxPublications": 50 }`

### Output

Post row:

```json
{
  "type": "post", "id": 215694124, "publication": "Lenny's Newsletter", "publicationId": 10845,
  "title": "All of the Lenny & Friends Summit talks are now online!",
  "subtitle": "Plus, some reflections and takeaways from the day",
  "url": "https://www.lennysnewsletter.com/p/all-of-the-lenny-and-friends-summit",
  "postDate": "2026-09-29T13:15:57.512Z", "postType": "newsletter", "audience": "everyone",
  "wordcount": 1276, "reactionCount": 293, "commentCount": 8, "restacks": 5,
  "authors": ["Lenny Rachitsky"], "tags": [],
  "text": "Hey there, I'm Lenny. Each week, I share deeply researched product, growth, and career advice...",
  "textIsPreview": false, "scrapedAt": "2026-10-31T01:58:47Z"
}
```

Publication row:

```json
{
  "type": "publication", "id": 3393884, "name": "9-To-Thrive", "subdomain": "thrivewithcarrie",
  "url": "https://thrivewithcarrie.substack.com", "authorName": "Carrie Loranger",
  "hasPaidTier": true, "monthlyPrice": 97, "yearlyPrice": 300, "currency": "USD",
  "subscriberCountLabel": "Over 12,000 subscribers", "launchedLabel": "Hundreds of paid subscribers",
  "firstPostDate": "2025-03-08T14:02:43.350Z", "leaderboardRank": null, "profileSource": "search",
  "scrapedAt": "2026-10-31T02:02:31Z"
}
```

A run summary (status per input, HTTP counts) is saved as the `OUTPUT` record of the run's key-value store.

### Use cases

- Sponsorship buyers: rank newsletters in a category by subscriber label, paid tier and posting frequency.
- PR and outreach: find who writes about a topic, with author name, tagline and URL.
- Newsletter marketers: study what titles, lengths and cadences get reactions in your niche.
- AI and research datasets: bulk plain text of free posts with dates, authors and tags.
- Monitoring: schedule it with `sinceDate` to pick up new posts from a watchlist.

### FAQ

**Does it get paid posts?** Only the public preview Substack shows non-subscribers. Those rows have `textIsPreview: true`.
**Subscriber counts?** Substack does not publish exact counts. You get the label it shows ("Over 11,000 subscribers") when there is one, and not every publication has one.
**Which publications can I scrape?** Any public publication, including ones on custom domains.
**Why do some publication rows say `profileSource: "post"`?** Substack's profile search sometimes returns nothing for a publication. The actor then rebuilds a lighter profile from the publication's latest post: name, author, tagline, paid tier on or off, but no prices or subscriber label.
**Personal data?** Only public newsletter data. Comments carry the commenter's display name only, no handle or ID.

### Limits

- Pace is about 2 requests per second per host, so 1,000 posts with full text take roughly 8 to 10 minutes.
- Substack rate limits busy IPs; the actor retries on a fresh proxy IP and reports any input that still fails in the run summary.
- The leaderboard shows the top 25 per page; very deep pages may end early.
- Search returns the publications Substack ranks for your query, not an exhaustive list. Category is only filled in leaderboard mode.
- Comments on very popular posts are large downloads; use `maxCommentsPerPost`.

# Actor input Schema

## `mode` (type: `string`):

posts: scrape the publications listed below. search: find publications matching your queries. leaderboard: list the top publications of Substack categories.

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

Mode posts. One per line: a subdomain (astralcodexten), x.substack.com, a custom domain (www.lennysnewsletter.com) or any URL on the publication.

## `queries` (type: `array`):

Mode search. Keywords or a publication name. Returns publications, with optional posts.

## `categories` (type: `array`):

Mode leaderboard. Category name, slug or ID: Technology, Business, Finance, Science, Health & Wellness, Culture, Crypto, History, Education, and about 25 more.

## `leaderboardType` (type: `string`):

Mode leaderboard. Which ranking to read.

## `includeContent` (type: `boolean`):

Fetch each post and add its plain text. Free posts return the full text; paid posts return the public preview (textIsPreview = true). One extra request per post.

## `includeHtml` (type: `boolean`):

With full text: add the body HTML as well.

## `includeComments` (type: `boolean`):

Add one comment row per comment (threads flattened with parentId and depth). Commenter display name only.

## `maxCommentsPerPost` (type: `integer`):

Cap per post when comments are on.

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

YYYY-MM-DD. Older posts are skipped (with newest-first order, paging stops early).

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

Order of posts inside each publication.

## `maxPostsPerPublication` (type: `integer`):

Cap per publication.

## `maxPublications` (type: `integer`):

Modes search and leaderboard.

## `postsPerDiscoveredPublication` (type: `integer`):

Modes search and leaderboard. Also scrape this many latest posts of each publication found. 0 = publication rows only.

## `includePublicationRow` (type: `boolean`):

Emit a publication row per publication (name, author, paid tier, prices, subscriber label).

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

Hard cap on rows pushed (posts + publications + comments).

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

Parallel publications / post fetches. Requests are paced to about 2 per second per host regardless.

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

Apify Proxy (datacenter) is included in the price.

## Actor input object example

```json
{
  "mode": "posts",
  "publications": [
    "astralcodexten",
    "https://www.lennysnewsletter.com/"
  ],
  "queries": [
    "machine learning"
  ],
  "categories": [
    "Technology"
  ],
  "leaderboardType": "all",
  "includeContent": false,
  "includeHtml": false,
  "includeComments": false,
  "maxCommentsPerPost": 100,
  "sort": "new",
  "maxPostsPerPublication": 50,
  "maxPublications": 25,
  "postsPerDiscoveredPublication": 0,
  "includePublicationRow": true,
  "maxItems": 500,
  "maxConcurrency": 2,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

type = post, publication or comment.

## `runSummary` (type: `string`):

Status and counts per input, plus HTTP stats.

# 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": [
        "astralcodexten",
        "https://www.lennysnewsletter.com/"
    ],
    "queries": [
        "machine learning"
    ],
    "categories": [
        "Technology"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("bisketapis/substack-newsletter-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": [
        "astralcodexten",
        "https://www.lennysnewsletter.com/",
    ],
    "queries": ["machine learning"],
    "categories": ["Technology"],
}

# Run the Actor and wait for it to finish
run = client.actor("bisketapis/substack-newsletter-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": [
    "astralcodexten",
    "https://www.lennysnewsletter.com/"
  ],
  "queries": [
    "machine learning"
  ],
  "categories": [
    "Technology"
  ]
}' |
apify call bisketapis/substack-newsletter-scraper --silent --output-dataset

```

## MCP server setup

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