# Substack Scraper: Posts, Comments, Search & Sponsors (`matidepa22/substack-scraper`) Actor

Scrape any Substack newsletter or search all of Substack by keyword. Get full post text, likes, comments, restacks, author and publication data, plus the sponsors in each issue. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/matidepa22/substack-scraper.md
- **Developed by:** [Matias De Pascuale](https://apify.com/matidepa22) (community)
- **Categories:** Social media, News, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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.

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 & Newsletter Sponsor Finder

Scrape posts from any Substack newsletter — including custom domains — or **search all of Substack by keyword**, and see **who sponsors them**.

For every post you get the title, date, likes, comments, restacks, paywall status and the **companies sponsoring it** ("Brought to you by…", "Sponsored by…"). A summary ranks every sponsor across all the newsletters you scraped.

### Who uses it

- **Brands & agencies** — find newsletters your competitors sponsor, and how often.
- **Newsletter writers** — build a sponsor prospect list from newsletters in your niche.
- **Researchers & investors** — track engagement and posting cadence of top newsletters.
- **Content teams** — export full archives, or every post on a topic, for analysis or AI summarization.
- **Trend research** — search a keyword to see which newsletters cover it and which posts get the most engagement.

### Example

Scraping the latest 8 posts of three tech newsletters (September 2026):

| Newsletter | Sponsored posts | Sponsors found |
|---|---|---|
| Not Boring | 63% | Reducto, Jack & Jill, Arena Magazine |
| The Pragmatic Engineer | 38% | turbopuffer, Antithesis, Entire, Linear, WorkOS |
| Lenny's Newsletter | 0% | — |

### Input

```json
{
  "publications": ["https://www.notboring.co", "platformer", "newsletter.pragmaticengineer.com"],
  "maxPostsPerPublication": 50,
  "since": "2026-01-01",
  "detectSponsors": true,
  "includeContent": false
}
```

Newsletters can be given as a URL, a `name.substack.com` subdomain or just the handle.

#### Search by keyword

Don't know which newsletters to scrape? Search all of Substack instead:

```json
{
  "searchQueries": ["AI agents", "personal finance"],
  "maxPostsPerQuery": 50
}
```

Each result includes `matchedQuery`, plus the same metrics and sponsor detection. You can combine `publications` and `searchQueries` in one run; duplicate posts are skipped.

### Output

**Dataset** — one row per post:

```json
{
  "publication": "Not Boring by Packy McCormick",
  "title": "Weekly Dose of Optimism #212",
  "url": "https://www.notboring.co/p/weekly-dose-of-optimism-212",
  "postDate": "2026-09-25T12:36:02.277Z",
  "audience": "only_paid",
  "isPaywalled": true,
  "wordcount": 3190,
  "reactions": 68,
  "comments": 0,
  "restacks": 1,
  "hasSponsor": true,
  "sponsors": [
    {
      "name": "Jack & Jill",
      "domain": "jackandjill.ai",
      "url": "https://jackandjill.ai/jill?utm_source=notboring"
    }
  ]
}
```

Set **Include full post text** to add `contentText` (for paywalled posts, only the free preview).

**`SUMMARY` record** — per newsletter: posts scraped, average likes and comments, share of paywalled and sponsored posts, sponsor list. Plus a **sponsor leaderboard** ranked by how many newsletters and posts each sponsor appears in.

### Pricing

**$0.003 per post** ($3 per 1,000 posts). Posts that fail to load are saved with the error and not charged. Set a maximum cost per run and the Actor stops before exceeding it.

### How sponsor detection works

The Actor looks for sponsor phrases ("Brought to you by", "Sponsored by", "Today's sponsor", "Presented by", "In partnership with"…) in headings or bold text, then collects the external links in that section, ignoring Substack, social networks and image hosts. Links from the same company are merged (`pages.acme.com` + `acme.com`).

It's accurate for classic sponsor blocks. It can miss sponsors mentioned only in plain prose without a link, and occasionally flag a cross-promotion as a sponsor.

### FAQ

**Does it need a login or cookies?** No. It uses Substack's public endpoints, the same ones the website uses.

**Can it get paid posts?** It returns metadata for all posts. Full text is only available for free posts (paid posts include the free preview). Sponsor blocks usually sit at the top, so they're detected on paid posts too.

**Custom domains?** Yes — e.g. `www.lennysnewsletter.com` works the same as `lenny.substack.com`.

# Actor input Schema

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

Specific newsletters to scrape. Use the URL (https://www.notboring.co), the subdomain (platformer.substack.com) or just the handle (platformer). Optional if you use search.

## `searchQueries` (type: `array`):

Find posts about a topic across all of Substack, e.g. "AI agents" or "personal finance". Results come from Substack's own search, most relevant first.

## `maxPostsPerQuery` (type: `integer`):

How many matching posts to return for each search query.

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

Newest posts first. Use a high number to get the whole archive.

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

Optional date (YYYY-MM-DD). Older posts are skipped.

## `detectSponsors` (type: `boolean`):

Find companies sponsoring each post ("Brought to you by…", "Sponsored by…"). Also works on paywalled posts, since sponsor blocks are usually in the free preview.

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

Add the post body as plain text. For paywalled posts only the free preview is available.

## `maxConcurrency` (type: `integer`):

Posts fetched in parallel per newsletter.

## Actor input object example

```json
{
  "publications": [
    "https://www.notboring.co",
    "https://newsletter.pragmaticengineer.com"
  ],
  "maxPostsPerQuery": 20,
  "maxPostsPerPublication": 20,
  "detectSponsors": true,
  "includeContent": false,
  "maxConcurrency": 3
}
```

# Actor output Schema

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

One row per post with engagement metrics and detected sponsors.

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

Per-newsletter averages and share of sponsored posts, plus every sponsor ranked by how many newsletters and posts it appears in.

# 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.notboring.co",
        "https://newsletter.pragmaticengineer.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("matidepa22/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 = { "publications": [
        "https://www.notboring.co",
        "https://newsletter.pragmaticengineer.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("matidepa22/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 '{
  "publications": [
    "https://www.notboring.co",
    "https://newsletter.pragmaticengineer.com"
  ]
}' |
apify call matidepa22/substack-scraper --silent --output-dataset

```

## MCP server setup

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