# Substack Scraper — Newsletter Posts, Likes & Full Text (`jeffev/substack-scraper`) Actor

Scrape posts from any Substack newsletter (substack.com or custom domain): title, date, author, likes, comments, restacks, word count, paid/free flag and the full text of free posts. Date filter and multiple publications per run.

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

## Pricing

from $2.10 / 1,000 post delivereds

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 Scraper — newsletter posts, likes & full text

Scrape the posts of **any Substack newsletter**, on `substack.com` or on its own custom domain: title, subtitle, date, authors, **likes, comments and restacks**, word count, whether it's paid or free, and the **full text of free posts** (public preview for paid ones).

Use it to research what performs in a niche, track competitors' newsletters, build reading datasets or feed newsletter content to AI tools.

### Why this one

- **Custom domains work** (`lennysnewsletter.com`), not only `*.substack.com`.
- **Engagement numbers** for every post: likes (reactions), comments, restacks.
- **Clean text** of free posts, ready for analysis; optional raw HTML.
- **Paid vs free** flag and post type (newsletter, podcast, thread).
- **Date filter** and many publications in one run.
- **Pay per post delivered.** Publications that aren't on Substack are reported, free.

### Input

```json
{
  "publications": ["lennysnewsletter.com", "astralcodexten", "https://www.thefp.com"],
  "maxPostsPerPublication": 100,
  "sinceDate": "2026-01-01",
  "includeContent": true
}
```

### Output (one item per post)

| Field | Description |
|---|---|
| `publicationUrl`, `postId`, `title`, `subtitle`, `url`, `slug` | identity |
| `date`, `postType`, `audience`, `isPaid` | when, what and for whom |
| `authors` | `[{name, handle}]` |
| `reactions`, `comments`, `restacks`, `wordCount` | engagement and length |
| `description`, `coverImage`, `language` | metadata |
| `text`, `contentIsFull`, `preview`, `html` | content (`contentIsFull` is false for paid posts) |

### Example output

One real item from a test run (long texts and lists shortened):

```json
{
  "type": "post",
  "publicationUrl": "https://lennysnewsletter.com",
  "postId": 215694124,
  "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",
  "slug": "all-of-the-lenny-and-friends-summit",
  "date": "2026-09-29T13:15:57.512Z",
  "postType": "newsletter",
  "audience": "everyone",
  "isPaid": false,
  "authors": [
    {
      "name": "Lenny Rachitsky",
      "handle": "lenny"
    }
  ],
  "reactions": 279,
  "comments": 6,
  "restacks": 4,
  "wordCount": 1276,
  "description": "Plus, some reflections and takeaways from the day",
  "coverImage": "https://substack-post-media.s3.amazonaws.com/public/images/9fed347c-0e02-4190-a590-1236719b99de_9213x6142.jpeg",
  "language": "en",
  "preview": "👋 Hey there, I’m Lenny. Each week, I share deeply researched product, growth, and career advice. For more: Lenny’s Jobs | Lennybot | Become an AI-Native Buil...",
  "text": "👋 Hey there, I’m Lenny. Each week, I share deeply researched product, growth, and career advice. For more: Lenny’s Jobs | Lennybot | Become an AI-Native Buil...",
  "contentIsFull": true
}
```

### How much does it cost?

You pay only for results delivered, at a fixed price per item. **Apify platform usage is included** in that price, so there are no compute costs on top. Errors and items that couldn't be found are free.

| What you get | Price | Example |
|---|---|---|
| Post delivered | $0.003 each | 1,000 post delivereds = $3.00 |

The Apify **Free plan includes $5 of monthly credit**, enough for about **1,666 post delivereds** per month at no cost. You can also set a maximum spend per run.

On paid Apify plans it gets cheaper automatically: **10% off on Starter, 20% on Scale and 30% on Business**.

# Actor input Schema

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

One per line: newsletter URL (https://www.lennysnewsletter.com), Substack subdomain (astralcodexten) or name.substack.com.

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

Newest first.

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

Stop at posts older than this date (YYYY-MM-DD).

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

Full text for free posts; paid posts include only the public preview.

## `includeHtml` (type: `boolean`):

Adds the post body HTML (larger output).

## `proxy` (type: `object`):

Used automatically if a publication blocks the server IP.

## Actor input object example

```json
{
  "publications": [
    "lennysnewsletter.com"
  ],
  "maxPostsPerPublication": 50,
  "includeContent": true,
  "includeHtml": false,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

One item per newsletter post with engagement and text.

# 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": [
        "lennysnewsletter.com"
    ],
    "proxy": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

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