# Substack Scraper: Export Newsletter Posts (`veenkes/veenkes-substack-posts`) Actor

Scrape posts from any Substack newsletter, including custom domains: title, URL, date, free or paid, authors, tags, likes, comments, restacks, word count and full text of free posts. Export to CSV or JSON. No login.

- **URL**: https://apify.com/veenkes/veenkes-substack-posts.md
- **Developed by:** [veenkes](https://apify.com/veenkes) (community)
- **Categories:** News, Lead generation, Social media
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 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.
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 Scraper: Export Newsletter Posts

A **Substack scraper** to **export newsletter posts** from any publication, including custom domains. You get the title, URL, date, free or paid flag, authors, tags, likes, comments, restacks, word count and, optionally, the full plain text of free posts.

No Substack account or API key. Paywalled bodies are never accessed.

### What can this Substack scraper do?

- 📰 **Many newsletters in one run.** Use a subdomain (`lenny`), a hostname (`lenny.substack.com`), a custom domain (`https://www.lennysnewsletter.com`) or any post URL.
- 📅 **Monitor new posts.** Set *Posts since* and the run stops as soon as it reaches older posts. Schedule it daily for cheap monitoring.
- 💸 **Free vs paid filter.** Find out how much of a newsletter is paywalled, or keep only free posts.
- 📈 **Engagement metrics.** Likes, comments, restacks and word count for every post.
- 🧠 **Full text of free posts** as clean plain text, ready for LLM summaries, RAG, topic modelling and research.
- 🤖 **AI-agent ready.** Flat JSON that works with the Apify MCP server, LangChain, n8n, Make and Zapier.

### What data can I extract from Substack?

| Field | Example |
|---|---|
| `publicationUrl` | `https://www.lennysnewsletter.com` |
| `title` / `subtitle` | `State of the tech job market: late 2026` |
| `url` | `https://www.lennysnewsletter.com/p/state-of-the-tech-job-market-late` |
| `publishedAt` | `2026-11-10T15:04:03.497Z` |
| `type` | `newsletter`, `podcast`, `thread` |
| `audience` | `free` or `paid` |
| `authors` | `[{ "name": "Lenny Rachitsky", "handle": "lenny" }]` |
| `tags`, `section` | `["Career"]` |
| `likes`, `comments`, `restacks` | `323`, `33`, `30` |
| `wordCount` | `2183` |
| `description`, `previewText` | public teaser text |
| `contentText` | full plain text, free posts only, when enabled |
| `coverImage`, `podcastUrl` | media links |

### How to scrape Substack posts

1. Click **Try for free**.
2. Add one or more newsletters to **Publications**.
3. Set **Max posts per publication** and, optionally, **Posts since**.
4. Choose an **Audience** filter and whether to **Include full text of free posts**.
5. Click **Start**, then download JSON, CSV, Excel or HTML, or read the results through the Apify API.

### Run it from the API

You can start this Actor from any language with the official [Apify API client](https://docs.apify.com/api/client/python). Replace `YOUR_APIFY_TOKEN` with a token from [Apify Console > Integrations](https://console.apify.com/account/integrations). Never put the token in a public repo.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("veenkes/veenkes-substack-posts").call(run_input={
    "publications": [
        "https://www.lennysnewsletter.com"
    ],
    "maxPostsPerPublication": 50,
    "includeContent": False
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('veenkes/veenkes-substack-posts').call({
    "publications": [
        "https://www.lennysnewsletter.com"
    ],
    "maxPostsPerPublication": 50,
    "includeContent": false
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

Schedule the Actor, send results to a webhook, or connect it in Zapier, Make or n8n. Store page: <https://apify.com/veenkes/veenkes-substack-posts>.

### Use from AI agents (Apify MCP)

AI agents can run this Actor through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). Connect Claude, Cursor or any MCP-compatible client to Apify, then ask the agent to call `veenkes/veenkes-substack-posts` with an input like the example above. The agent discovers the tool from the Actor title and description.

### How much does it cost?

Pay per result, with platform usage included. The price depends on your Apify plan tier:

| Event | FREE tier | BRONZE | SILVER | GOLD and above |
|---|---|---|---|---|
| Post scraped (metadata), per 1,000 | $1.50 | $1.00 | $0.90 | $0.80 |
| Full text of a free post (only when enabled), per 1,000 | $1.00 | $0.80 | $0.70 | $0.60 |
| Actor start, per run (per GB of memory, 1 at default memory) | $0.00005 | $0.00005 | $0.00005 | $0.00005 |

For example, a full archive of 300 posts costs about **$0.30** at the BRONZE tier, or about $0.54 if every post is free and you include full text. On the FREE tier the same run costs about $0.45, or $0.75 with full text. Set *Maximum cost per run* and the Actor stops cleanly at your budget.

### Input example

```json
{
    "publications": ["https://www.lennysnewsletter.com", "astralcodexten"],
    "maxPostsPerPublication": 100,
    "since": "2026-01-01",
    "audience": "all",
    "includeContent": true
}
```

### Output example

```json
{
    "publicationUrl": "https://www.lennysnewsletter.com",
    "postId": 224206488,
    "title": "State of the tech job market: late 2026",
    "subtitle": "PMs are winning, engineers are plateauing, designers are hurting…",
    "url": "https://www.lennysnewsletter.com/p/state-of-the-tech-job-market-late",
    "publishedAt": "2026-11-10T15:04:03.497Z",
    "type": "newsletter",
    "audience": "paid",
    "authors": [{ "name": "Lenny Rachitsky", "handle": "lenny" }],
    "tags": ["Career"],
    "section": null,
    "wordCount": 2183,
    "likes": 323,
    "comments": 33,
    "restacks": 30,
    "previewText": "👋 Hey there, I’m Lenny…",
    "coverImage": "https://substackcdn.com/image/fetch/…",
    "scrapedAt": "2026-11-12T20:30:00.000Z"
}
```

A run summary (posts saved per publication and errors) is stored in the key-value store under `SUMMARY`.

### Use cases

- **Sponsorship prospecting:** rank newsletters in a niche by likes, comments and posting frequency before you buy an ad slot.
- **Competitor and content research:** see which topics and formats get the most engagement.
- **Trend tracking:** monitor dozens of newsletters daily with *Posts since*.
- **AI and RAG:** feed free posts into a vector database or summarise them with an LLM.
- **Investor and market research:** follow analysts and industry newsletters in one dataset.

### Why this one?

One Actor covers both `*.substack.com` sites and custom domains, and returns engagement (likes, comments, restacks) in a single schema. Full text is optional and charged only for free posts you choose to include, so you can inventory a newsletter cheaply and pull content only when you need it.

### FAQ

**Is it legal to scrape Substack?**
The Actor reads only publicly available post metadata and posts that authors made free. It never bypasses paywalls. Post texts are copyrighted by their authors, so don't republish them without permission, and follow the laws that apply to you.

**Does it work with custom domains?**
Yes. Paste the newsletter's homepage or any post URL.

**Can I get paid posts' full text?**
No. For paid posts you get only the public metadata and preview.

**Something broke?**
Open an issue on the **Issues** tab. Fixes usually ship within 1–2 days.

***

*This Actor is not affiliated with, endorsed by, or sponsored by Substack Inc.*

### Integrations

- **Apify API** — Python and JavaScript clients (examples above), plus a REST API.
- **AI agents** — run it via the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).
- **Automation tools** — Zapier, Make, n8n, or an Apify webhook when a run finishes.
- **Export** — download the dataset as JSON, CSV, Excel or XML, or load it from a scheduled run.

[Open the Actor in Apify Store](https://apify.com/veenkes/veenkes-substack-posts).

# Actor input Schema

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

Substack publication URLs (including custom domains) or individual post URLs, for example https://www.lennysnewsletter.com.

## `maxPostsPerPublication` (type: `integer`):

Maximum posts to save per publication.

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

Only posts published on or after this date. The run stops early when it reaches older posts.

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

Filter by free or paywalled posts. Paid posts include only public metadata and preview.

## `includeContent` (type: `boolean`):

If enabled, add plain-text content for free posts (billed as a separate content event). Paywalled bodies are never accessed.

## Actor input object example

```json
{
  "publications": [
    "https://www.lennysnewsletter.com"
  ],
  "maxPostsPerPublication": 10,
  "audience": "all",
  "includeContent": false
}
```

# Actor output Schema

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

No description

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

No description

# 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": [
        "https://www.lennysnewsletter.com"
    ],
    "maxPostsPerPublication": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("veenkes/veenkes-substack-posts").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": ["https://www.lennysnewsletter.com"],
    "maxPostsPerPublication": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("veenkes/veenkes-substack-posts").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": [
    "https://www.lennysnewsletter.com"
  ],
  "maxPostsPerPublication": 10
}' |
apify call veenkes/veenkes-substack-posts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,veenkes/veenkes-substack-posts"
        }
    }
}
```

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/4ZPEeywXwKJOFRb1K/builds/HSJ4HGLMSloudaabq/openapi.json
