# Substack Posts Scraper · Archives + comments · $1/1K (`mlg14/substack-scraper`) Actor

Scrape Substack newsletter posts by publication URL or keyword for content research, competitor monitoring and lead lists. Full archives, engagement counts, free content and public comments. $1/1K posts.

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

## Pricing

$1.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

Scrape Substack newsletters, public post archives, individual posts, and posts discovered by keyword. Export Substack post data to CSV, JSON, or Excel with publication details, engagement counts, available free content, and optional public comments; the actor also serves as a practical Substack API alternative for scheduled collection.

The scraper accepts standard `*.substack.com` publication URLs and publication custom domains. It follows public archive pagination, so a newsletter with more than one archive page is not limited to the first visible screen. Each dataset item represents one post. Repeated posts found through multiple URLs or keywords appear once per run.

### What data can you extract from Substack?

The output uses stable, top-level field names. Fields that a publication or post does not expose are `null`; `tags` is an array, and `comments` is an optional array of comment trees. Engagement figures reflect the source at the time of collection.

| Field | Description | Example |
| --- | --- | --- |
| `postId` | Numeric public post ID | `193007895` |
| `title` | Post headline | `A visual guide to getting out of a creative slump` |
| `subtitle` | Secondary headline | `On creating work like a human` |
| `slug` | Post path segment | `a-visual-guide-to-getting-out-of` |
| `url` | Canonical post link | `https://www.lennysnewsletter.com/p/a-visual-guide-to-getting-out-of` |
| `publishedAt` | Original publication time | `2026-04-07T12:45:49.978Z` |
| `updatedAt` | Most recent update time | `2026-04-09T01:20:14.391Z` |
| `postType` | Source post category | `newsletter` |
| `audience` | Source audience setting | `everyone` |
| `isPaid` | Whether the full post requires a subscription | `false` |
| `wordcount` | Source reported word count | `1369` |
| `coverImage` | Cover image URL | `https://substackcdn.com/image/...` |
| `tags` | Public topic names | `[]` |
| `reactionCount` | Number of reactions | `509` |
| `commentCount` | Source reported comment count | `11` |
| `childCommentCount` | Source reported reply count | `7` |
| `restacks` | Number of restacks | `44` |
| `hasVoiceover` | Whether a voiceover exists | `true` |
| `bodyHtml` | Full public HTML for a free post | `<p>...</p>` |
| `contentPreview` | Public preview text | `A short introduction...` |
| `description` | Post description | `On creating work like a human` |
| `language` | Post language code | `en` |
| `podcastUrl` | Podcast media URL if present | `null` |
| `sectionName` | Publication section if present | `null` |
| `authorName` | Public byline display name | A public display name |
| `authorHandle` | Public byline handle | A public handle |
| `authorId` | Numeric public byline ID | `24401115` |
| `publicationId` | Numeric publication ID | `10845` |
| `publicationName` | Publication title | A public publication title |
| `publicationUrl` | Publication home URL | `https://www.lennysnewsletter.com` |
| `subscriberCount` | Publicly reported free subscriber count | `1200000` |
| `publicationDescription` | Public publication introduction | A short introduction |
| `publicationAuthorName` | Public publication author | A public display name |
| `comments` | Optional visible comments and nested replies | `[]` or comment objects |
| `searchKeyword` | Keyword that discovered the post | `product strategy` |
| `scrapedAt` | Time the dataset item was written | ISO timestamp |

A post can have several bylines. The main `authorName`, `authorHandle`, and `authorId` fields use the first public byline to keep exports flat. The source's comment counters can exceed the number of visible comments returned anonymously. The comment array reflects the public endpoint response, subject to the configured limit and the source's own visibility rules.

### How to scrape Substack

1. Enter one or more publication homepages, archive pages, or individual post URLs in `urls`. For topic discovery, enter one or more phrases in `keywords` instead of, or alongside, URLs.
2. Set `maxPostsPerNewsletter` for each publication and `maxSearchResultsPerKeyword` for each search phrase. Add `maxItems` when you need a hard total cap across the run.
3. Choose whether to fetch full public content and comments. Set date, type, or free-post filters if you need a narrower export.
4. Run the actor. Open the Dataset tab to inspect the rows, then download JSON, CSV, or Excel. Each row has a canonical post URL for a later refresh or follow-up collection.

For a quick archive inventory, disable `includeContent` and `includeComments`. To collect readable free articles, enable content. To examine discussion, enable comments and choose a modest `maxCommentsPerPost` first, then increase it if useful.

### Input

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `urls` | string array | `[]` | Publication homepages, archive URLs, custom domains, or direct post URLs. |
| `keywords` | string array | `[]` | Phrases to search across public posts. |
| `maxSearchResultsPerKeyword` | integer | `20` | Matching output posts per phrase, up to `100`. |
| `maxPostsPerNewsletter` | integer | `100` | Output posts per publication URL; `0` continues until the archive ends. |
| `maxItems` | integer | `0` | Total output cap across all sources; `0` means no total cap. |
| `includeContent` | boolean | `true` | Fetch post detail and output publicly available free HTML. |
| `includeComments` | boolean | `false` | Request visible comments and nested replies. |
| `maxCommentsPerPost` | integer | `20` | Maximum comments including replies in each output item; `0` keeps all comments returned by the endpoint. |
| `includePublicationInfo` | boolean | `true` | Include public subscriber count, description, and publication author fields. |
| `contentType` | string | `all` | Keep `all`, `newsletter`, `podcast`, or `thread` posts. |
| `startDate` | string | unset | Include posts on or after `YYYY-MM-DD`. |
| `endDate` | string | unset | Include posts on or before `YYYY-MM-DD`. |
| `onlyFree` | boolean | `false` | Keep only posts whose full body is publicly available. |
| `proxyConfiguration` | object | platform proxy | Override the proxy configuration when necessary. |

At least one URL or keyword is required. Dates are inclusive. Archive collection reads newest posts first. Search collection follows the order provided by the public search endpoint. If a post is both in an entered publication and a keyword result, it is emitted once. The first source to emit it determines `searchKeyword`: URL results have `null`, while posts first found by search contain the matching phrase.

A realistic input for a combined archive and discovery run is:

```json
{
  "urls": ["https://www.lennysnewsletter.com"],
  "keywords": ["product strategy"],
  "maxPostsPerNewsletter": 30,
  "maxSearchResultsPerKeyword": 10,
  "includeContent": true,
  "includeComments": false,
  "contentType": "all",
  "onlyFree": false,
  "maxItems": 40
}
```

For a single article, put its `/p/...` URL in `urls`. That yields one post, subject to the filters. An `/archive` URL is treated as the publication archive. A custom domain must point to a public Substack publication and provide its full `https://` address.

### Output example

This is an abridged item from a successful 35-post archive run. Long HTML, image URLs, and public byline fields are omitted here; they remain in the dataset when available.

```json
{
  "postId": 193007895,
  "title": "A visual guide to getting out of a creative slump",
  "slug": "a-visual-guide-to-getting-out-of",
  "url": "https://www.lennysnewsletter.com/p/a-visual-guide-to-getting-out-of",
  "publishedAt": "2026-04-07T12:45:49.978Z",
  "updatedAt": "2026-04-09T01:20:14.391Z",
  "postType": "newsletter",
  "audience": "everyone",
  "isPaid": false,
  "wordcount": 1369,
  "tags": [],
  "reactionCount": 509,
  "commentCount": 11,
  "childCommentCount": 7,
  "restacks": 44,
  "hasVoiceover": true,
  "language": "en",
  "publicationId": 10845,
  "subscriberCount": 1200000,
  "comments": null,
  "searchKeyword": null
}
```

The example is a free post. Its complete dataset item contained a nonempty `bodyHtml`. For paid posts, `bodyHtml` is `null`, and the public `contentPreview` can still be present. A missing `podcastUrl` on a newsletter post is expected. The `comments` field is `null` when comment fetching is disabled; when enabled, it is an array, which may be empty if no comments are publicly returned.

### Use cases

- **Newsletter research:** compare post topics, publication cadence, dates, and engagement across several public newsletters without manually paging through every archive.
- **Editorial tracking:** schedule a short run each day, retain canonical URLs and timestamps, and identify new posts before preparing a reading list.
- **Topic discovery:** search for a phrase across public posts, inspect the resulting publications, and then collect full archives from promising sources.
- **Content analysis:** export free post HTML and word counts for classification, formatting analysis, or a private reading index. Paid bodies stay unavailable.
- **Audience response review:** collect reaction and comment counts, then opt into visible comments for a smaller set of posts where discussion matters.
- **Podcast cataloging:** filter to podcast posts and use `podcastUrl`, title, date, and publication information where the source provides media links.

These workflows use public information. If you need a recurring monitor, keep the input and apply your own post-ID deduplication between scheduled runs; deduplication inside this actor applies within a single run.

### How much does it cost to scrape Substack?

The configured pay-per-result price is **$1.00 per 1,000 output posts**, or $0.001 per dataset item. Billing follows emitted results. A source page that returns no accepted posts does not add dataset items, while a post found through two inputs is emitted once. The run stops adding items when the platform indicates the run budget has been reached.

| Example | Output posts | Result charge |
| --- | ---: | ---: |
| A small newsletter export | 50 | $0.05 |
| Five newsletters with 100 posts each | 500 | $0.50 |
| A broad archive and keyword run | 1,000 | $1.00 |

The figures use the current configured result event price and exclude any separately billed account services or taxes. Check the actor's current pricing before a large run. `maxItems` is the simplest way to bound the number of charged results; `maxPostsPerNewsletter` and `maxSearchResultsPerKeyword` give narrower limits for each source. When several inputs overlap, the final result count can be below the sum of their individual limits.

### Tips for best results

Begin with a publication URL when you know exactly which newsletter you want. The archive route returns posts in reverse chronological order, and the actor requests subsequent public archive pages until it meets your limit or reaches the end. Set `maxPostsPerNewsletter` to `0` only when you actually need the entire public archive; a large archive takes longer and returns more billable rows.

Use keywords when you are finding sources. Search can return results from many publications, with each result mapped to the same output fields as an archive post. `maxSearchResultsPerKeyword` controls accepted output rows, so restrictive date or type filters may require reading additional search pages. Very broad terms can produce changing result order as the source updates its index.

For recent publication monitoring, set `startDate` and a sensible per-publication limit. Archive pages are newest first, so the actor can stop after a page moves below the start date. `endDate` is useful for historical windows. Set both for a bounded interval. The dates compare the first ten characters of the source timestamp, which correspond to the source's ISO calendar date.

Full content requires an additional post detail request for each accepted post. Disabling `includeContent` reduces requests and leaves `bodyHtml` empty while preserving titles, dates, public previews, word counts, and engagement metadata. Enabling comments makes another request per accepted post. Use it for a focused run when you need the discussion itself, and remember that a reported count does not promise that every comment is visible to anonymous readers.

### Limits

The actor reads public data without signing in. It does not access subscriber-only full bodies or bypass a publication paywall. Paid posts still have titles, dates, bylines, preview text, and engagement counters when those fields are public. Even if a page exposes a preview as HTML, the actor leaves `bodyHtml` empty for paid posts so the field consistently means full, freely available content.

Source data varies between publications and post types. Subscriber counts are public reported values and may be rounded, absent, or updated later. Podcasts can omit `podcastUrl`; posts can omit images, tags, subtitles, sections, or update times. The first byline is used for flat author fields. A publication can edit or remove a post after a prior run, so a later export may have different values.

The comments endpoint may return fewer visible comments and replies than the counters shown on a post. Comments can be disabled, restricted, deleted, or unavailable without a subscription. `maxCommentsPerPost` limits the comments actually present in the response; setting it to `0` does not make hidden or unreturned comments available. The actor does not infer missing comments from counts.

The public archive and search endpoints are controlled by the source and may change. If an endpoint fails for one input, the actor logs that input's error and continues with other inputs. The platform's proxy may escalate after repeated blocks, which can increase transfer costs. The golden run used the normal remote route and did not encounter a block.

### Use with automated workflows

The input schema makes this actor available for structured workflows. Example requests:

- “Collect the latest 30 public newsletter posts from this publication URL, including titles, dates, engagement counts, and available free content.”
- “Find 20 posts about product strategy, keep only free newsletter posts, and return their canonical URLs and publication names.”

The result is regular dataset JSON. A workflow can pass publication URLs or keywords and consume the flat fields without parsing a page. When processing results, check `isPaid`, `bodyHtml`, and `contentPreview` separately so a public preview is not mistaken for a complete article.

### FAQ

#### Is it legal to scrape Substack?

This actor collects publicly available pages and endpoints. Whether a particular use is permitted depends on your jurisdiction, the source's terms, and your intended use. Respect copyright and privacy rights, avoid misuse of public commenter information, and seek appropriate advice for regulated or high-volume uses. The actor does not log in or collect subscriber-only content.

#### Do I need to configure proxies?

Usually no. The default configuration uses the platform's available proxy route. The remote golden run returned 35 posts without an anti-bot block. If your publication or region behaves differently, the proxy setting is available. Increased proxy use may change your account's underlying service costs.

#### How fast is a run?

It depends on the number of posts, whether content and comments are enabled, and how the source responds. A 35-post archive run with full free-post content completed in about 35 seconds. An expanded 35-post run with keyword discovery and comments completed in about 79 seconds. Metadata-only runs make fewer requests; large full archives and comment-heavy runs take longer.

#### Can I schedule a newsletter monitor?

Yes. Save the input as a task and schedule it. Use a start date and a moderate per-publication limit to keep each run small. Store `postId` or `url` downstream to identify posts you have already processed across runs.

#### Can I export to a spreadsheet?

Yes. Download the dataset as CSV or Excel, or connect a destination through platform integrations. Arrays such as `tags` and `comments` are easier to preserve in JSON; a spreadsheet export will serialize nested values into cells.

#### Why is `bodyHtml` empty?

The post may require a subscription, content fetching may be disabled, or the source may not provide a full public body. Look at `isPaid` and `contentPreview` to distinguish a paid preview from a free post. The actor deliberately does not include subscriber-only full text.

#### Does an archive URL work differently from a homepage URL?

Both address the same publication archive. A direct `/p/...` URL selects one post, while a homepage or `/archive` URL walks pages until the requested output limit or archive end. Custom domains work when they expose the publication's public page data.

### Use with AI agents (MCP)

Add this actor to any MCP client (Claude, Cursor, VS Code, n8n and others) with one URL:

`https://mcp.apify.com?tools=mlg14/substack-scraper`

The actor returns one dataset item per Substack post (title, date, author, engagement counts, free content, optional comments). Set `maxItems` to keep runs bounded.

**Prompt 1:** "Get the 30 latest posts from Lenny's Newsletter on Substack."

```json
{
  "urls": [
    "https://www.lennysnewsletter.com"
  ],
  "maxPostsPerNewsletter": 30,
  "maxItems": 30
}
```

**Prompt 2:** "Find 20 Substack posts about product strategy."

```json
{
  "keywords": [
    "product strategy"
  ],
  "maxSearchResultsPerKeyword": 20,
  "maxItems": 20
}
```

**Prompt 3:** "Get 10 free posts with 20 comments each from this newsletter."

```json
{
  "urls": [
    "https://www.lennysnewsletter.com"
  ],
  "maxPostsPerNewsletter": 10,
  "onlyFree": true,
  "includeComments": true,
  "maxCommentsPerPost": 20,
  "maxItems": 10
}
```

### Integrations

Use the dataset API to fetch results after a run, or configure a webhook for completion. Scheduled tasks can feed a spreadsheet, a database, or an automation workflow. CSV and Excel suit flat post metadata; JSON preserves arrays and nested comments. Keep a stable post ID in your destination so refreshes update existing records instead of creating duplicates.

### Support

Open an issue on the Issues tab; we reply within 24h and add fields on request.

# Actor input Schema

## `urls` (type: `array`):

Substack publication homepages, archive pages, custom domains or single post URLs, e.g. \["https://www.lennysnewsletter.com"]. Use them to scrape specific newsletters; leave empty when using keywords only.

## `keywords` (type: `array`):

Search public Substack posts by topic, e.g. \["product strategy"]. Use it to discover posts across newsletters; you may combine keywords with URLs, or leave empty.

## `maxSearchResultsPerKeyword` (type: `integer`):

Maximum matching posts to return for each keyword, 1 to 100, e.g. 20. Use a small value for quick keyword research.

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

Maximum posts from each publication URL, e.g. 100. Set 0 to continue until the public archive ends. Use a small value for quick tests.

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

Hard cap across all URLs and keywords, e.g. 200. Set 0 for no total cap. Use it to bound cost on large runs.

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

Fetch post detail and include the full HTML body when public. Allowed values: true or false. Example: true. Use false for faster metadata-only runs; paid posts keep metadata and a preview only.

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

Fetch public comments and nested replies for each post. Allowed values: true or false. Example: false. Use true for sentiment or engagement analysis; it is slower.

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

Maximum public comments including nested replies per post, e.g. 20. Set 0 for all comments the public endpoint returns. Only used when includeComments is true.

## `includePublicationInfo` (type: `boolean`):

Include public subscriber count, description and publication author when available. Allowed values: true or false. Example: true. Use false to keep rows smaller.

## `contentType` (type: `string`):

Only return the selected post type. Allowed values: all, newsletter, podcast, thread. Example: newsletter. Keep all to return every public post type.

## `startDate` (type: `string`):

Include posts on or after this publication date in YYYY-MM-DD format, e.g. 2026-01-01. Use it for date windows; leave empty for no start limit.

## `endDate` (type: `string`):

Include posts on or before this publication date in YYYY-MM-DD format, e.g. 2026-06-30. Use it with startDate; leave empty for no end limit.

## `onlyFree` (type: `boolean`):

Exclude posts whose full content requires a subscription. Allowed values: true or false. Example: true. Use true when you need readable full text for every row.

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

Proxy settings for remote requests. The default uses the Apify platform proxy; change it only if you need your own proxies.

## Actor input object example

```json
{
  "urls": [
    "https://www.lennysnewsletter.com"
  ],
  "keywords": [
    "product strategy"
  ],
  "maxSearchResultsPerKeyword": 20,
  "maxPostsPerNewsletter": 100,
  "maxItems": 0,
  "includeContent": true,
  "includeComments": false,
  "maxCommentsPerPost": 20,
  "includePublicationInfo": true,
  "contentType": "all",
  "onlyFree": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Scraped posts in the default dataset.

# 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 = {
    "urls": [
        "https://www.lennysnewsletter.com"
    ],
    "keywords": [
        "product strategy"
    ]
};

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

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

```

## MCP server setup

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