# Substack Posts Scraper: Full Text, Likes & Comments (`decentralizer/substack-posts`) Actor

Posts from any public Substack newsletter, custom domains included: title, date, free or paid, likes, comments, word count and the full text of free posts as Markdown.

- **URL**: https://apify.com/decentralizer/substack-posts.md
- **Developed by:** [michael regeer](https://apify.com/decentralizer) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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 Posts Scraper: Full Text, Likes & Comments

Posts from any public Substack newsletter in one clean dataset: title, subtitle, date, free or paid, likes, comments, restacks, word count, cover image and the **full text of free posts as Markdown**. Works with `*.substack.com` addresses and with custom domains such as `lennysnewsletter.com`.

### What you can do with it

- **Content research:** which topics and formats get the most likes and comments in your niche?
- **Newsletter monitoring:** run it daily with **Published on or after** set and send new posts from the writers you follow to Slack, Notion or a sheet.
- **AI and RAG pipelines:** clean Markdown of free posts, ready to embed, summarise or quote with a link back.
- **Competitor and sponsor research:** how often does a newsletter publish, how much is paywalled, how long are the posts?

### Input

| Field | What it does |
|---|---|
| Publications | One per line: `lenny.substack.com`, `https://www.lennysnewsletter.com`, `astralcodexten`, `@noahpinion` or a single post link (`.../p/post-name`). |
| Maximum posts per publication | Newest first (default 10). |
| Published on or after / before | Only posts from this period. |
| Include post text | Markdown text: the whole post for free posts, the public preview for paid ones. Switch off for metadata only. |
| Add a summary per publication | One extra item per publication with its name, tagline, logo and averages over the posts read. |
| Maximum items | Stops the run after this many items. |

### Output

One item per post:

```json
{
    "type": "post",
    "publicationName": "Astral Codex Ten",
    "publicationUrl": "https://www.astralcodexten.com",
    "postId": 224550256,
    "title": "AI Company Employees Should Unionize",
    "subtitle": "...",
    "url": "https://www.astralcodexten.com/p/ai-company-employees-should-unionize",
    "postType": "newsletter",
    "publishedAt": "2026-11-12T23:09:15.486Z",
    "audience": "free",
    "isPaywalled": false,
    "authors": ["Scott Alexander"],
    "reactionCount": 328,
    "commentCount": 227,
    "restackCount": 35,
    "wordCount": 1273,
    "language": "en",
    "coverImage": "https://substack-post-media.s3.amazonaws.com/public/images/de52244f-534f-4b9b-8d91-933b36ddc16a_736x392.png",
    "text": "**I.**\n\nShould safety-conscious employees at AI companies quit in protest, or stay and fight? ...",
    "textIsPreview": false
}
```

With **Add a summary per publication** switched on, one extra item per publication:

```json
{
    "type": "publication",
    "publicationName": "Lenny's Newsletter",
    "publicationUrl": "https://www.lennysnewsletter.com",
    "subdomain": "lenny",
    "customDomain": "www.lennysnewsletter.com",
    "description": "Deeply researched product, growth, and career advice for product leaders, founders, and ambitious builders.",
    "postsRead": 4,
    "freePosts": 1,
    "paidPosts": 3,
    "latestPostAt": "2026-11-10T15:04:03.497Z",
    "averageReactions": 376,
    "averageComments": 16,
    "averageWordCount": 2593
}
```

Use the **Posts** and **Publications** views of the dataset, or filter on `type`.

### Pricing

You pay per item saved: per post, and per publication summary if you switch summaries on. Publications that are not found cost nothing. Set **Maximum items** or a spending limit on the run to cap the cost.

### Good to know

- **Paid posts:** you get everything a logged-out reader sees: title, subtitle, counts, word count of the whole post and the public preview as `text`, with `isPaywalled` and `textIsPreview` set to `true`. The paid part is never read.
- **Public data only.** No subscriber lists, no email addresses, no comment authors. The byline names are included because they are printed on every post.
- `reactionCount` is the total of all reactions (hearts and others); `reactions` breaks it down per emoji.
- Posts are read newest first; with a start date the run stops as soon as it reaches older posts, so scheduled runs are fast.
- Substack limits how fast it can be read. The scraper paces itself and waits when asked to; about 1 to 2 seconds per post with text, much less without.
- A publication that does not exist or is not on Substack is skipped with a note in the log; the others carry on.
- Not affiliated with Substack.

### Questions or a missing field?

Open an issue on the Issues tab.

# Actor input Schema

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

One per line: a Substack address (lenny.substack.com), a custom domain (https://www.lennysnewsletter.com), a bare name (astralcodexten), a writer's @handle (@noahpinion) or a single post link (.../p/post-name).

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

Newest posts first.

## `publishedAfter` (type: `string`):

Only posts from this date on (YYYY-MM-DD). Use with a schedule to collect new posts only.

## `publishedBefore` (type: `string`):

Only posts up to this date (YYYY-MM-DD).

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

Adds the post text as Markdown: the whole post for free posts, the public preview for paid ones. Switch off for faster runs with metadata only.

## `includePublicationSummary` (type: `boolean`):

Adds one extra item per publication: name, description, logo, how many of the posts read were free or paid, and average likes, comments and length.

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

Stop after this many items (posts plus summaries). You are charged per item saved.

## Actor input object example

```json
{
  "publications": [
    "https://www.lennysnewsletter.com",
    "astralcodexten"
  ],
  "maxPostsPerPublication": 10,
  "includeFullText": true,
  "includePublicationSummary": false,
  "maxItems": 100
}
```

# Actor output Schema

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

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("decentralizer/substack-posts").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",
        "astralcodexten",
    ] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,decentralizer/substack-posts"
        }
    }
}
```

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/cWVcwIEeEROXppm0t/builds/QmRB4x0NKiLtFJreQ/openapi.json
