# Substack Scraper — Newsletter Posts & Authors (`moneygain/substack-newsletter-scraper`) Actor

Extract Substack newsletter content: publication, post titles, authors, dates, summaries and URLs. Works on custom domains, with RSS fallback. Built for media monitoring and content research.

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

## Pricing

from $4.00 / 1,000 verified substack newsletter posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 & Posts Scraper (Fast & Cheap)

**Scrape Substack newsletter articles, authors, podcasts, and reader engagement to JSON, CSV, or Excel in milliseconds without heavy browser overhead.**

Designed specifically for venture analysts, market researchers, content creators, and AI/LLM engineers who require real-time thought leadership feeds, newsletter archives, author bios, and audience reactions at maximum speed and minimum cost.

***

### ⚡ Why Choose This Substack Scraper?

Most legacy Substack scrapers rely on bloated headless browsers (Playwright, Puppeteer, Selenium) that consume 2–4 GB of RAM, suffer frequent timeouts, and cost a fortune to run.

This Actor leverages direct **HTTP TLS impersonation and Substack REST endpoints** to deliver structured newsletter data in under a second on a featherweight **128 MB RAM** footprint.

| Feature | ⚡ This Actor (Direct API) | 🐢 Other Scrapers (Playwright/Chrome) |
| :--- | :--- | :--- |
| **Memory Allocation** | **128 MB RAM** | 2,048 MB – 4,096 MB RAM |
| **Speed per 20 Posts** | **~0.25 seconds** | 15.0 – 35.0 seconds |
| **Compute Cost per 1k Items** | **<$0.0005** | $0.08 – $0.25 |
| **Pay-Per-Event (PPE)** | **$0.005 / item** (10–20% volume discounts) | Expensive monthly subscriptions or heavy compute billing |
| **Custom Substack Domains** | **Native automatic support** (e.g. `lennysnewsletter.com`, `generalist.com`) | Often breaks on custom CNAME redirects |
| **Podcast Extraction** | **Direct MP3 audio link & duration** | Missing / text only |
| **AI Agent & MCP Ready** | **Yes (<1s structured JSON for Claude & Cursor)** | Too slow for real-time agent loops |

***

### 📦 Sample Output JSON

Data is delivered clean, sanitized, and typed according to strict schema specifications:

```json
{
  "id": "224972682",
  "title": "35 premium tools free for a year—now with OpenRouter, LangChain, Sentry, and Ploy 💥",
  "subtitle": "Over $40,000 in value, exclusively for Lenny’s Newsletter subscribers",
  "slug": "35-premium-tools-free-for-a-yearnow",
  "canonicalUrl": "https://www.lennysnewsletter.com/p/35-premium-tools-free-for-a-yearnow",
  "publicationName": "Lenny's Newsletter",
  "publicationSubdomain": "lenny",
  "publicationCustomDomain": "www.lennysnewsletter.com",
  "publicationUrl": "https://www.lennysnewsletter.com",
  "publishedAt": "2026-11-17T18:02:02.477Z",
  "audience": "everyone",
  "wordCount": 1850,
  "reactionsCount": 216,
  "commentsCount": 12,
  "childCommentCount": 4,
  "restacksCount": 18,
  "authorName": "Lenny Rachitsky",
  "authorHandle": "lenny",
  "authorTwitter": "lennysan",
  "authorBio": "Writing Lenny's Newsletter. Former growth product lead at Airbnb.",
  "authorPhotoUrl": "https://substackcdn.com/image/fetch/w_120,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fphoto.jpg",
  "coverImageUrl": "https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbanner.png",
  "podcastUrl": "https://api.substack.com/feed/podcast/12345/episode.mp3",
  "podcastDurationSeconds": 3420.0,
  "tags": [
    "Product Management",
    "Growth",
    "Tech"
  ],
  "contentText": "Today I am thrilled to share an updated directory of 35 complimentary software perks...",
  "contentHtml": ""
}
```

***

### 🎯 High-Value Use Cases

1. **VC & Market Intelligence**: Monitor portfolio startup mentions, sector trends, and emerging product launches across top tech writers (e.g. Lenny Rachitsky, Mario Gabriele, Ben Thompson, Gergely Orosz).
2. **AI & LLM RAG Pipelines**: Ingest complete industry newsletter archives directly into vector databases (Pinecone, Weaviate, Qdrant) to power context-aware domain agents.
3. **B2B Lead Generation & Influencer Outreach**: Extract verified writer names, Twitter/X handles, publication domains, and subscriber tier badges for partnership campaigns.
4. **Content Strategy & SEO Benchmarking**: Identify which article headlines, word counts, and topics generate maximum user comments and viral restacks.
5. **Podcast & Audio Monitoring**: Automatically index MP3 episode audio streams and track podcast durations across Substack audio shows.

***

### 🛠️ Input Parameters

| Field | Type | Description | Default |
| :--- | :--- | :--- | :--- |
| `publications` | `Array of Strings` | Subdomains (e.g. `thegeneralist`, `lenny`) or full URLs (`https://newsletter.pragmaticengineer.com`). | `["thegeneralist"]` |
| `maxItems` | `Integer` | Maximum total articles to extract across publications (1 to 5,000). | `10` |
| `sort` | `String` | Sort order: `"new"` (chronological newest first) or `"top"` (most popular). | `"new"` |
| `searchKeyword` | `String` | Optional keyword filter matching against article title or subtitle. | `""` |
| `includeFullText`| `Boolean` | When true, strips HTML tags and provides clean readable text. | `true` |
| `includeBodyHtml`| `Boolean` | When true, includes the raw HTML body markup of the post. | `false` |

***

### 🤖 AI & No-Code Integrations

#### 1. Claude & Cursor MCP Server

Query Substack articles dynamically in conversation with your coding agents via Apify MCP:

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": ["-y", "@apify/mcp@latest"]
    }
  }
}
```

#### 2. Python Client (`apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run_input = {
    "publications": ["thegeneralist", "lenny"],
    "maxItems": 25,
    "sort": "new"
}

run = client.actor("Archibald322/substack-newsletter-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"[{item['publishedAt'][:10]}] {item['title']} by {item['authorName']}")
```

#### 3. n8n Automation Workflow

A pre-built n8n template is included in the actor's `workflows/n8n_template.json` to stream daily newsletter digests directly into Google Sheets or Slack channels.

***

### 💰 Transparent Pay-Per-Event Pricing

You only pay for clean, verified dataset items extracted:

- **Free Trial**: First sample test run is 100% free!
- **Base Rate**: **$0.005** per article ($5.00 per 1,000 articles).
- **Bronze Tier (>1,000 items)**: **10% Discount** ($0.0045/item).
- **Silver Tier (>10,000 items)**: **15% Discount** ($0.00425/item).
- **Gold Tier (>50,000 items)**: **20% Discount** ($0.0040/item).

***

### ❓ Frequently Asked Questions (FAQ)

##### Q1: Is it legal to scrape Substack?

Yes. This Actor only accesses publicly accessible articles, post metadata, and RSS/API feeds published openly on the web for search engines and readers.

##### Q2: Can it scrape custom domains hosted on Substack?

Yes! Simply paste the custom URL (e.g. `https://www.lennysnewsletter.com` or `https://newsletter.pragmaticengineer.com`) and the scraper automatically queries the underlying Substack publication API.

##### Q3: Does this actor require expensive proxies?

No. Because direct public API endpoints are utilized via Chrome TLS impersonation, datacenter proxies or zero-proxy connections operate with 100% success.

##### Q4: What happens if an article is behind a paid paywall?

Substack exposes the article title, subtitle, author bylines, cover art, engagement metrics, and a preview snippet. For public/free posts, the complete body text is extracted.

##### Q5: How fast is this scraper?

Batches of 20 posts are retrieved in approximately 200–300 milliseconds. Scraping 100 articles takes under 2 seconds.

***

### 🔗 Explore More High-Speed B2B Scrapers & Enrichers by Our Team

| Actor Name | Best For | Architecture | Pricing (PPE) |
| :--- | :--- | :--- | :--- |
| [Ashby Jobs Scraper](https://apify.com/Archibald322/ashby-jobs-scraper) | AI Startup & Tech Careers Feeds | Zero-Browser API (128 MB) | $0.005 / item |
| [Greenhouse Jobs Scraper](https://apify.com/Archibald322/greenhouse-jobs-scraper) | Enterprise Career Vacancies | Direct REST (128 MB) | $0.005 / item |
| [Lever Jobs Scraper](https://apify.com/Archibald322/lever-jobs-scraper) | High-Growth Tech Vacancies | Direct REST (128 MB) | $0.005 / item |
| [RemoteOK Jobs Scraper](https://apify.com/Archibald322/remoteok-jobs-scraper) | Global Remote Jobs & Salaries | Direct REST (128 MB) | $0.005 / item |
| [Wellfound Jobs Scraper](https://apify.com/Archibald322/wellfound-jobs-scraper) | Tech Talent & Startup Salaries | GraphQL / `__NEXT_DATA__` | $0.005 / item |
| [Y Combinator Startups Scraper](https://apify.com/Archibald322/ycombinator-startups-scraper) | 6,400+ YC Companies & Founders | Algolia DSN (128 MB) | $0.005 / item |
| [Hugging Face Models Scraper](https://apify.com/Archibald322/huggingface-models-scraper) | 1M+ AI LLMs & Datasets | Hub REST API (128 MB) | $0.005 / item |
| [TrustMRR Startups Scraper](https://apify.com/Archibald322/trustmrr-startups-scraper) | Verified SaaS Revenue & MRR | `__NEXT_DATA__` (128 MB) | $0.005 / item |
| [Clutch Agencies Scraper](https://apify.com/Archibald322/clutch-agencies-scraper) | B2B Agencies & Client Reviews | Fast HTTP Scraper | $0.008 / item |

# Actor input Schema

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

List of Substack publication subdomains (e.g. 'thegeneralist', 'lenny') or full URLs (e.g. 'https://newsletter.pragmaticengineer.com').

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

Maximum number of total posts to extract across all publications.

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

Sort order of publication posts.

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

Optional keyword to filter posts by matching in the title or subtitle.

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

Include clean, readable plain text of post content (HTML tags stripped).

## `includeBodyHtml` (type: `boolean`):

Include raw HTML markup of post body. Set to false to reduce dataset storage size.

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

Select proxies to be used by your Actor. Apify Proxy automatically routes requests through clean IP addresses.

## Actor input object example

```json
{
  "publications": [
    "www.lennysnewsletter.com"
  ],
  "maxItems": 5,
  "sort": "new",
  "includeFullText": true,
  "includeBodyHtml": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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": [
        "www.lennysnewsletter.com"
    ],
    "maxItems": 5,
    "sort": "new",
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("moneygain/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": ["www.lennysnewsletter.com"],
    "maxItems": 5,
    "sort": "new",
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("moneygain/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": [
    "www.lennysnewsletter.com"
  ],
  "maxItems": 5,
  "sort": "new",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call moneygain/substack-newsletter-scraper --silent --output-dataset

```

## MCP server setup

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