# Substack Newsletter Posts Scraper (`harshm07/substack-posts-scraper`) Actor

Scrape posts from any Substack newsletter: titles, dates, likes, comments, paywall status and full text.

- **URL**: https://apify.com/harshm07/substack-posts-scraper.md
- **Developed by:** [Harsh Mahajan](https://apify.com/harshm07) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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

Scrape **posts from any Substack newsletter**: titles, subtitles, publish dates, authors, likes, comments, restacks, word count, tags, paywall status, podcast links and, optionally, the **full post text**. Works with `*.substack.com` and custom domains.

### Use cases

- **Content research:** find a newsletter's most-liked posts and topics.
- **Competitor and creator analysis:** track posting frequency and engagement over time.
- **AI and LLM datasets:** export full text of free posts for summarization or RAG.
- **Sponsorship research:** compare engagement across newsletters before buying ads.

### Input

- **Publications:** `https://www.lennysnewsletter.com`, `https://noahpinion.substack.com`, or just `noahpinion`.
- **Sort:** newest or most popular. You can also use Substack's own archive search.
- **Filters:** keywords, post type (newsletter, podcast, thread), free only, posted after a date, and minimum likes.
- **Include full post text:** fetches each post's content. Paid posts return only the free preview, flagged with `contentIsPreview`.

### Output example

```json
{
  "publicationName": "Lenny's Newsletter",
  "title": "All of the Lenny & Friends Summit talks are now online!",
  "postDate": "2026-09-29T13:15:57.512Z",
  "authors": ["Lenny Rachitsky"],
  "audience": "everyone",
  "isPaywalled": false,
  "reactionCount": 278,
  "commentCount": 6,
  "restacks": 4,
  "wordcount": 1276,
  "url": "https://www.lennysnewsletter.com/p/all-of-the-lenny-and-friends-summit"
}
```

Invalid or non-Substack URLs come back as rows with an `error` field.

### FAQ

**Can it read paywalled posts?** No. It reads only what Substack shows publicly. Paid posts include metadata and the free preview.

# Actor input Schema

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

Newsletter URLs (https://www.lennysnewsletter.com, https://noahpinion.substack.com) or just the subdomain (noahpinion). Custom domains work too.

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

Leave empty to scrape the entire archive.

## `sortBy` (type: `string`):

Collect the newest posts first, or the most popular ones.

## `search` (type: `string`):

Use Substack's own archive search (e.g. "AI").

## `keywords` (type: `array`):

Keep posts whose title, subtitle, description or tags contain any of these words.

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

Leave empty for all types.

## `onlyFree` (type: `boolean`):

Skip paywalled (paid-subscriber) posts.

## `postedAfter` (type: `string`):

Only posts published on or after this date.

## `minReactions` (type: `integer`):

Keep only posts with at least this many likes.

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

Fetch the full text of every post (paid posts return only the free preview). Slower.

## `includeContentHtml` (type: `boolean`):

Requires "Include full post text".

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

Usually not needed.

## Actor input object example

```json
{
  "publications": [
    "https://www.lennysnewsletter.com"
  ],
  "maxPostsPerPublication": 50,
  "sortBy": "new",
  "onlyFree": false,
  "minReactions": 0,
  "includeContent": false,
  "includeContentHtml": false,
  "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 = {
    "publications": [
        "https://www.lennysnewsletter.com"
    ],
    "maxPostsPerPublication": 50,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("harshm07/substack-posts-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"],
    "maxPostsPerPublication": 50,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("harshm07/substack-posts-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"
  ],
  "maxPostsPerPublication": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call harshm07/substack-posts-scraper --silent --output-dataset

```

## MCP server setup

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