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

The Substack Author Scraper is a powerful Apify actor that makes it easy for content creators to scrape and retrieve all posts from their favorite Substack authors. With structured data presented in a user-friendly format, analyzing and processing valuable information has never been easier.

- **URL**: https://apify.com/qpayre/substack-scraper.md
- **Developed by:** [QPS](https://apify.com/qpayre) (community)
- **Categories:** Automation, Social media
- **Stats:** 466 total users, 2 monthly users, 87.7% runs succeeded, 15 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.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/actors/running/actors-in-store.md#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 Author Scraper

![image](https://drive.google.com/uc?export=view\&id=1C9fCAGGn-x9xJkgJblYALJQFRKOP2DwO)

Substack Author Scraper is an Apify actor designed to scrape all posts from a specified Substack author and retrieve the content of each article. The actor returns the data in a structured format, as a list of dictionaries, making it easy to analyze and process the information further.

### Features

- 🔍 Scrape all posts from a specified Substack author.
- 📝 Retrieve each article's content.
- 📋 Results are provided in a structured format (list of dictionaries).
- ⚙️ Customizable options to limit the number of posts and include or exclude article content in the results.

### Input

The actor accepts the following input properties:

- 🕵️ **Author name**: The name of the Substack author whose posts you want to scrape. (Default: "garyvee")
- 🔢 **Limit number of posts**: The number of posts to retrieve. This will get the latest 'n' posts, where 'n' is the specified limit. (Default: 25)
- 📜 **Article content**: A boolean flag to include or exclude the parsed article content in the results. (Default: false)

### Output

The actor will return a JSON array containing information about each scraped post. Each entry in the array will be a dictionary containing the following keys:

- 📌 **title**: The title of the post.
- 🔗 **url**: The URL of the post.
- 👤 **author**: The author's name.
- 🔗 **author\_url**: The URL of the author's Substack profile.
- 📅 **published\_at**: The publication date and time of the post.

If the "Article content" input property is set to `true`, each entry will also include the following key:

- 📝 **body**: A list of content objects representing the structure of the article. Each content object will contain the following keys:
  - 📌 **content\_type**: The type of content (e.g., "h" for heading, "p" for paragraph, "img" for image, "a" for link, "hr" for divider).
  - 🔗 **src**: The source URL for images, videos, or links (optional).
  - 🆔 **level**: The heading level for headings (optional).
  - 📝 **content**: The content of headings and paragraphs (optional).

Example :

```json
[{
  "title": "April 26, 2023 ",
  "subtitle": "",
  "url": "https://heathercoxrichardson.substack.com/p/april-26-2023",
  "author": "heathercoxrichardson",
  "author_url": "https://heathercoxrichardson.substack.com/",
  "published_at": "2023-04-27 08:27:01.142000+00:00"
},
{
  "title": "April 25, 2023",
  "subtitle": "",
  "url": "https://heathercoxrichardson.substack.com/p/april-25-2023",
  "author": "heathercoxrichardson",
  "author_url": "https://heathercoxrichardson.substack.com/",
  "published_at": "2023-04-26 07:47:36.272000+00:00"
}]
```

![image](https://drive.google.com/uc?export=view\&id=1wFqubmvcYfqV3cWykNoDlza9nZCi769c)

### Usage

To use this actor, simply provide the required input properties and run the actor. You can customize the input properties to limit the number of posts or include/exclude the article content in the results as needed.

Once the actor has completed its run, the scraped data will be available in the specified output format, making it easy to analyze, process, or store the information for further use.

### Contact us ?

Any project or questions ?

📧 quentin.payre.entreprise@gmail.com
Telegram @quentinpjf

# Actor input Schema

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

The substack's author name.

## `limit` (type: `integer`):

The number of posts to retrieve. Get the latest <limit> posts

## `article_content` (type: `boolean`):

Include parsed article content in the results.

## Actor input object example

```json
{
  "author": "heathercoxrichardson",
  "limit": 25,
  "article_content": false
}
```

# 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 = {};

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

# Run the Actor and wait for it to finish
run = client.actor("qpayre/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 '{}' |
apify call qpayre/substack-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,qpayre/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/bjkEfbHYzEbx4nwgp/builds/4sfXuVMFOdKhmFQLN/openapi.json
