# Substack Scraper (`vashiiq/substack`) Actor

Substack posts with likes, comments and paywall flag for any newsletter, full archives, and newsletter discovery by keyword.

- **URL**: https://apify.com/vashiiq/substack.md
- **Developed by:** [anthony leblanc](https://apify.com/vashiiq) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 results

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 Scraper

Get Substack posts as clean rows with likes, comments, restacks, word count and a paywall flag, for any newsletter’s full archive. Or discover newsletters about a topic.

### What it does

- Reads each newsletter’s public archive, newest first (works with custom domains too).
- Flags paywalled posts; it never reads paid content.
- Filters by a posted-since date and limits posts per newsletter.
- Discover mode finds newsletters matching a search term, with description, language and whether they have a paid tier.
- Fixes the broken characters (like â€™) that appear in some Substack text.

**Why this one:** Full archives with likes, comments, restacks and a paywall flag, a posted-since filter, newsletter discovery by keyword, and clean text (fixes broken characters).

In our last check, 20 runs over varied inputs succeeded 100% of the time.

### Use cases

- Tracking what top newsletters in your field publish and what gets engagement
- Finding newsletters for sponsorships, guest posts or research
- Building a reading list or archive of a publication’s free posts

### Input example

```json
{
  "publications": [
    "https://www.lennysnewsletter.com",
    "https://www.noahpinion.blog"
  ],
  "postsPerPublication": 3,
  "maxItems": 6
}
```

- mode: posts or discover
- publications: names or URLs
- searchTerm: discover newsletters by topic
- postsPerPublication, postedSince

### Output sample

Real results from a run of this Actor:

```json
[
  {
    "publication": "https://www.lennysnewsletter.com",
    "title": "How to tell if a startup has a moat",
    "subtitle": "A framework for assessing whether the company you’re considering joining is built to last",
    "url": "https://www.lennysnewsletter.com/p/how-to-tell-if-a-startup-has-a-moat",
    "postedAt": "2026-10-13T12:45:41.160Z",
    "type": "newsletter",
    "audience": "only_paid",
    "isPaywalled": true,
    "likes": 372,
    "comments": 2,
    "restacks": 21,
    "wordCount": 4153,
    "authors": [
      "Dan Hockenmaier"
    ],
    "sourceUrl": "https://www.lennysnewsletter.com",
    "scrapedAt": "2026-10-27T19:58:45.840Z"
  },
  {
    "publication": "https://www.lennysnewsletter.com",
    "title": "All of the Lenny & Friends Summit talks are now online!",
    "subtitle": "Plus, some reflections and takeaways from the day",
    "url": "https://www.lennysnewsletter.com/p/all-of-the-lenny-and-friends-summit",
    "postedAt": "2026-09-29T13:15:57.512Z",
    "type": "newsletter",
    "audience": "everyone",
    "isPaywalled": false,
    "likes": 292,
    "comments": 8,
    "restacks": 5,
    "wordCount": 1276,
    "authors": [
      "Lenny Rachitsky"
    ],
    "sourceUrl": "https://www.lennysnewsletter.com",
    "scrapedAt": "2026-10-27T19:58:45.840Z"
  }
]
```

**Fields:**

- Posts: publication, title, subtitle, url, postedAt, type, audience, isPaywalled, likes, comments, restacks, wordCount, authors
- Discover: name, url, subdomain, description, language, paidSubscriptions, createdAt, author

### Pricing

Pay per result: **$3.00 per 1,000 results**. You pay only for results you get; Apify platform costs are included. Set a maximum charge for a run and the Actor stops cleanly when it's reached, keeping everything collected so far.

### Tips

- Use the newsletter’s own URL if it has a custom domain (e.g. https://www.lennysnewsletter.com).
- If a site redirects away or returns nothing, it may have moved off Substack.

### FAQ

**Do I need an account on Substack?** No. It only reads public pages and data.

**Does it get the full text of paid posts?** No. It returns post details and the paywall flag, never paid content.
**Something broke or a field is missing?** Open an issue on the Issues tab and include your run link. We fix scrapers quickly when sites change.

### Legal

This Actor collects publicly available data only. You're responsible for using it lawfully and in line with Substack's terms.

# Actor input Schema

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

Posts: the archive of each publication. Discover: newsletters matching a search term.

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

Substack names or URLs, e.g. lenny, https://www.noahpinion.blog or https://www.lennysnewsletter.com.

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

Find newsletters about a topic. In posts mode, also pulls posts from the top matches.

## `postsPerPublication` (type: `integer`):

Newest first. Raise it to get the full archive.

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

Only posts on or after this date (YYYY-MM-DD).

## `maxItems` (type: `integer`):

Stop after this many rows. You are only charged for rows you get.

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

Datacenter proxy helps if Substack rate-limits you.

## Actor input object example

```json
{
  "mode": "posts",
  "publications": [
    "https://www.lennysnewsletter.com"
  ],
  "postsPerPublication": 50,
  "maxItems": 500,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Posts (or newsletters in discover mode), one row each.

# 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"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("vashiiq/substack").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"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("vashiiq/substack").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"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call vashiiq/substack --silent --output-dataset

```

## MCP server setup

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

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/4DvuvU8XcCJevRiw4/builds/zVVCZfqXexeL6QB0P/openapi.json
