# \[DEPRECATED] Substack Scraper: Posts, Comments, Reactions + Sen (`dltik/substack-scraper`) Actor

Scrape any Substack publication: full post text, comments, replies, reactions, restacks. Built-in sentiment scoring on every item. Multi-publication batch, date filter, audience filter (free/paid/founding). For creator economy research, brand monitoring, PR. $3/1K posts + $5/1K comments.

- **URL**: https://apify.com/dltik/substack-scraper.md
- **Developed by:** [Walid](https://apify.com/dltik) (community)
- **Categories:** AI, Marketing, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Substack Scraper — Posts, Comments, Reactions + AFINN-165 Sentiment

> Scrape any **Substack publication**: full post text, comments, nested replies, reactions, restacks. **Built-in AFINN-165 sentiment analysis** on every post and comment — no external API. Multi-publication batch, date filter, audience filter (free/paid/founding). HTTP-only, **$0.003 per post / $0.005 per comment** — the cheapest, cleanest way to monitor newsletters at scale.

⭐ **Bookmark this Substack Scraper** — Apify ranks actors by bookmarks, so it directly helps the visibility of this scraper on the Apify Store.

### What is the Substack Scraper?

The **Substack Scraper** is an Apify actor that pulls structured data from any [Substack](https://substack.com/) publication. Drop in a publication URL and get back the full post archive — body text, comments (with full nested reply tree), reactions count, restacks count, paywall status, audience tier (free/paid/founding-only). Every post and every comment is sentiment-scored on the fly using the AFINN-165 lexicon with negation handling.

The cheapest, cleanest way to monitor the creator economy at scale: track newsletters in your space, surface high-engagement posts, run brand-mention monitoring across hundreds of Substacks at once.

### Use cases

- **Creator-economy research** — track top Substacks in your sector, their post velocity, engagement.
- **Brand monitoring** — alert on every Substack post mentioning your brand + sentiment.
- **Competitive intelligence** — analyze a competitor's full post archive for content strategy.
- **PR / journalism** — find which Substacks cover your industry; monitor for new mentions.
- **AI training data** — Substack is high-quality long-form content, labeled with reactions and comments — perfect for RLHF.
- **Newsletter benchmarking** — compare engagement (reactions/comments) across Substacks of similar size.
- **Content research** — find which post topics drove the most subscriber growth (by audience-tier mix).

### Input

```json
{
  "publications": [
    "https://example1.substack.com/",
    "https://example2.substack.com/"
  ],
  "since": "2026-01-01",
  "includeComments": true,
  "audienceTiers": ["free", "paid"]
}
```

### Output

```json
{
  "publication": "example1.substack.com",
  "post_id": "12345678",
  "url": "https://example1.substack.com/p/example-post",
  "title": "Why MCP servers are the future of AI agents",
  "author": "Example Author",
  "published_at": "2026-04-25",
  "audience_tier": "free",
  "body_text": "Full post body text...",
  "reactions": 423,
  "restacks": 87,
  "comments_count": 34,
  "sentiment": "positive",
  "sentiment_score": 0.38
}
```

### Pricing

**PAY\_PER\_EVENT — $0.003 per post + $0.005 per comment**. Sentiment analysis included free.

### FAQ — Substack API alternatives

**Substack official API?** No public API. This scraper is the way to get structured data at scale.

**Paywall content — does it scrape paid posts?** Public preview only (the same content non-subscribers see). Full paid post text requires a logged-in cookie.

**Why AFINN-165 sentiment?** Fast, deterministic, runs in microseconds per item, no GPU. For deeper semantic sentiment, run downstream on the dataset.

**How fast for bulk?** ~5-10 posts/sec, ~20 comments/sec per actor instance. For 100 publications × 1K posts each, run 4 concurrent actor runs.

***

⭐ **Found this useful? Bookmark this Substack Scraper** — it's the strongest signal for Apify Store ranking.

#### Related actors

- [Reddit Scraper — Posts + Sentiment](https://apify.com/dltik/reddit-scraper) — same sentiment engine for Reddit
- [Trustpilot Scraper — Reviews + Sentiment](https://apify.com/dltik/trustpilot-scraper) — same sentiment engine for reviews
- [Amazon Reviews Scraper](https://apify.com/dltik/amazon-reviews-scraper) — same sentiment engine for Amazon

License: MIT · Author: [dltik](https://apify.com/dltik)

- [RedNote Xiaohongshu Scraper](https://apify.com/dltik/rednote-xiaohongshu-scraper) - China's #1 lifestyle platform
- [TikTok Scraper](https://apify.com/dltik/tiktok-scraper) - Profiles, videos, hashtags, trending

# Actor input Schema

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

Substack publications. ⚠️ Many top publications use CUSTOM DOMAINS (Substack Pro feature) — Lenny's, Slow Boring, Astral Codex Ten etc. moved off .substack.com. Format: 'mattstoller' (subdomain → mattstoller.substack.com), 'lennysnewsletter.com' (custom domain), or full URL 'https://www.astralcodexten.com/'.

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

Maximum number of posts to scrape per publication.

## `fetchFullBodies` (type: `boolean`):

Fetch the full body\_html for each post. Costs +1 request per post but unlocks full text + sentiment analysis.

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

Fetch comments for each post. Free posts only — paid posts return no comments. Costs +1 request per post.

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

Cap comments returned per post (incl. nested replies).

## `sortBy` (type: `string`):

new = chronological (newest first), top = most popular.

## `searchKeyword` (type: `string`):

Filter posts by keyword (Substack-side search).

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

Only posts published after this ISO date (e.g. '2026-01-01'). Skipped posts stop the scrape.

## `audienceFilter` (type: `string`):

Restrict to free / paid / founding posts.

## `computeSentiment` (type: `boolean`):

Run AFINN-165 sentiment analysis on each post and comment. No external API.

## `proxyConfig` (type: `object`):

Optional Apify proxy. Substack rarely blocks — only useful if you hit rate limits on heavy runs.

## Actor input object example

```json
{
  "publications": [
    "mattstoller",
    "lennysnewsletter.com"
  ],
  "maxPostsPerPublication": 30,
  "fetchFullBodies": true,
  "includeComments": false,
  "maxCommentsPerPost": 100,
  "sortBy": "new",
  "computeSentiment": true,
  "proxyConfig": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Substack records.

# 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": [
        "mattstoller",
        "lennysnewsletter.com"
    ]
};

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

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

```

## MCP server setup

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