# Substack Posts Scraper — full articles as Markdown & text (`arthursbuisness/substack-publication-posts-scraper`) Actor

- **URL**: https://apify.com/arthursbuisness/substack-publication-posts-scraper.md
- **Developed by:** [Arthur](https://apify.com/arthursbuisness) (community)
- **Categories:** News, AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.80 / 1,000 substack 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Substack Posts Scraper — full articles as Markdown & plain text

Turn any **Substack publication** into a clean dataset: every post with title, subtitle, date, authors, paywall status, likes, comments, restacks, tags, cover image, podcast/video info and — optionally — the **full article body as Markdown and plain text**. Works with `name.substack.com` and with **custom domains** (e.g. `www.lennysnewsletter.com`). Uses Substack's public JSON endpoints: no login, no proxies, no browser.

Typical uses: newsletter monitoring and research, competitive analysis of writers, content archives, LLM/RAG corpora, sentiment/engagement tracking, Make/Zapier/Sheets automations.

### What you get

One row per post (`type: "post"`):

| field | description |
|---|---|
| `publication`, `publication_url` | Substack handle and site |
| `post_id`, `slug`, `url` | Stable ID, slug and canonical URL |
| `title`, `subtitle`, `description` | Headline, dek and SEO description |
| `date` | ISO 8601 publish time |
| `authors`, `author_handles` | Bylines |
| `post_type` | `newsletter`, `podcast`, `thread`, `video`… |
| `audience`, `is_paywalled` | `everyone`, `only_paid`, `founding` |
| `wordcount`, `reaction_count`, `comment_count`, `restacks` | Length and engagement |
| `tags`, `section` | Post tags and section |
| `cover_image`, `podcast_url`, `podcast_duration`, `video_upload_id` | Media |
| `preview` | Short teaser text |
| `body_markdown`, `body_text`, `body_words`, `body_complete` | With **Include full article body** (default on). `body_complete` is `false` when only the free preview of a paywalled post was available. `body_html` optional. |

With **Include publication info** (default on) you get one `type: "publication"` row: `name, author_name, hero_text, description, subdomain, custom_domain, logo_url, cover_photo_url, language, created_at, copyright, twitter, paid_subscriptions, monthly_price_cents, currency, pinned_post_ids`.

Unknown or unreachable publications produce a `type: "error"` row (free) and the run continues.

Export as JSON, CSV or Excel, or push rows to Google Sheets, Make, Zapier, webhooks or your code via the Apify API.

### Input

| field | default | meaning |
|---|---|---|
| `publications` | — | Handles or URLs: `astralcodexten`, `lenny.substack.com`, `https://www.lennysnewsletter.com` |
| `maxPosts` | 50 | Per publication, newest first |
| `since` | — | Only posts on/after `YYYY-MM-DD` |
| `includeBody` | true | Fetch each post's full body (Markdown + text) |
| `includeHtml` | false | Also keep the original HTML |
| `freeOnly` | false | Skip paywalled posts |
| `includePublicationInfo` | true | Add the publication row |

Example:

```json
{
  "publications": ["astralcodexten", "https://www.lennysnewsletter.com"],
  "maxPosts": 100,
  "since": "2026-01-01",
  "includeBody": true
}
```

Schedule the actor and deduplicate on `post_id` to keep an always-current archive.

### Pricing

Pay per event: **$0.0008 per stored row** ($0.80 per 1,000 posts). Each post row and each publication-info row counts as one event. Only rows actually written to the dataset are charged; error rows and filtered-out posts are free. Apify platform usage (roughly 1 second of compute per post with bodies) is billed separately by Apify.

### Limitations — please read

- **Paywalled posts**: Substack only exposes the free preview of paid posts; `body_complete: false` marks them and `body_words` vs `wordcount` shows how much you got. Subscriber-only content is not accessible.
- Comments and subscriber counts are not included (Substack does not expose them publicly per publication).
- Markdown conversion covers headings, paragraphs, bold/italic, links, images, lists, quotes, code and tables; embedded widgets (subscribe buttons, polls, embedded posts) are removed.
- Runs at about 2 requests per second per publication to stay polite; 1,000 posts with bodies take roughly 8–10 minutes.

Not affiliated with Substack. Uses only publicly accessible endpoints.

# Actor input Schema

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

Substack handles or URLs, e.g. 'astralcodexten', 'lenny.substack.com', 'https://www.lennysnewsletter.com' (custom domains work). One list entry = one publication.

## `maxPosts` (type: `integer`):

Newest first. Stops after this many stored posts per publication (after date/free filters).

## `since` (type: `string`):

Skip posts published before this date; paging stops once older posts are reached.

## `includeBody` (type: `boolean`):

Fetch each post and add body\_markdown, body\_text and body\_words (one extra request per post). Paywalled posts only include the free preview.

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

Also store the original body\_html (large). Requires 'Include full article body'.

## `freeOnly` (type: `boolean`):

Skip paywalled (paid-subscriber) posts.

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

Add one 'publication' row per publication: name, author, description, logo, language, paid-subscription price, custom domain, creation date.

## Actor input object example

```json
{
  "publications": [
    "astralcodexten"
  ],
  "maxPosts": 50,
  "includeBody": true,
  "includeHtml": false,
  "freeOnly": false,
  "includePublicationInfo": true
}
```

# Actor output Schema

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

All items as JSON

## `resultsCsv` (type: `string`):

Same dataset as CSV — open in Excel/Sheets

# 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": [
        "astralcodexten"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("arthursbuisness/substack-publication-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": ["astralcodexten"] }

# Run the Actor and wait for it to finish
run = client.actor("arthursbuisness/substack-publication-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": [
    "astralcodexten"
  ]
}' |
apify call arthursbuisness/substack-publication-posts-scraper --silent --output-dataset

```

## MCP server setup

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