# Substack Scraper - Newsletter Posts, Likes & Stats (`rasareka/substack-scraper`) Actor

Scrape Substack newsletter posts from any publication or custom domain: titles, dates, likes, comments, restacks, paywall status, authors, tags, podcasts and full text of free posts. Free per-publication stats: posting frequency, avg engagement, top posts, paid vs free share.

- **URL**: https://apify.com/rasareka/substack-scraper.md
- **Developed by:** [Rasa Reka](https://apify.com/rasareka) (community)
- **Categories:** News, Social media
- **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 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

## Substack Scraper - Newsletter Posts, Likes & Stats

Scrape **Substack newsletter posts** from any publication, on a `*.substack.com` subdomain or a custom domain. For each post you get the title, date, likes, comments, restacks, paywall status, authors, tags and podcast info. You can also get the **full text of free posts**. Every run also saves **free per-publication stats**: posting frequency, average engagement, top posts and the paid vs free share.

### What you get

- Title, subtitle, slug, URL and publish date
- **Likes** (reactions), **comments** and **restacks**
- Audience (`everyone`, `only_paid`, `founding`, `only_subscribers`) and an `isPaywalled` flag
- Post type: `newsletter`, `podcast` or `thread`
- Word count, cover image, description, public preview text, tags, section and language
- Authors with name, Substack handle and guest flag
- Podcast audio URL and duration (seconds) for podcast posts
- Optional **full text of free posts**, as plain text (`content`) and markdown (`contentMarkdown`)
- **Free PUBLICATIONS summary** for each newsletter (see below)

### Why this Actor

| | This Actor |
|---|---|
| Input | Subdomain (`lenny`), `lenny.substack.com`, a custom domain or any post URL |
| Custom domains | Yes (e.g. lennysnewsletter.com, noahpinion.blog) |
| Sort | Newest first or Substack's "top" posts |
| Date filter | Yes, `dateFrom` |
| Full text | Free posts only, as text + markdown |
| Publication stats | **Included free** (frequency, avg likes/comments, top 10 posts, paid share) |
| Speed | 200 posts from 2 newsletters in about 5 seconds (local test) |
| Login / cookies / proxies | Not needed |

### Use cases

- **Newsletter research:** compare how often top newsletters in your niche publish and what gets the most likes and comments
- **Content strategy:** find the topics, formats and lengths that perform best, and how much each writer keeps behind the paywall
- **Sponsorship prospecting:** build a list of active newsletters with real engagement numbers before you pitch a sponsorship
- **AI training on your own reading list:** pull the full text of free posts from the newsletters you read into your notes, search index or RAG pipeline

### Input example

```json
{
  "publications": [
    "https://www.lennysnewsletter.com",
    "https://www.noahpinion.blog",
    "garymarcus.substack.com"
  ],
  "postUrls": ["https://www.lennysnewsletter.com/p/all-of-the-lenny-and-friends-summit"],
  "maxPostsPerPublication": 100,
  "sort": "new",
  "includeContent": false,
  "dateFrom": "2026-01-01"
}
```

All fields are optional. With an empty input, the Actor scrapes the 20 newest posts of Lenny's Newsletter as a demo.

### Output example (one post, real data from a test run)

```json
{
  "publication": "www.lennysnewsletter.com",
  "publicationName": "Lenny's Newsletter",
  "postId": 215694124,
  "title": "All of the Lenny & Friends Summit talks are now online!",
  "subtitle": "Plus, some reflections and takeaways from the day",
  "slug": "all-of-the-lenny-and-friends-summit",
  "url": "https://www.lennysnewsletter.com/p/all-of-the-lenny-and-friends-summit",
  "postDate": "2026-09-29T13:15:57.512Z",
  "audience": "everyone",
  "isPaywalled": false,
  "type": "newsletter",
  "wordCount": 1276,
  "reactionCount": 294,
  "commentCount": 9,
  "childCommentCount": 9,
  "restacks": 6,
  "authors": [{ "name": "Lenny Rachitsky", "handle": "lenny", "isGuest": false }],
  "coverImage": "https://substack-post-media.s3.amazonaws.com/public/images/9fed347c-0e02-4190-a590-1236719b99de_9213x6142.jpeg",
  "description": "Plus, some reflections and takeaways from the day",
  "previewText": "👋 Hey there, I’m Lenny. Each week, I share deeply researched product, growth, and career advice. ...",
  "podcastUrl": null,
  "podcastDuration": null,
  "tags": [],
  "sectionName": null,
  "language": "en",
  "scrapedAt": "2026-11-07T01:34:44.483Z"
}
```

With `includeContent: true`, free posts also get `content` (plain text) and `contentMarkdown` (headings, links, bold/italic, lists, quotes and images). Export to JSON, CSV or Excel, or connect to Google Sheets, Make, Zapier, n8n or your own code through the Apify API.

### Free publication stats

Open the run's **Storage → Key-value store → PUBLICATIONS** record. For each publication you get (excerpt from a real run of 100 posts):

```json
{
  "publication": "www.lennysnewsletter.com",
  "publicationName": "Lenny's Newsletter",
  "postCount": 100,
  "firstPostDate": "2024-09-10T11:03:25.412Z",
  "lastPostDate": "2026-11-03T14:45:33.089Z",
  "postsPerMonth": 3.84,
  "avgLikes": 388.9,
  "avgComments": 18.4,
  "avgRestacks": 25.4,
  "avgWordCount": 3156,
  "freePosts": 24,
  "paidPosts": 76,
  "freeShare": 0.24,
  "paidShare": 0.76,
  "postsByType": { "newsletter": 100 },
  "topTags": [{ "tag": "AI", "count": 31 }, { "tag": "Career", "count": 26 }],
  "topPostsByLikes": [
    {
      "title": "How to turn your AI into a world-class designer",
      "url": "https://www.lennysnewsletter.com/p/how-to-turn-your-ai-into-a-world",
      "reactionCount": 1291,
      "commentCount": 24,
      "restacks": 100,
      "audience": "only_paid"
    }
  ]
}
```

The stats are computed from the posts collected in the run, so raise `maxPostsPerPublication` for a longer history. Inputs that could not be scraped (not a Substack site, post not found) are listed in the **FAILED** record and are never charged.

### Pricing

You pay only for posts that are saved to your dataset. Failed inputs and the PUBLICATIONS stats are free. You can set a maximum cost per run in the run options, and the Actor stops cleanly when it is reached.

### Limits (please read)

- **No paywalled content, ever.** The Actor reads only what Substack's public API returns without a login. Paid and subscriber-only posts come with their public metadata and preview only. `content` is filled only for posts whose audience is `everyone`.
- Publication search (finding newsletters by keyword) is not supported. Give the newsletter's address.
- Likes, comments and restacks are the counts Substack shows at the time of the run.
- The Actor waits about 0.5 seconds between requests to stay polite, so very large archives (thousands of posts) take a few minutes. `includeContent` adds one request per free post.

### FAQ

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

**Does it work with custom domains?** Yes. Any Substack publication works, on `name.substack.com` or its own domain.

**Can it get the full text of paid posts?** No. Paid content is not public and this Actor does not log in or get around the paywall.

**Is scraping Substack legal?** This Actor reads publicly available data only. You are responsible for how you use it, including copyright (post text belongs to its authors) and privacy laws such as GDPR when handling author names.

**Something broken or a feature missing?** Open an issue on the Issues tab. We usually reply within 24 hours.

# Actor input Schema

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

Substack publications to scrape. Accepts a subdomain ("lenny"), "lenny.substack.com", a custom domain ("https://www.lennysnewsletter.com") or any post URL from the publication.

## `postUrls` (type: `array`):

Optional. Individual post URLs (e.g. https://www.noahpinion.blog/p/some-post). Each is scraped once, in addition to the publications above.

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

Stop after this many posts for each publication.

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

"new" = newest first (use with Date from). "top" = Substack's most popular posts first.

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

Fetch the full body of free (audience = everyone) posts as plain text and markdown. Paid posts are never unlocked: they only get the public preview fields. Adds one request per free post.

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

Optional. Only posts published on or after this date (YYYY-MM-DD).

## Actor input object example

```json
{
  "publications": [
    "https://www.lennysnewsletter.com",
    "https://www.noahpinion.blog"
  ],
  "maxPostsPerPublication": 100,
  "sort": "new",
  "includeContent": false
}
```

# Actor output Schema

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

No description

## `publications` (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": [
        "https://www.lennysnewsletter.com",
        "https://www.noahpinion.blog"
    ]
};

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

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

```

## MCP server setup

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