# Substack Scraper (`mariuss.b094/substack-scraper`) Actor

Scrape any Substack newsletter: posts with full text as clean Markdown, likes, restacks and comments. Custom domains, keyword search and "only new posts" monitoring. No login, no proxies. $0.25 per 1,000 posts.

- **URL**: https://apify.com/mariuss.b094/substack-scraper.md
- **Developed by:** [Marius Bogdan](https://apify.com/mariuss.b094) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 33.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.25 / 1,000 post scrapeds

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: posts, full text as Markdown, stats and comments

Get any Substack newsletter's posts as clean, structured data: title, date, authors, likes, comments, restacks and the **full text of free posts as Markdown**, ready for AI tools, RAG and analysis. Works with `name.substack.com` and custom domains. No login, no cookies, no proxies.

### What you can do with it

- **Build AI knowledge bases** from the newsletters you follow (clean Markdown, one row per post).
- **Monitor newsletters**: schedule it with *"Only posts that are new since my last run"* and get only new posts each time.
- **Research a topic**: search Substack by keyword and collect the top newsletters' posts.
- **Track engagement**: likes, comments and restacks per post over time.

### Input

| Field | Example | Notes |
|---|---|---|
| Newsletters, posts or profiles | `garymarcus`, `https://www.lennysnewsletter.com`, `https://x.substack.com/p/post-name`, `https://substack.com/@handle` | One per line |
| Find newsletters by keyword | `artificial intelligence` | Optional |
| Max posts per newsletter | `50` | Newest first; `0` = whole archive |
| Only posts published after | `2026-01-01` | Optional |
| Only posts new since my last run | on/off | For scheduled monitoring |
| Full text | on | Markdown + plain text |
| Comments | off | Nested replies included |
| Commenter names | off | Personal data, off by default |

### Output (one row per post)

```json
{
  "url": "https://garymarcus.substack.com/p/example-post",
  "publication": { "name": "Marcus on AI", "url": "https://garymarcus.substack.com", "host": "garymarcus.substack.com", "authorName": "Gary Marcus" },
  "post": { "id": 123, "title": "Example post", "subtitle": "…", "slug": "example-post", "publishedAt": "2026-11-06T13:55:04.000Z",
            "type": "newsletter", "audience": "free", "authors": ["Gary Marcus"], "tags": ["AI"], "coverImage": "https://…" },
  "stats": { "likes": 412, "comments": 87, "restacks": 35 },
  "content": { "isPreview": false, "markdown": "## Heading\n\nText…", "text": "Heading\n\nText…", "wordCount": 1830, "images": ["https://…"], "links": ["https://…"] },
  "comments": [ { "id": 1, "text": "…", "date": "…", "likes": 4, "replies": [] } ],
  "source": "api",
  "scrapedAt": "2026-11-08T18:00:00.000Z",
  "error": null
}
```

Download as JSON, CSV, Excel or use the API. If a link is wrong or a post was deleted, you get a row with `error.message` filled in. **You're not charged for it** and the run keeps going.

### Pricing

Pay only for results:

| What | Price |
|---|---|
| Post (metadata + full text) | **$0.25 per 1,000 posts** |
| Comment (incl. replies) | $0.05 per 1,000 comments |
| Run start | Apify's standard $0.05 per 1,000 runs |
| Problem rows (bad link, deleted post) | free |

Example: the last 100 posts of 10 newsletters (1,000 posts) cost **$0.25**. Apify's free plan includes $5 of monthly credit, enough for about 20,000 posts.

### What it does not do

- It never logs in and never returns paid-only content. Paid posts come with title, stats and the free preview that Substack shows publicly.
- It does not collect emails, phone numbers or contact details.
- It keeps its request rate low (about 2 per second) to be polite to Substack.

### Responsible use

This Actor collects publicly visible information. You are responsible for how you use the data: respect Substack's Terms of Use, the authors' copyright, and data-protection law such as GDPR (especially if you turn on commenter names). Don't republish full posts without permission.

### Support

Found a problem or need a field? Open an issue on the *Issues* tab. We usually reply within 1–2 days.

# Actor input Schema

## `startUrls` (type: `array`):

One per line. Accepts newsletter names (garymarcus), newsletter links (https://garymarcus.substack.com or a custom domain), single post links (.../p/post-name) and profile links (https://substack.com/@handle).

## `searchQuery` (type: `string`):

Searches Substack for newsletters matching this word and scrapes them, e.g. "AI" or "personal finance".

## `maxNewslettersFromSearch` (type: `integer`):

Only used with a search word.

## `maxPostsPerNewsletter` (type: `integer`):

Newest first. 0 = the whole archive.

## `onlyNewSince` (type: `string`):

Skip posts published on or before this date.

## `onlyNewSinceLastRun` (type: `boolean`):

Great for scheduled monitoring: each run returns only posts published after the newest post seen in your previous run.

## `includeFullText` (type: `boolean`):

Full text of free posts, ready for AI tools. Turn off for a faster list of posts only.

## `includePaidPreviews` (type: `boolean`):

Paid posts always return only what Substack shows publicly (title, stats and free preview). Never paid content.

## `includeHtml` (type: `boolean`):

The original HTML of free posts, in addition to Markdown and text. Makes the output larger.

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

Comment text, date, likes and nested replies. Charged per comment.

## `includeCommenterNames` (type: `boolean`):

Off by default: commenters are private people, so their names are personal data (GDPR). Only turn on if you have a lawful reason.

## `maxConcurrency` (type: `integer`):

Kept low on purpose to be polite to Substack (max 4).

## Actor input object example

```json
{
  "startUrls": [
    "https://garymarcus.substack.com"
  ],
  "maxNewslettersFromSearch": 10,
  "maxPostsPerNewsletter": 20,
  "onlyNewSinceLastRun": false,
  "includeFullText": true,
  "includePaidPreviews": true,
  "includeHtml": false,
  "includeComments": false,
  "includeCommenterNames": false,
  "maxConcurrency": 2
}
```

# Actor output Schema

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

One row per post: newsletter, title, date, stats, full text (free posts) or preview (paid posts), and comments if turned on.

# 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 = {
    "startUrls": [
        "https://garymarcus.substack.com"
    ],
    "maxPostsPerNewsletter": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("mariuss.b094/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 = {
    "startUrls": ["https://garymarcus.substack.com"],
    "maxPostsPerNewsletter": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("mariuss.b094/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 '{
  "startUrls": [
    "https://garymarcus.substack.com"
  ],
  "maxPostsPerNewsletter": 20
}' |
apify call mariuss.b094/substack-scraper --silent --output-dataset

```

## MCP server setup

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