# Substack Newsletter Scraper: Posts, Full Text & Leaderboards (`tommyonebig/substack-newsletter-scraper`) Actor

Scrape any Substack newsletter: posts with full text in Markdown, likes, comments, authors and paywall status, plus newsletter profiles with subscription prices and category leaderboards. No login needed.

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

## Pricing

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

### What does Substack Newsletter Scraper do?

**Substack Newsletter Scraper** extracts public data from any [Substack](https://substack.com) newsletter, including those on custom domains. In one run you can collect:

- **Posts** with title, subtitle, URL, publish date, authors, paywall status, word count, likes, comments and restacks
- **Full post text** in **Markdown** (ready for AI, RAG and LLM pipelines), plain text or original HTML
- **Newsletter profiles** with author, creation date, language, **subscription prices** (monthly, yearly and founding plans), bestseller tier and subscriber ranking where Substack shows it
- **Category leaderboards** (Finance, Technology, Business, Politics, Culture and 25+ more) to **discover the top newsletters** in a niche, with their rank

It runs on the Apify platform, so you get API access, scheduling, webhooks and integrations (Google Sheets, Make, Zapier, n8n and more) with no setup.

### Why scrape Substack?

- **Content research and monitoring**: track what the leading writers in your industry publish and which posts get the most engagement.
- **AI and RAG**: turn a newsletter archive into clean Markdown for chatbots, summarizers and knowledge bases.
- **Newsletter sponsorships and partnerships**: build a list of the top newsletters in a category, with pricing and bestseller status, to find sponsorship or cross-promotion partners.
- **Market and pricing research**: compare subscription prices and paid-plan adoption across a niche.
- **Competitor analysis**: see how often competitors publish, what they write about and how readers respond.

### How to use it

1. Enter one or more newsletters: a handle (`lenny`), a Substack address (`lenny.substack.com`), a custom domain (`https://www.lennysnewsletter.com`) or a single post URL.
2. *(Optional)* Choose leaderboard categories to discover newsletters instead.
3. Set how many posts you want, and turn on **Include full post text** if you need the article body.
4. Click **Start**, then download your data as JSON, CSV, Excel or HTML, or fetch it with the API.

### Input example

```json
{
  "newsletters": ["https://www.lennysnewsletter.com", "noahpinion"],
  "maxPostsPerNewsletter": 50,
  "sort": "new",
  "includeContent": true,
  "contentFormat": "markdown",
  "dateFrom": "2026-01-01"
}
```

Discover the top paid Finance and Technology newsletters:

```json
{
  "categories": ["finance", "technology"],
  "leaderboard": "paid",
  "maxPublicationsPerCategory": 100
}
```

### Output example

Post:

```json
{
  "type": "post",
  "newsletterName": "Astral Codex Ten",
  "newsletterUrl": "https://www.astralcodexten.com",
  "title": "An Open Letter To Steven Pinker On AI",
  "url": "https://www.astralcodexten.com/p/an-open-letter-to-steven-pinker-on",
  "publishedAt": "2026-10-06T21:23:06.574Z",
  "postType": "newsletter",
  "audience": "everyone",
  "isPaywalled": false,
  "authors": ["Scott Alexander"],
  "wordCount": 10483,
  "reactionCount": 1037,
  "commentCount": 875,
  "restackCount": 177,
  "language": "en",
  "content": "Dear Steven:\n\nEarlier this month, frustrated by some of your social media posts, ...",
  "contentFormat": "markdown",
  "contentIsPreview": false
}
```

Newsletter profile or leaderboard entry:

```json
{
  "type": "publication",
  "rank": 1,
  "category": "Finance",
  "name": "Example Finance Weekly",
  "url": "https://example.substack.com",
  "authorName": "Jane Writer",
  "createdAt": "2021-03-01T12:00:00.000Z",
  "language": "en",
  "paymentsEnabled": true,
  "plans": [
    { "planId": "monthly8usd", "interval": "month", "amount": 8.0, "currency": "USD" },
    { "planId": "yearly80usd", "interval": "year", "amount": 80.0, "currency": "USD" }
  ],
  "bestsellerTier": 100,
  "subscriberRanking": "Thousands of paid subscribers"
}
```

The dataset has two ready-made views: **Posts** and **Newsletters**.

### How much does it cost?

You pay only for what you get:

| Event | Price |
|---|---|
| Run start | $0.01 |
| Post (metadata) | $0.008 (**$8 per 1,000 posts**) |
| Post with full text | $0.015 (**$15 per 1,000 posts**) |
| Newsletter profile or leaderboard entry | $0.02 |

For example, 100 posts with full Markdown text cost about $1.50, and the top 50 newsletters in a category cost about $1. You can cap any run with Apify's **maximum cost per run** setting, and the scraper stops cleanly when the cap is reached.

### Tips

- Use **Most popular first** to get a newsletter's best-performing posts.
- Use **Published on or after** to fetch only new posts on a schedule (for example, daily).
- Set **Max posts per newsletter** to `0` to download the whole archive.
- Paywalled posts include only the free preview Substack shows publicly. They're flagged with `isPaywalled` and `contentIsPreview`.

### FAQ

**Can it scrape paywalled posts?**
No. It collects only publicly available data. For paid posts you get metadata and the public preview.

**Does it collect comments or reader profiles?**
No. To respect readers' privacy, it doesn't collect comments, Notes or subscriber profiles.

**Do I need a Substack account or API key?**
No.

**Is scraping Substack legal?**
This scraper collects only public information that anyone can see in a browser. You're responsible for how you use the data. Make sure your use complies with Substack's terms, copyright and privacy laws such as GDPR. Don't republish full articles without the author's permission.

**Something isn't working?**
Open an issue on the **Issues** tab and include the run link. Issues are usually fixed within a few days.

# Actor input Schema

## `newsletters` (type: `array`):

Substack newsletters to scrape. Accepts a handle (<code>lenny</code>), a Substack address (<code>lenny.substack.com</code>), a custom domain (<code>https://www.lennysnewsletter.com</code>) or a single post URL (<code>.../p/post-slug</code>).

## `categories` (type: `array`):

Discover newsletters from Substack's category leaderboards (e.g. Finance, Technology). Each publication comes with its ranking, author, subscription prices and bestseller tier.

## `leaderboard` (type: `string`):

Which Substack leaderboard to read for the selected categories.

## `maxPublicationsPerCategory` (type: `integer`):

How many newsletters to take from each category leaderboard.

## `maxPostsPerNewsletter` (type: `integer`):

How many posts to collect from each newsletter. Use 0 for the full archive.

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

Newest posts first, or the newsletter's most popular posts first.

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

Adds the full article body. For paywalled posts only the free preview is available (flagged with contentIsPreview).

## `contentFormat` (type: `string`):

Format of the post text when 'Include full post text' is on.

## `searchQuery` (type: `string`):

Only return posts matching this keyword (uses each newsletter's own archive search).

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

Only posts published on or after this date.

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

Only posts published on or before this date.

## `freeOnly` (type: `boolean`):

Skip paywalled posts.

## `postTypes` (type: `array`):

Leave empty for all types.

## `includePublicationInfo` (type: `boolean`):

Adds one record per newsletter with author, prices, bestseller tier and creation date.

## Actor input object example

```json
{
  "newsletters": [
    "https://www.lennysnewsletter.com"
  ],
  "leaderboard": "all",
  "maxPublicationsPerCategory": 50,
  "maxPostsPerNewsletter": 20,
  "sort": "new",
  "includeContent": false,
  "contentFormat": "markdown",
  "freeOnly": false,
  "includePublicationInfo": true
}
```

# Actor output Schema

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

Scraped posts (one record per post).

## `publications` (type: `string`):

Newsletter profiles and leaderboard entries.

## `all` (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 = {
    "newsletters": [
        "https://www.lennysnewsletter.com"
    ]
};

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

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

```

## MCP server setup

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