# Substack Post Detail Scraper (`xtracto/substack-post-detail-scraper`) Actor

Fetch a Substack post by URL or '<publication>/<slug>' shorthand. Returns full post body HTML, author, audience, paywall, podcast metadata.

- **URL**: https://apify.com/xtracto/substack-post-detail-scraper.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Social media, News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.25 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Post Detail Scraper

Extract the full body, author, publication date, free or paid status, comment count, and image URLs from any public Substack post in bulk — clean structured JSON, one row per post.

### Why use this actor

- **No account / no login required** — paste a Substack URL and get the full post back.
- **Full post body** — both clean HTML (`body_html`) and word count, not just a teaser snippet.
- **Author detail included** — display name, handle, profile photo, and the publication they write for.
- **Paid-post detection** — `audience` field tells you whether the post is free (`everyone`), paid (`only_paid`), or founding-only, so you can filter before billing.
- **Engagement signals** — `comment_count`, `reaction_count`, `restacks`, and per-emoji `reactions` map for every post.
- **Cover image + audio** — direct CDN URL for the cover image and any text-to-speech audio Substack auto-generated for the post.
- **Bulk input** — pass a list of URLs in one run; one clean dataset row per post.
- **Automatic retries** — transient failures retry with backoff; deleted or draft posts surface as `_error: "not_found"` so you can triage failures.

### How it works

1. You provide a list of Substack post URLs — full URLs (`https://www.astralcodexten.com/p/links-for-january-2025`), custom-domain URLs, or `<publication>/<slug>` shorthand.
2. The actor fetches each post the same way Substack's web app does and assembles a flat JSON record with the full body, author, and engagement counts.
3. Results stream into your dataset, ready to download as JSON, CSV, or Excel.

You do not need to manage scrapers, browsers, or rotating IPs — all handled internally.

### Input

```json
{
  "posts": [
    "https://www.astralcodexten.com/p/links-for-january-2025",
    "stratechery/p/the-windows-pc-renaissance"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["DATACENTER"]
  }
}
```

| Field | Type | Description |
|---|---|---|
| `posts` | array | List of Substack post URLs or `<publication>/<slug>` shorthand. Full URLs, custom-domain URLs (`https://www.example.com/p/<slug>`), and shorthand all work. |
| `proxyConfiguration` | object | Apify Proxy settings. Datacenter proxy works for most public posts. |

### Output

Input: `https://www.astralcodexten.com/p/links-for-january-2025`

```json
{
  "_input": "https://www.astralcodexten.com/p/links-for-january-2025",
  "_publication": "www.astralcodexten.com",
  "_slug": "links-for-january-2025",
  "_source": "S1-api",
  "_scrapedAt": "2026-05-18T10:24:08.187026+00:00",
  "id": 154699327,
  "canonical_url": "https://www.astralcodexten.com/p/links-for-january-2025",
  "slug": "links-for-january-2025",
  "title": "Links For January 2025",
  "social_title": "Links For January 2025",
  "subtitle": "...",
  "description": "...",
  "type": "newsletter",
  "audience": "everyone",
  "post_date": "2025-01-17T00:18:10.411Z",
  "updated_at": "2025-01-20T12:43:04.768Z",
  "is_published": true,
  "language": "en",
  "wordcount": 4404,
  "body_html": "<p><em>[I haven't independently verified each link. On average, commenters will end up spotting evidence that around two or three of the links in each links post are wrong or misleading. I correct these as I see them, and will highlight important corrections later, but I can't guarantee I will have caught them all by the time you read this.]</em></p><p><strong>1: </strong><a href=\"https://x.com/HedgeDirty/status/1869555974966808794\">Why running for Congress will ruin your life</a> ... 67000 more chars",
  "cover_image": "https://substack-post-media.s3.amazonaws.com/public/images/a8cc61f4-a715-4858-b76a-583d668f9617_800x533.jpeg",
  "cover_image_is_explicit": false,
  "comment_count": 877,
  "child_comment_count": 877,
  "reaction_count": 236,
  "reactions": {"❤": 236},
  "restacks": 40,
  "publication_id": 89120,
  "section_id": null,
  "previous_post_slug": "highlights-from-the-comments-on-lynn",
  "next_post_slug": "open-thread-365",
  "postTags": [],
  "audio_items": [
    {
      "post_id": 154699327,
      "voice_id": "en-US-OnyxTurboMultilingualNeural",
      "audio_url": "https://substack-video.s3.amazonaws.com/video_upload/post/154699327/tts/09d83c97-c0d4-403a-af0b-8b8571e0dfff/en-US-OnyxTurboMultilingualNeural.mp3",
      "type": "tts",
      "status": "completed"
    }
  ],
  "publishedBylines": [
    {
      "id": 12009663,
      "name": "Scott Alexander",
      "handle": "astralcodexten",
      "photo_url": "https://substackcdn.com/image/fetch/.../7b500d22-1176-42ad-afaa-5d72bc36a809_44x44.png",
      "bio": "",
      "is_guest": false,
      "publicationUsers": [
        {
          "id": 18921,
          "user_id": 12009663,
          "publication_id": 89120,
          "role": "admin",
          "is_primary": true,
          "publication": {
            "id": 89120,
            "name": "Astral Codex Ten",
            "subdomain": "astralcodexten",
            "custom_domain": "www.astralcodexten.com",
            "hero_text": "P(A|B) = [P(A)*P(B|A)]/P(B), all the rest is commentary."
          }
        }
      ]
    }
  ]
}
```

| Field | Type | Description |
|---|---|---|
| `_input` | string | The URL or shorthand exactly as you supplied it. Use to join results back to your input list. |
| `_publication` | string | Resolved publication host (e.g. `www.astralcodexten.com` or `<subdomain>.substack.com`). |
| `_slug` | string | The post slug parsed from the URL (the part after `/p/`). |
| `_source` | string | Internal tag for the path used to fetch the record. `S1-api` is the fastest, richest path; values starting with `S2-` indicate a fallback was used. |
| `_scrapedAt` | string | ISO-8601 UTC timestamp when the record was scraped. |
| `id` | integer | Substack's internal numeric post ID. Stable across slug changes. |
| `canonical_url` | string | Canonical post URL (custom domain if the publication has one). |
| `slug` | string | URL slug of the post. |
| `title` | string | Post title as shown on the page. |
| `social_title` | string | Title used when the post is shared on social networks (often the same as `title`). |
| `subtitle` | string | Optional subtitle shown under the title. |
| `description` | string | Short description used in social/SEO previews. |
| `type` | string | `newsletter`, `podcast`, `thread`, or `video`. |
| `audience` | string | `everyone` (free), `only_paid` (subscriber-only), or `founding`. Use this to spot paid posts. |
| `post_date` | string | ISO-8601 publish timestamp. |
| `updated_at` | string | ISO-8601 last-update timestamp. |
| `is_published` | boolean | `true` for published posts; drafts return `_error: "not_found"`. |
| `language` | string | ISO 639-1 language code (e.g. `en`). |
| `wordcount` | integer | Word count of the full body. |
| `body_html` | string | Full post body as clean HTML. Preserves headings, links, embedded images, and footnotes. |
| `cover_image` | string | Direct CDN URL of the post's cover/hero image. `null` if none. |
| `cover_image_is_explicit` | boolean | `true` if the cover image is flagged as explicit. |
| `comment_count` | integer | Total number of comments on the post (top-level + replies). |
| `child_comment_count` | integer | Total comment count including nested replies. |
| `reaction_count` | integer | Sum of all reactions across emoji. |
| `reactions` | object | Map of emoji to count (e.g. `{"❤": 236}`). |
| `restacks` | integer | Number of times the post was re-shared inside Substack. |
| `publication_id` | integer | Numeric ID of the publication that owns the post. |
| `section_id` | integer | Section/category ID, or `null` for un-sectioned publications. |
| `previous_post_slug` | string | Slug of the post immediately before this one in the archive. |
| `next_post_slug` | string | Slug of the post immediately after this one in the archive. |
| `postTags` | array | Tags applied to the post. |
| `audio_items` | array | Any audio versions of the post — including Substack's auto-generated text-to-speech. Each item has `audio_url`, `voice_id`, `type`, and `status`. |
| `publishedBylines` | array | Authors of the post. Each entry includes `id`, `name`, `handle`, `photo_url`, `bio`, plus a nested `publicationUsers` array linking the author to one or more publications. |

#### Error envelope

Posts that don't exist or fail to fetch return a structured error instead of crashing the run:

```json
{
  "_input": "astralcodexten/p/this-post-does-not-exist",
  "_publication": "astralcodexten",
  "_slug": "this-post-does-not-exist",
  "_error": "not_found",
  "_errorDetail": "NotFound https://astralcodexten.substack.com/api/v1/posts/this-post-does-not-exist",
  "_source": "S1-api",
  "_scrapedAt": "2026-05-18T10:24:10.012345+00:00"
}
```

Filter on `_error` to triage failed rows.

### Pricing

This actor is billed per result: **$2.50 per 1,000 posts**. Each successful post = 1 result. Errors (not-found, deleted, draft) are not billed.

### Other Sosmed Actors

| Platform | Actor | Best for |
|---|---|---|
| Substack | [Substack Publication Scraper](https://apify.com/xtracto/substack-publication-scraper) | Publication metadata + subscriber counts |
| Substack | [Substack Publication Posts Scraper](https://apify.com/xtracto/substack-publication-posts-scraper) | List every post from a Substack publication |
| Medium | [Medium Post Detail Scraper](https://apify.com/xtracto/medium-post-detail-scraper) | Full Medium article body + clap count |
| Tumblr | [Tumblr Post Detail Scraper](https://apify.com/xtracto/tumblr-post-detail-scraper) | Tumblr post body + reblog chain |
| Telegram | [Telegram Post Detail Scraper](https://apify.com/xtracto/telegram-post-detail-scraper) | Public Telegram channel post + views |
| Reddit | [Reddit Post Detail Scraper](https://apify.com/xtracto/reddit-post-detail-scraper) | Full Reddit post + score + flair |
| X | [X Post Detail Scraper](https://apify.com/xtracto/x-post-detail-scraper) | Tweet body + engagement counters |

Browse the full catalog at [apify.com/xtracto](https://apify.com/xtracto).

### Notes

- Paid posts (`audience: "only_paid"` or `"founding"`) return only the public intro snippet in `body_html`; the full body requires a paid subscription, which this anonymous scraper does not provide. Use the `audience` field to detect and filter these before processing.
- Comments are **not** included in the response by default — only the `comment_count`. If you need the actual comment thread, request the upcoming Substack comments scraper.
- Custom-domain publications are fully supported. Pass either the custom-domain URL (`https://www.astralcodexten.com/p/<slug>`) or the underlying subdomain shorthand (`astralcodexten/p/<slug>`).
- Deleted, draft, or unpublished posts return `{"_error": "not_found", "_input": "..."}`.
- The internal `id` (integer) is the most stable identifier — slugs can be edited by the author after publication, `id` cannot.

# Actor input Schema

## `posts` (type: `array`):

List of Substack post URLs to scrape. Accepts full URLs (https://<publication>.substack.com/p/<slug>), custom-domain URLs (https://www.example.com/p/<slug>), or '<publication>/<slug>' shorthand.

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

Apify Proxy settings. Datacenter proxy works for most public Substack posts; switch to residential if you hit rate limits on large runs.

## Actor input object example

```json
{
  "posts": [
    "https://www.astralcodexten.com/p/links-for-january-2025",
    "stratechery/p/the-windows-pc-renaissance"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `id` (type: `string`):

Unique identifier of the item at the source.

## `canonical_url` (type: `string`):

Link to the canonical.

## `slug` (type: `string`):

URL slug of the item.

## `title` (type: `string`):

Title of the item.

## `social_title` (type: `string`):

Social title as reported by the source.

## `subtitle` (type: `string`):

Subtitle as reported by the source.

## `description` (type: `string`):

Short description or summary.

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

Type of the item.

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

Audience as reported by the source.

## `post_date` (type: `string`):

Post date as reported by the source.

## `updated_at` (type: `string`):

Updated at as reported by the source.

## `is_published` (type: `string`):

Is published. Boolean value.

## `language` (type: `string`):

Language code of the item.

## `wordcount` (type: `string`):

Wordcount. Whole number.

## `body_html` (type: `string`):

Body html as reported by the source.

## `cover_image` (type: `string`):

Cover image as reported by the source.

## `cover_image_is_explicit` (type: `string`):

Cover image is explicit as reported by the source.

## `comment_count` (type: `string`):

Comment count. Whole number.

## `child_comment_count` (type: `string`):

Child comment count. Whole number.

## `reaction_count` (type: `string`):

Reaction count. Whole number.

## `reactions` (type: `string`):

Reactions.

## `restacks` (type: `string`):

Restacks.

## `publication_id` (type: `string`):

Publication id as reported by the source.

## `section_id` (type: `string`):

Section id as reported by the source.

## `previous_post_slug` (type: `string`):

Previous post slug as reported by the source.

## `next_post_slug` (type: `string`):

Next post slug as reported by the source.

## `postTags` (type: `string`):

Post Tags.

## `audio_items` (type: `string`):

Audio items.

## `publishedBylines` (type: `string`):

Published Bylines.

## `_input` (type: `string`):

The input value this row was produced from.

## `_publication` (type: `string`):

Publication as reported by the source.

## `_slug` (type: `string`):

Slug as reported by the source.

# 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 = {
    "posts": [
        "https://www.astralcodexten.com/p/links-for-january-2025",
        "stratechery/p/the-windows-pc-renaissance"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/substack-post-detail-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 = { "posts": [
        "https://www.astralcodexten.com/p/links-for-january-2025",
        "stratechery/p/the-windows-pc-renaissance",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/substack-post-detail-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 '{
  "posts": [
    "https://www.astralcodexten.com/p/links-for-january-2025",
    "stratechery/p/the-windows-pc-renaissance"
  ]
}' |
apify call xtracto/substack-post-detail-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/substack-post-detail-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/V76xVzSX9rr7NErWs/builds/qf5HyUo1cwqZYpnrx/openapi.json
