# Substack Scraper — Posts, Full Text, Stats & Comments (`neronbaez/substack-scraper`) Actor

Scrape any Substack newsletter: all posts with full text (free posts), likes, comments, restacks, word count, authors and dates, plus comment threads. Works with custom domains. No login, fast JSON API.

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

## Pricing

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

### What does Substack Scraper do?

It extracts **every post from any Substack newsletter**: title, subtitle, date, authors, **likes, comments, restacks, word count**, paid/free status, cover image and the **full text** of free posts (a preview for paid ones). It can also collect **comment threads** with likes.

It works with `name.substack.com` and with **custom domains** like `lennysnewsletter.com`. It uses Substack's fast JSON API, so you don't need a login and runs are quick and reliable.

### Use cases

- **Content research**: find a newsletter's best-performing posts (sort by *Most popular*)
- **Competitor & creator analysis**: posting frequency, engagement per post, paid vs. free mix
- **LLM / RAG datasets**: clean full text of newsletters
- **Audience research**: what readers say in the comments

### Pricing

| Result | Price |
|---|---|
| Post (with stats and text) | $0.002 |
| Comment | $0.0005 |

🆓 **On Apify's Free plan you can try it practically free** (about $0.01 per 1,000 results). The prices above apply to paid plans.

For example, a newsletter's last 100 posts cost **$0.20**.

### Input example

```json
{ "publications": ["lennysnewsletter.com", "astralcodexten.com"], "maxPostsPerPublication": 100, "sort": "top", "includeComments": true }
```

### Output examples

**Post**

```json
{
  "type": "post",
  "publication": "https://lennysnewsletter.com",
  "id": 219482066,
  "title": "How to tell if a startup has a moat ",
  "subtitle": "A framework for assessing whether the company you’re considering joining is built to last",
  "url": "https://www.lennysnewsletter.com/p/how-to-tell-if-a-startup-has-a-moat",
  "slug": "how-to-tell-if-a-startup-has-a-moat",
  "postDate": "2026-10-13T12:45:41.160Z",
  "audience": "only_paid",
  "isPaid": true,
  "postType": "newsletter",
  "likes": 311,
  "comments": 2,
  "restacks": 11,
  "wordCount": 4153,
  "coverImage": "https://substackcdn.com/image/fetch/$s_!7Uce!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb5a8d5c-1e31-45f5-b9f8-93426e87a971_1456x970.png",
  "authors": [
    {
      "name": "Dan Hockenmaier",
      "handle": "danhock"
    }
  ],
  "contentText": "👋 Hey there, I’m Lenny. Each week, I share deeply researched product, growth, and career advice. For more: Lenny’s Jobs | Lenny’s Podcast | Lennybot | How I AI | Become an AI-Nativ…"
}
```

**Comment**

```json
{
  "type": "comment",
  "publication": "https://lennysnewsletter.com",
  "postId": 215694124,
  "postTitle": "All of the Lenny & Friends Summit talks are now online!",
  "commentId": 349085941,
  "text": "Thank you Lenny for putting this together. It feels amazing to see the world's best product thinkers wrestling with the same questions out loud.",
  "author": "Product Mindset",
  "authorHandle": "productmindset",
  "date": "2026-09-29T23:34:47.245Z",
  "likes": 4,
  "parentId": null
}
```

### Is it legal?

This Actor reads public data from Substack's public API. Respect authors' copyright, and don't republish paid content.

### Feedback

Open an issue in the **Issues** tab. Requests usually ship within a few days.

# Actor input Schema

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

Newsletter URLs or names: lennysnewsletter.com, name.substack.com, https://www.astralcodexten.com

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

Newest first (or by sort).

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

Archive order.

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

Full text of free posts (preview for paid posts) as plain text and HTML.

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

Comments and replies with likes.

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

Per post.

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

Usually not needed.

## Actor input object example

```json
{
  "publications": [
    "lennysnewsletter.com"
  ],
  "maxPostsPerPublication": 50,
  "sort": "new",
  "includeContent": true,
  "includeComments": false,
  "maxCommentsPerPost": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped items as JSON. Add ?format=csv or ?format=xlsx for other formats.

## `overview` (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": [
        "lennysnewsletter.com"
    ]
};

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

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

```

## MCP server setup

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