# Substack Newsletter Posts Scraper (`datadrift-labs/substack-publication-posts`) Actor

Get posts from any Substack newsletter: title, subtitle, date, free or paid, authors, tags, word count, likes, comments, restacks and the full text of free posts. Works with custom domains. Ideal for content research, newsletter analytics and AI datasets.

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

## Pricing

Pay per event

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?

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 Newsletter Posts Scraper

Get posts from any Substack newsletter as structured data: title, subtitle, date, free or paid, authors, tags, word count, likes, comment count, restacks, cover image, and the **full text of free posts**. Works with custom domains (like `lennysnewsletter.com`) and `name.substack.com` addresses.

### What you can use it for

- **Content and topic research:** see what top newsletters in your niche publish and which posts get the most likes and comments.
- **Newsletter analytics:** track posting frequency, free vs paid mix and engagement over time.
- **Monitoring:** schedule a daily run with "Posted within the last 1 day" to collect new posts from a list of newsletters.
- **AI datasets and RAG:** clean full text of free posts for search, summarisation and analysis.

### Input

Paste publication links or names, one per line:

- `https://www.lennysnewsletter.com` (custom domain)
- `https://astralcodexten.substack.com`
- `astralcodexten` (just the name)

Optional: posted within the last N days, free posts only, include full text, maximum posts per publication.

### Sample output

```json
{
  "publication": "https://www.lennysnewsletter.com",
  "postId": "208730073",
  "title": "Announcing Lenny’s Jobs: The best place in the world to find, vet, and land your dream job",
  "subtitle": "Where product managers, engineers, designers, and growth/marketing professionals discover high-quality open roles at tech companies",
  "url": "https://www.lennysnewsletter.com/p/announcing-lennys-jobs-the-best-place",
  "postDate": "2026-08-18T15:40:06.921Z",
  "type": "newsletter",
  "audience": "everyone",
  "isPaid": false,
  "authors": [
    "Lenny Rachitsky"
  ],
  "section": null,
  "tags": [
    "Career"
  ],
  "wordcount": 933,
  "reactionCount": 388,
  "commentCount": 17,
  "restacks": 9,
  "coverImage": "https://substackcdn.com/image/fetch/$s_!PFZn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f696879-6374-42d6-a171-47933f6eb126_1456x970.png",
  "description": "Where product managers, engineers, designers, and growth/marketing professionals discover high-quality open roles at tech companies",
  "preview": "👋 Hey there, I’m Lenny. Each week, I share deeply researched product, growth, and career advice. For more: Lenny’s Jobs | Lenny’s Podcast |...",
  "content": "👋 Hey there, I’m Lenny. Each week, I share deeply researched product, growth, and career advice. For more: Lenny’s Jobs | Lenny’s Podcast |...",
  "podcastDurationSeconds": null,
  "scrapedAt": "2026-10-24T00:16:00.049Z"
}
```

### Pricing

**$2.00 per 1,000 posts** saved, plus a tiny per-run start fee. Set a spending limit for each run; the run stops cleanly when it is reached.

### How it works and limits

The Actor reads each publication's public archive, the same list readers see on the newsletter's Archive page. It does not log in or use any account.

- **Paid posts:** only the public preview is returned. The Actor never accesses content behind the paywall.
- **Comments:** not collected; only the comment count is returned.
- **Subscriber emails and other personal data:** never collected.

Publications that are not on Substack are skipped with a note in the log, and you are not charged for them.

### Support

Found a problem or need another field? Open an issue on the **Issues** tab. Issues are answered quickly.

# Actor input Schema

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

Publication links or names, one per line: a custom domain (https://www.lennysnewsletter.com), a Substack address (https://astralcodexten.substack.com) or just the name (astralcodexten).

## `postedWithinDays` (type: `integer`):

Keep only posts from the last N days. Leave empty for the whole archive.

## `onlyFree` (type: `boolean`):

Skip posts that are for paid subscribers.

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

Add the full text of free posts. Paid posts always show only the public preview.

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

Stop after this many posts from each publication. Leave empty for no limit.

## `maxResults` (type: `integer`):

Stop after this many posts in total. You pay only for posts saved.

## Actor input object example

```json
{
  "publications": [
    "https://www.lennysnewsletter.com"
  ],
  "onlyFree": false,
  "includeContent": true,
  "maxResults": 1000
}
```

# Actor output Schema

## `overview` (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"
    ]
};

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

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

```

## MCP server setup

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