# Substack Scraper: posts, newsletters, subscribers, full text (`pikoulas/substack`) Actor

Scrape Substack posts from any newsletter (custom domains too), post URLs or Substack search, with likes, comments, restacks and optional full text. Find newsletters by keyword with their author and subscriber counts. Fast, no browser, $1 per 1,000 posts.

- **URL**: https://apify.com/pikoulas/substack.md
- **Developed by:** [Spyridon Pikoulas](https://apify.com/pikoulas) (community)
- **Categories:** News, Lead generation, AI
- **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

Scrape Substack posts and newsletters:

- **Newsletters:** the posts of any newsletter, given as a URL, a custom domain or a Substack name.
  You get the newest or the most popular first, and can keep only posts after a date.
- **Post URLs:** single posts, with their full text.
- **Search posts:** posts from Substack's own search, across every newsletter.
- **Find newsletters:** newsletters by keyword, with their author, description and subscriber
  count. This is useful for sponsorship, outreach and guest-post lists.

Every post comes with its newsletter, authors, date, likes, comments, restacks, tags, word count,
and whether it is paywalled. Turn on **Include full text** to add its text and HTML.

It needs no browser and no login, and it is fast: 28 posts with full text and 15 newsletters took
7 seconds. It costs **$1 per 1,000 posts**, and **$2 per 1,000 newsletters**.

### What people use it for

- **AI and LLM pipelines:** expert writing on any topic as clean text, for RAG, summaries and
  research agents.
- **Sponsorships and outreach:** find newsletters in a niche and rank them by subscribers.
- **Content research:** which posts in a niche get the most likes, comments and restacks.
- **Monitoring:** new posts from a list of newsletters, day by day.

### How to scrape Substack

1. Click **Try for free**; Apify's free plan covers a first run.
2. Enter **Newsletters**, **Post URLs**, **Search posts** or **Find newsletters**, and how many items you want per source.
3. Click **Start**, then download the results as JSON, CSV, Excel or HTML, or read them through
   the API.

An input with more options:

```json
{
  "newsletters": ["https://www.lennysnewsletter.com", "astralcodexten"],
  "searchQueries": ["ai agents"],
  "newsletterQueries": ["product management"],
  "maxItemsPerSource": 50,
  "sort": "new",
  "postedAfter": "2026-06-01",
  "includeContent": true
}
```

### Output

A post:

```json
{
  "type": "post",
  "title": "Announcing Lenny’s Jobs: The best place in the world to find, vet, and land your dream job",
  "url": "https://www.lennysnewsletter.com/p/announcing-lennys-jobs-the-best-place",
  "newsletter": "Lenny's Newsletter",
  "newsletterUrl": "https://www.lennysnewsletter.com",
  "authors": ["Lenny Rachitsky"],
  "postedAt": "2026-08-18T15:40:06.921Z",
  "audience": "everyone",
  "isPaywalled": false,
  "wordCount": 933,
  "likes": 378,
  "comments": 18,
  "restacks": 9,
  "tags": ["Career"],
  "text": "…",
  "html": "…"
}
```

A newsletter:

```json
{
  "type": "newsletter",
  "name": "The Product Compass",
  "url": "https://www.productcompass.pm",
  "description": "The #1 AI & PM newsletter. Actionable tips, resources, and step-by-step playbooks to learn by doing.",
  "author": "Paweł Huryn",
  "authorHandle": "huryn",
  "language": "en",
  "subscribers": 141000,
  "subscribersText": "Hundreds of thousands of subscribers",
  "hasPaidPlan": true,
  "createdAt": "2022-06-19T06:45:53.181Z"
}
```

### Use it as an API

One call runs it and returns the results as JSON (for runs under 5 minutes; longer ones start a
run and read its dataset). Apify's Python and JavaScript clients, and its Make, Zapier and n8n
integrations, work the same way.

```bash
curl -X POST "https://api.apify.com/v2/acts/pikoulas~substack/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"newsletters": ["https://www.lennysnewsletter.com"], "newsletterQueries": ["product management"], "maxItemsPerSource": 5, "includeContent": true}'
```

AI agents can call it as a tool through Apify's MCP server: `https://mcp.apify.com?tools=pikoulas/substack`.

### How much does it cost to scrape Substack?

You pay **$0.001 per post**, full text included, which is $1 per 1,000. Newsletters cost **$0.002**
each. Runs that go through Apify's residential proxy also pay its traffic, $0.0012 per 100 KB. There
are no monthly fees.

### Good to know

- Paid posts give their free preview only; `isPaywalled` tells them apart.
- `subscribers` is the count Substack shows, exact under a thousand and rounded above it ("79K+"
  is 79000); `subscribersText` is its wording, "Tens of thousands of subscribers".
- Newsletters that left Substack keep their old Substack archive, so their newest posts may be
  missing.

### FAQ

#### Is it legal to scrape Substack?

It collects only what Substack shows publicly, without logging in. Scraping public data is
generally legal, but personal data is protected by laws such as the GDPR and the CCPA, and
Substack's terms may limit how you use what you collect. If you're unsure, ask a lawyer;
Apify's [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/) is a good start.

#### Something missing or not working?

Open an issue on the **Issues** tab with the input you used, or ask there for a field you need.

# Actor input Schema

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

Newsletter URLs, custom domains or Substack names: https://www.lennysnewsletter.com, platformer.news or platformer. Gives their posts.

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

Single posts, always with their full text.

## `searchQueries` (type: `array`):

Posts from Substack's own search, across all newsletters.

## `newsletterQueries` (type: `array`):

Keywords to find newsletters by. Gives each newsletter's author, description and subscriber count, not its posts.

## `maxItemsPerSource` (type: `integer`):

How many posts per newsletter or search query, or newsletters per keyword.

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

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

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

Only posts from this date on (YYYY-MM-DD).

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

Adds each post's text and HTML. Paid posts give their free preview only.

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

Not needed for most runs. Turn it on if Substack starts refusing requests.

## Actor input object example

```json
{
  "newsletters": [
    "https://www.lennysnewsletter.com"
  ],
  "maxItemsPerSource": 20,
  "sort": "new",
  "includeContent": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

## `newsletters` (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"
    ],
    "maxItemsPerSource": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("pikoulas/substack").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"],
    "maxItemsPerSource": 20,
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pikoulas/substack"
        }
    }
}
```

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/OEpxTcJ774T7brV1m/builds/d3wjaXp6b0ng9UIS8/openapi.json
