# Substack Newsletter & Posts Scraper (`wyle/substack-scraper`) Actor

Substack scraper to extract newsletter publications, full article text, author profiles, subscriber scales, and post metrics from any Substack URL or keyword search. Exports clean CSV, Excel, JSON, or API for AI and lead workflows.

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

## Pricing

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

Substack scraper to extract newsletter publications, full article content, author profiles, subscriber scales, and post engagement metrics from any Substack URL or keyword search. Automatically converts rich newsletter posts into clean raw HTML, plain text, and structured Markdown ready for AI/RAG pipelines, exporting results instantly to CSV, Excel, JSON, or via API.

***

### Ways to Use

| Mode | Input Field | What You Get |
| :--- | :--- | :--- |
| **Publication Homepage / Archive** | `startUrls` or `publications` | Scrapes all archive posts (sorted by newest, top, or community) with full metadata and body content. |
| **Direct Post / Article URLs** | `startUrls` (`https://.../p/...`) | Scrapes specific Substack articles with complete HTML, plain text, Markdown, word counts, and reactions. |
| **Keyword Discovery Search** | `searchQueries` | Discovers top newsletters matching keywords (e.g. `artificial intelligence`, `fintech`, `venture capital`), including author profiles, subscriber badges, and optionally their recent posts. |
| **Custom Domains** | `startUrls` or `publications` | Fully supports Substack custom domains (e.g. `newsletter.pragmaticengineer.com`, `lennysnewsletter.com`, `astralcodexten.com`). |

***

### Fast vs. Full Article Extraction

| Feature | Fast Metadata Mode (`fetchFullArticle = false`) | Full Article Mode (`fetchFullArticle = true`, Default) |
| :--- | :--- | :--- |
| **Speed** | ⚡ Blazing fast (1 API call per 12 posts) | Fast parallel post hydration |
| **Metadata** | Title, subtitle, author, date, comments, reactions, cover image | Title, subtitle, author, date, comments, reactions, cover image |
| **Body Content** | Post summary / excerpt only | Full raw HTML, clean plain text, and structured Markdown |
| **Metrics** | Comment & reaction counts | Comment count, reaction count, word count, reading time |
| **Media & Audio** | Cover image | Cover image, embedded images, podcast audio URL |
| **Best For** | High-volume newsletter indexing & feed tracking | AI knowledge bases, LLM fine-tuning, RAG, and deep research |

***

### Proxy & Run Tips

- **Direct Connection (Default)**: Substack endpoints are publicly accessible. For most standard runs (under 500 articles), you can keep `useApifyProxy: false` for maximum speed and zero additional proxy cost.
- **Large Bulk Crawls**: When extracting thousands of articles across hundreds of publications, enable **Apify Proxy** (`useApifyProxy: true`) to rotate IP addresses and avoid temporary rate limits.
- **Concurrency**: Default concurrency is set to `4` (range `1–10`). This provides an ideal balance of speed and stability.

***

### Use Cases

1. **AI, LLM & RAG Knowledge Ingestion**: Turn deep-dive essays and industry insights into clean, structured Markdown ready for semantic search, vector databases, or training datasets.
2. **Newsletter & Creator Competitive Intelligence**: Track publication frequency, reader engagement (reactions & comments), and subscriber growth across any niche.
3. **B2B Lead Generation & Outreach**: Extract author names, handles, Twitter usernames, bios, and publication themes to connect with key industry thought leaders.
4. **Market & Trend Research**: Monitor emerging trends across technology, finance, crypto, politics, and culture directly from top independent writers.

***

### Frequently Asked Questions

##### Does this scraper require a Substack account or login?

No. The scraper operates entirely on publicly accessible Substack publications and posts without requiring any user credentials, cookies, or browser automation.

##### Does it support custom domains?

Yes. Substack publications hosting on custom domains (e.g. `newsletter.pragmaticengineer.com`, `lennysnewsletter.com`) are automatically detected and scraped just like regular `*.substack.com` subdomains.

##### How does it handle paid or paywalled posts?

Publicly accessible posts are extracted with their full article content. If a post is paywalled, the scraper extracts all public metadata, author details, preview text, and flags the audience accordingly.

##### What output formats are available?

Data is exported in standardized Apify dataset formats. You can download your data immediately as **JSON, CSV, or Excel**, or consume it programmatically via **Apify REST API**, Python/JavaScript SDKs, or webhook integrations.

***

### Input Parameters

| Field | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `startUrls` | Array | `["https://newsletter.pragmaticengineer.com"]` | List of Substack publication URLs, archive pages, or specific article links (`/p/...`). |
| `publications` | Array | `[]` | List of Substack subdomains (e.g. `["pragmaticengineer"]`) or custom domains. |
| `searchQueries` | Array | `[]` | Keyword queries to discover relevant Substack newsletters (e.g. `["artificial intelligence", "fintech"]`). |
| `sort` | String | `"new"` | Archive post sorting order: `"new"`, `"top"`, or `"community"`. |
| `maxItems` | Integer | `25` | Maximum number of posts or discovered publications to collect per target. |
| `fetchFullArticle` | Boolean | `true` | Extract full post content in raw HTML, plain text, and structured Markdown ready for AI/RAG. |
| `scrapePublicationPosts` | Boolean | `true` | Automatically scrape recent posts for newsletters discovered via `searchQueries`. |
| `maxPostsPerSearchPub` | Integer | `5` | Maximum number of recent posts to scrape per publication found via search. |
| `maxConcurrency` | Integer | `4` | Number of concurrent parallel requests (1 to 10). |
| `proxyConfiguration` | Object | `{"useApifyProxy": false}` | Apify Proxy configuration. Direct connection works for standard runs. |

***

### Sample Output

Every dataset record adheres to a strict **zero-null policy** (empty strings, zero numbers, or empty lists instead of `null`), ensuring seamless downstream database and AI pipeline ingestion.

#### 1. Post Record (`recordType: "post"`)

```json
{
  "recordType": "post",
  "id": "223203725",
  "url": "https://newsletter.pragmaticengineer.com/p/scaling-slack-and-github-with-maude",
  "title": "Scaling Slack and GitHub with Maude Lemaire",
  "subtitle": "Maude Lemaire shares lessons from scaling Slack and GitHub, improving performance at Cursor, and using AI while keeping engineering judgment in human hands.",
  "description": "Maude Lemaire shares lessons from scaling Slack and GitHub, improving performance at Cursor, and using AI while keeping engineering judgment in human hands.",
  "authorName": "Gergely Orosz",
  "authorHandle": "pragmaticengineer",
  "authorBio": "Big Tech and startups from the inside. Especially relevant for software engineers / AI engineers, useful for anyone working in tech.",
  "authorTwitter": "GergelyOrosz",
  "authorPhotoUrl": "https://substack-post-media.s3.amazonaws.com/public/images/58fed27c-f331-4ff3-ba47-135c5a0be0ba_400x400.png",
  "publicationId": "458709",
  "publicationName": "The Pragmatic Engineer",
  "subdomain": "pragmaticengineer",
  "customDomain": "newsletter.pragmaticengineer.com",
  "hostname": "newsletter.pragmaticengineer.com",
  "rankingDetail": "Tens of thousands of paid subscribers",
  "subscriberCount": "",
  "publishedAt": "2026-11-05T15:58:00.148Z",
  "audience": "everyone",
  "reactionCount": 97,
  "commentCount": 1,
  "wordCount": 1399,
  "readingTimeMinutes": 6,
  "coverImageUrl": "https://substack-post-media.s3.amazonaws.com/public/images/5cd802b9-eecc-4029-9fa8-3ba97853bb13_1280x720.png",
  "podcastUrl": "https://api.substack.com/api/v1/audio/upload/de5981ba-a5c9-4ace-8938-1e9f700f15d1/src",
  "bodyHtml": "<p><strong>Listen and watch now on <a href=\"https://youtu.be/x6WqD4qHxSc\">YouTube</a>...</strong></p>",
  "bodyText": "Listen and watch now on YouTube, Apple, and Spotify. See the episode transcript at the top of this page...",
  "bodyMarkdown": "**Listen and watch now on [YouTube](https://youtu.be/x6WqD4qHxSc), [Apple](https://podcasts.apple.com)...**",
  "tags": [],
  "searchQuery": "",
  "position": 1,
  "scrapedAt": "2026-11-16T12:42:12.301245+00:00"
}
```

#### 2. Publication Record (`recordType: "publication"`)

```json
{
  "recordType": "publication",
  "id": "569093",
  "url": "https://offthegridxp.substack.com",
  "title": "Artificial Intelligence Learning 🤖🧠🦾",
  "subtitle": "Michael Spencer",
  "description": "I wanted a place to put some Artificial Intelligence definitions, what is, and how-to short articles to complement my A.I. coverage on A.I. Supremacy and A.I. Survey.",
  "authorName": "Michael Spencer",
  "authorHandle": "aisupremacy",
  "authorBio": "Analyst, curator, researcher and emerging tech observer. Obsessed with future topics such as A.I, robotics, quantum computing, startups, investing, and venture capital.",
  "authorTwitter": "",
  "authorPhotoUrl": "https://substackcdn.com/image/fetch/.../75d1bf99-dcf3-4af6-be2a-416c08c954a1_450x450.jpeg",
  "publicationId": "569093",
  "publicationName": "Artificial Intelligence Learning 🤖🧠🦾",
  "subdomain": "offthegridxp",
  "customDomain": "",
  "hostname": "offthegridxp.substack.com",
  "rankingDetail": "Over 5,000 subscribers · Launched 5 years ago",
  "subscriberCount": "Over 5,000 subscribers",
  "publishedAt": "2021-11-15T20:08:43.091Z",
  "audience": "",
  "reactionCount": 0,
  "commentCount": 0,
  "wordCount": 0,
  "readingTimeMinutes": 0,
  "coverImageUrl": "https://substackcdn.com/image/fetch/.../0bf35ccb-94b4-4eac-a7b3-621a7d4f3198_326x326.png",
  "podcastUrl": "",
  "bodyHtml": "",
  "bodyText": "",
  "bodyMarkdown": "",
  "tags": [],
  "searchQuery": "artificial intelligence",
  "position": 1,
  "scrapedAt": "2026-11-16T12:42:15.540219+00:00"
}
```

***

### Pricing & Cost Examples

Ultra-lightweight HTTP-only execution (`256 MB` default memory, `$0.005` start fee + `$0.0025` per record on Free tier down to `$0.0010` on Gold+ tiers):

| Run Size | Free Plan Estimate | Gold+ Plan Estimate |
| :--- | :--- | :--- |
| `25` newsletter posts | `~$0.07` | `~$0.03` |
| `1,000` full-text Markdown posts | `~$2.51` | `~$1.01` |

***

### API & Automation Integration (Python, Node.js, cURL, AI/RAG, n8n, MCP)

Exports **zero-null** JSON, CSV, and Markdown ready for **LangChain / LlamaIndex**, **n8n**, **Make**, **Clay**, and **Apify MCP**.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("wyle/substack-scraper").call(run_input={
    "startUrls": [{"url": "https://newsletter.pragmaticengineer.com"}],
    "maxItems": 25,
    "fetchFullArticle": True,
})
posts = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(len(posts), posts[0]["title"], posts[0]["wordCount"])
```

#### Node.js

```javascript
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: "<YOUR_APIFY_TOKEN>" });
const run = await client.actor("wyle/substack-scraper").call({
  searchQueries: ["artificial intelligence"],
  maxItems: 20,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, items[0]);
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/wyle~substack-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":[{"url":"https://newsletter.pragmaticengineer.com"}],"maxItems":25}'
```

***

### Related Creator & News Suite by `wyle`

- [`wyle/threads-all-in-one-scraper`](https://apify.com/wyle/threads-all-in-one-scraper) — Track author posts, replies, and engagement across Meta Threads.
- [`wyle/spotify-scraper`](https://apify.com/wyle/spotify-scraper) — Extract creator podcast shows, episodes, and charts without an API key.
- [`wyle/google-news-scraper`](https://apify.com/wyle/google-news-scraper) — Monitor breaking industry coverage with decoded publisher URLs.

# Actor input Schema

## `startUrls` (type: `array`):

List of Substack publication homepages (e.g. https://newsletter.pragmaticengineer.com), archive URLs, or specific article links (/p/...).

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

Optional list of Substack subdomains (e.g. \['pragmaticengineer', 'stratechery']) or custom domains (e.g. \['lennysnewsletter.com']).

## `searchQueries` (type: `array`):

Keywords to discover relevant Substack newsletters and creators (e.g. \['artificial intelligence', 'venture capital', 'fintech']).

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

Sort order for publication archive posts.

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

Maximum number of posts or discovered newsletters to extract per input target.

## `fetchFullArticle` (type: `boolean`):

Fetch the full post page to extract complete article content formatted in raw HTML, clean plain text, and structured Markdown ready for AI/RAG.

## `scrapePublicationPosts` (type: `boolean`):

When newsletters are discovered via Search Queries, automatically scrape their latest posts as well.

## `maxPostsPerSearchPub` (type: `integer`):

Number of recent posts to scrape for each publication found via keyword search.

## `maxConcurrency` (type: `integer`):

Maximum parallel requests (1 to 10).

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

Optional Apify Proxy settings. Direct connection works for most runs; enable for large bulk crawls.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://newsletter.pragmaticengineer.com"
    }
  ],
  "publications": [],
  "searchQueries": [],
  "sort": "new",
  "maxItems": 25,
  "fetchFullArticle": true,
  "scrapePublicationPosts": true,
  "maxPostsPerSearchPub": 5,
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://newsletter.pragmaticengineer.com"
        }
    ],
    "publications": [],
    "searchQueries": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("wyle/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 = {
    "startUrls": [{ "url": "https://newsletter.pragmaticengineer.com" }],
    "publications": [],
    "searchQueries": [],
}

# Run the Actor and wait for it to finish
run = client.actor("wyle/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 '{
  "startUrls": [
    {
      "url": "https://newsletter.pragmaticengineer.com"
    }
  ],
  "publications": [],
  "searchQueries": []
}' |
apify call wyle/substack-scraper --silent --output-dataset

```

## MCP server setup

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