# Substack Scraper (`dacoder/substack-scraper`) Actor

A powerful Apify actor that extracts data from Substack newsletters. Collects author profiles, post content, engagement metrics, and publication details. Perfect for content analysis, archiving, and competitive research. Outputs clean, structured data with clickable links and formatted images.

- **URL**: https://apify.com/dacoder/substack-scraper.md
- **Developed by:** [Da Coder](https://apify.com/dacoder) (community)
- **Categories:** News, Social media, Automation
- **Stats:** 39 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

$24.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## 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 Scraper

### ❗ Version 1 Notes

- Currently, only the last 20 Posts are return, need more? Create a new issue
- There are more data points available, we've started with the most popular, want something in particular? Create a new issue

### 🚀 What It Does

Enter a Substack and retrieve all published content. This scraper extracts the complete content data from the Substack page, including posts and author details

### 💡 Why Use It?

This scraper is perfect for:

- Content analysis of Substack publications
- Archiving Substack content
- Monitoring specific publications
- Data collection for research purposes

### 🔍 Substack Username Guidelines

The scraper accepts Substack names in their basic form. Here are some examples:

- Correct: marketingideas
- Correct: mattlevine
- Correct: noahpinion

Note: Do not include '@' or '.substack.com' in the username.

### 🛠️ How to Use

1. Run the scraper through Apify platform
2. Enter the Substack name in the input field
3. The scraper will automatically:
   - Visit the Substack page
   - Extract all available content
   - Save the data to Apify Dataset
   - Stop when complete

### 📝 Sample Output

The scraper saves data in a structured format including:

```json
{
    "substack": "nickcohen",
    "author": {
        "author_url": "https://substack.com/@nickcohen",
        "author_id": 5183845,
        "author_name": "Nick Cohen",
        "author_handle": "nickcohen",
        "author_photo_url": "https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe1db7a9b-2f54-4a2e-9799-917685c71adb_960x640.jpeg",
        "author_bio": "Journalist and commentator from the UK",
        "twitter_screen_name": "NickCohen4"
    },
    "posts": [
        {
            "id": 165338922,
            "title": "How aristocratic snobbery wrecked the UK",
            "description": "Michael Gove, Sarah Vine and the fury of the left-behind middle class",
            "slug": "how-aristocratic-snobbery-wrecked",
            "post_date": "2025-06-07T07:59:10.680Z",
            "url": "https://nickcohen.substack.com/p/how-aristocratic-snobbery-wrecked",
            "word_count": 1397,
            "audience": "only_paid",
            "reactions": {
                "❤": 75
            },
            "comment_count": 26,
            "truncated_body_text": "Image by Mike Finn. Flickr creative commons",
            "cover_image": "https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F175d86d3-ebc0-4be8-a78d-c676c9f5abc3_750x536.webp",
            "subtitle": "Michael Gove, Sarah Vine and the fury of the left-behind middle class"
        },
        {
            "id": 165307596,
            "title": "Don’t ally with Elon Musk ",
            "description": "Your enemy’s enemy is NOT your friend",
            "slug": "dont-ally-with-elon-musk",
            "post_date": "2025-06-05T23:17:58.140Z",
            "url": "https://nickcohen.substack.com/p/dont-ally-with-elon-musk",
            "word_count": 812,
            "audience": "everyone",
            "reactions": {
                "❤": 89
            },
            "comment_count": 18,
            "truncated_body_text": "I try to keep posts about our crisis free to read so that they can receive a wide audience. But, if you can afford to, please consider supporting my journalism by becoming a paid subscriber.",
            "cover_image": "https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F809b427b-a403-45e3-9d0d-9e7f4c3fd547_503x432.png",
            "subtitle": "Your enemy’s enemy is NOT your friend"
        }
    ]
}
```

# Actor input Schema

## `substacks` (type: `array`):

An array of Substack handles to scrape (e.g., 'nickcohen', 'mattstoller'). Do not include '@' or '.substack.com'.

## Actor input object example

```json
{
  "substacks": [
    "nickcohen"
  ]
}
```

# 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 = {
    "substacks": [
        "nickcohen"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dacoder/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 = { "substacks": ["nickcohen"] }

# Run the Actor and wait for it to finish
run = client.actor("dacoder/substack-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "substacks": [
    "nickcohen"
  ]
}' |
apify call dacoder/substack-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dacoder/substack-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/KPwIxxjeN0OGJF4WV/builds/6dRQudN3x03BhK67N/openapi.json
