# Substack Scraper – Newsletter Posts, Search & Publication Info (`dedicated_crest/substack-posts-newsletter-scraper`) Actor

Scrape Substack newsletter posts from any publication URL or search all of Substack by keyword. Get title, date, author, URL, likes, comments, restacks, word count and free/paid flag, plus publication info. Public JSON API, no login.

- **URL**: https://apify.com/dedicated_crest/substack-posts-newsletter-scraper.md
- **Developed by:** [Ben Barazandeh](https://apify.com/dedicated_crest) (community)
- **Categories:** Social media, News, Lead generation
- **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, Search & Publication Info

**Scrape posts from any Substack newsletter, or search all of Substack by keyword.** For each post you get the title, subtitle, publish date, author(s), URL, **likes, comments, restacks**, word count, tags, cover image and a **free/paid flag**. You can also get one **publication row** per newsletter with its name, author, description, logo, language, subscriber band (for example "1.2M+") and whether paid subscriptions are enabled. It uses Substack's public JSON endpoints, so you don't need a login, cookies or a browser.

**Try it now:** the input is pre-filled with Lenny's Newsletter. Click **Start**.

### What can you do with it?

- **Newsletter research and competitor tracking**: export every post a newsletter has published, with engagement, to see which topics work.
- **Content monitoring**: schedule a daily run with `dateFrom` to get new posts from a list of newsletters.
- **Topic discovery**: search Substack for a keyword like `ai agents` and find the writers and newsletters covering it.
- **Creator and sponsor prospecting**: build lists of newsletters with author names, subscriber bands and paid status.
- **Datasets for AI and NLP**: turn on `includeContent` to get the publicly visible post text.

### Input

| Field | Notes |
|---|---|
| `publicationUrls` | `https://name.substack.com`, a custom domain such as `https://www.lennysnewsletter.com`, or just `name`. |
| `searchQueries` | Keywords searched across all of Substack. |
| `maxPostsPerSource` | Per publication or per query. Default 50. |
| `sort` | `new` (default) or `top`, for publication archives. |
| `dateFrom` / `dateTo` | `YYYY-MM-DD`, UTC. `dateTo` includes the whole day. |
| `audience` | `all`, `free` or `paid`. |
| `includeContent` | Adds `text`: the full text for free posts, the public preview for paid posts. |
| `includePublicationInfo` | One `publication` row per newsletter (default on). |

### Output

Sample post:

```json
{ "type": "post", "publicationName": "Lenny's Newsletter", "title": "How to tell if a startup has a moat",
  "url": "https://www.lennysnewsletter.com/p/how-to-tell-if-a-startup-has-a-moat", "postDate": "2026-10-13T12:45:41.160Z",
  "author": "Dan Hockenmaier", "isPaid": true, "audience": "only_paid", "likes": 375, "comments": 2, "restacks": 22, "wordcount": 4153 }
```

Sample publication:

```json
{ "type": "publication", "name": "Lenny's Newsletter", "url": "https://www.lennysnewsletter.com", "authorName": "Lenny Rachitsky",
  "language": "en", "subscriberBand": "1.2M+", "paidEnabled": true, "createdAt": "2019-06-01T15:35:37.885Z" }
```

Download the results as JSON, CSV, Excel or HTML, or use the API. The dataset has **Posts** and **Publications** views.

### Pricing

Pay per event, with no start fee:

- **$0.001 per post** ($1 per 1,000 posts)
- **$0.002 per publication info row**

Set *Maximum cost per run* and the Actor stops cleanly when it reaches the limit.

### Limits

- Paid posts: you get the metadata and the public preview only. Paywalled text is never accessed.
- Search uses Substack's own search, so results are ranked by relevance and capped by Substack. Expect up to a few hundred posts per query.
- Exact subscriber counts aren't public. `subscriberBand` is the band Substack shows publicly.
- Requests are spaced out and retried with backoff on HTTP 429 and 5xx errors.

### FAQ

**Is it allowed?** It reads only public pages and the public JSON that Substack's own website uses. Respect authors' copyright and applicable privacy law when you use the data.

**Affiliation?** This Actor is independent and not affiliated with Substack Inc.

# Actor input Schema

## `publicationUrls` (type: `array`):

Substack newsletters to scrape: https://name.substack.com, a custom domain (https://www.lennysnewsletter.com), or just the subdomain (name). Post URLs also work; the publication is taken from them.

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

Search posts across all of Substack by keyword, e.g. "ai agents". Optional.

## `maxPostsPerSource` (type: `integer`):

Maximum posts saved for each publication URL or search query.

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

Order of posts from publication archives.

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

Optional. YYYY-MM-DD (UTC). Older posts are skipped.

## `dateTo` (type: `string`):

Optional. YYYY-MM-DD (UTC), inclusive.

## `audience` (type: `string`):

Keep free posts, paid (subscriber-only) posts, or both.

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

Add the publicly visible post text (the free preview for paid posts). Makes items larger.

## `includePublicationInfo` (type: `boolean`):

Also save one publication row per newsletter (name, author, description, logo, language, subscriber band, paid enabled).

## Actor input object example

```json
{
  "publicationUrls": [
    "https://www.lennysnewsletter.com"
  ],
  "maxPostsPerSource": 20,
  "sort": "new",
  "audience": "all",
  "includeContent": false,
  "includePublicationInfo": true
}
```

# Actor output Schema

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

Substack posts and publications

# 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 = {
    "publicationUrls": [
        "https://www.lennysnewsletter.com"
    ],
    "maxPostsPerSource": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("dedicated_crest/substack-posts-newsletter-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 = {
    "publicationUrls": ["https://www.lennysnewsletter.com"],
    "maxPostsPerSource": 20,
}

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

```

## MCP server setup

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