# Substack Scraper (`datamole/substack-scraper`) Actor

Collect Substack newsletters in three ways. Full post archives, keyword search across all of Substack, and newsletter discovery with subscriber counts. Get title, date, likes, comments, restacks, authors, paywall status and optional full text and reader comments for each post.

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

## Pricing

from $10.00 / 1,000 result-items

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

![DataMole](https://raw.githubusercontent.com/YoiderD/datamole-assets/main/banner.png)

## 📬 Substack Scraper

> **Three Substack tools in one: full newsletter archives, keyword search across all of Substack, and newsletter discovery with subscriber counts.** Posts come with likes, comments, restacks, authors and paywall status, plus optional full text and reader comments.

**Substack Scraper** reads any Substack newsletter, including custom domains like `lennysnewsletter.com`. Pull a publication's entire archive, search posts across every newsletter on Substack, or find newsletters about a topic and get their **subscriber count, author and description**. It's built for creator research, sponsorship prospecting, content analysis and building text datasets.

| 🎯 Who uses it | 💡 What for |
|---|---|
| Newsletter operators, sponsors and ad buyers, marketers, VCs, researchers, AI teams | Competitor analysis, sponsor and partner prospecting, trend research, content benchmarking, text datasets |

### 📋 What it does

- 📚 **Full archive** of any newsletter, sorted by newest or top posts.
- 🔎 **Post search across all of Substack** by keyword.
- 🧭 **Newsletter discovery.** Find newsletters about a topic and get subscribers, author, description, language and paid-plan status.
- 🔒 **Paywall aware.** Every post shows its audience (free or paid), and you can keep only free or only paid posts.
- 📅 **Date range filter.** Archive paging stops once it passes your start date.
- 📝 **Full text and HTML** of each post (free preview for paid posts).
- 💬 **Reader comments** with author, text, likes, replies and thread depth.

> ℹ️ **Free Apify plan:** runs return a preview of up to 10 results. Any paid Apify plan unlocks the full results.

### 📊 Output

Real post record (trimmed):

```json
{
    "type": "post",
    "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",
    "publishedAt": "2026-09-29T13:15:57.512Z",
    "audience": "everyone",
    "isPaid": false,
    "authors": ["Lenny Rachitsky"],
    "likes": 228,
    "comments": 2,
    "restacks": 2,
    "wordCount": 1276,
    "publicationName": "Lenny's Newsletter",
    "publicationSubscribers": "1.2M+",
    "publicationHasPaidPlans": true,
    "contentText": "👋 Hey there, I'm Lenny. Each week, I share deeply researched product, growth, and career advice...",
    "commentList": [
        { "author": "Justin Wormley", "text": "thank you for existing", "likes": 3, "replies": 0, "depth": 0, "date": "2026-09-29T15:30:12.240Z" }
    ]
}
```

Real newsletter discovery results for `personal finance`:

| Newsletter | Subscribers | Author |
|---|---|---|
| The 5-Minute Finance | 129K+ | Christopher Lewis |
| Finance School | 66K+ | Ankur Tripathi |
| Beyond Your Budget | 10K+ | Michela Allocca |

### ⚙️ Input example

```json
{
    "publications": ["https://www.lennysnewsletter.com", "noahpinion"],
    "searchPosts": ["ai agents"],
    "searchPublications": ["personal finance"],
    "maxPostsPerSource": 200,
    "audience": "free",
    "includeContent": true
}
```

### ✨ Why this one

- ✅ **Three modes in one Actor:** archives, post search and newsletter discovery.
- ✅ **Subscriber counts** for every newsletter, which is what sponsors and analysts actually need.
- ✅ **Custom domains supported.**
- ✅ **Paywall status and filter.**
- ✅ **Polite by design.** Substack rate limits are handled with automatic backoff, so runs finish instead of failing.

### ❓ FAQ

**Can I get the full text of paid posts?** No. Only the free preview that Substack shows publicly.

**Are subscriber counts exact?** Substack shows rounded values like `1.2M+` or `66K+`. Those are returned as shown.

**Do I need a Substack account?** No.

### ⚖️ Disclaimer

This Actor collects publicly available data from Substack. It is not affiliated with Substack. Respect authors' copyright when you reuse content.

# Actor input Schema

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

Substack newsletter URLs (https://name.substack.com or custom domains) or just the subdomain (name).

## `maxPostsPerSource` (type: `integer`):

Stop after this many posts for each publication or post search.

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

Hard cap for the whole run. Leave empty for no cap.

## `searchPosts` (type: `array`):

Keywords to search in posts from every Substack newsletter.

## `searchPublications` (type: `array`):

Keywords to find newsletters. Returns one row per newsletter with author, description and subscriber count.

## `maxPublicationsPerSearch` (type: `integer`):

Limit for newsletter search results.

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

Order used when reading a publication archive.

## `audience` (type: `string`):

Filter by free or paywalled posts.

## `dateFrom` (type: `string`):

Only posts published on or after this date.

## `dateTo` (type: `string`):

Only posts published on or before this date.

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

Adds the full text and HTML of each post. Paid posts only include the free preview.

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

Adds reader comments (author, text, likes, replies, date) to each post.

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

Limit for comments added to each post.

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

Not needed in most cases.

## Actor input object example

```json
{
  "publications": [
    "https://www.lennysnewsletter.com"
  ],
  "maxPostsPerSource": 100,
  "maxPublicationsPerSearch": 20,
  "sort": "new",
  "audience": "all",
  "includeContent": false,
  "includeComments": false,
  "maxCommentsPerPost": 50
}
```

# Actor output Schema

## `results` (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"
    ]
};

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

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

```

## MCP server setup

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