# Substack Newsletters, Posts & Sponsorship Leads Scraper (`ajengayu89/substack-intelligence-scraper`) Actor

Fast, cookie-free HTTP-first Substack scraper for publications, custom domains, full articles converted to clean RAG-ready Markdown, sponsorship emails/contacts, Incremental Delta Mode, and MCP Standby Mode.

- **URL**: https://apify.com/ajengayu89/substack-intelligence-scraper.md
- **Developed by:** [Ajeng Ayu](https://apify.com/ajengayu89) (community)
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 substack record scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Newsletters, Posts & Sponsorship Leads Scraper

Extract clean, normalized **Substack** publications (including **custom domains** like `lennysnewsletter.com`), full articles converted to **clean AI/RAG-ready Markdown (`bodyMarkdown`)**, subscriber signals, and **auto-extracted sponsorship contacts** — **100% cookie-free**, **HTTP-first** (no Puppeteer/Chromium bloat), and ready for AI agents via **MCP Standby Mode**.

***

### Why Use This Actor?

| Feature | This Actor | `automation-lab/substack-scraper` | `fatihtahta/substack-scraper` | `easyapi/substack-posts-scraper` |
| :--- | :--- | :--- | :--- | :--- |
| **Pricing (PPE)** | **$1.50 / 1,000 items** (Platform usage included) | `$1.15–$2.30 / 1,000` (rising Nov 27) + `$0.005` start | `$1.99 / 1,000` | `$4.99 / 1,000` + `$0.09` start + **extra CU/proxy** |
| **Clean AI/RAG Markdown** | **Yes (`bodyMarkdown`)** with subscribe widgets stripped | HTML/plain text only (no Markdown) | No Markdown | `body_html: null` (preview only) |
| **Custom Domains** | **Yes** (`lennysnewsletter.com`, `stratechery.com`) | Yes | Open bugs returning 0 results | No (search-only) |
| **Sponsorship Contacts** | **Auto-extracted & deduplicated** (`emails`, X, LinkedIn, YouTube, IG) | No | No | No |
| **Incremental / Delta Mode** | **Built-in `KeyValueStore` diffing** (`new` / `updated`) | No | No | No |
| **AI & MCP Standby Mode** | **Native `/mcp` Streamable HTTP server (3 tools)** | No | No | No |

***

### Pay-Per-Event (PPE) Pricing

| Event | Price | Description |
| :--- | :---: | :--- |
| `apify-actor-start` | **$0.005** | Apify built-in system event charged once per Actor run |
| `apify-default-dataset-item` | **$1.50 / 1,000** (`$0.0015` each) | Apify built-in system event charged per publication or post pushed to the dataset (platform usage included) |

***

### Input Configuration

| Field | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `mode` | `string` | `"posts"` | `"posts"`, `"publications"`, or `"all"`. |
| `targets` | `string[]` | `["https://www.lennysnewsletter.com", "AI"]` | Custom domains, `*.substack.com` URLs, keywords, or `category:<id>`. |
| `maxItems` | `integer` | `20` | Maximum total records to push across all targets (`1–10000`). |
| `includeMarkdown` | `boolean` | `true` | Convert full post `body_html` into clean AI/RAG-ready Markdown. |
| `onlyFree` | `boolean` | `false` | Skip paywalled (`only_paid`) posts. |
| `startDate` / `endDate` | `string` | `""` | Optional `YYYY-MM-DD` date filters for posts. |
| `enrichContacts` | `boolean` | `true` | Extract sponsorship emails & deduplicated social URLs. |
| `incrementalMode` | `boolean` | `false` | Emit only `new` or `updated` items since last run via `KeyValueStore`. |
| `stateKey` | `string` | `"substack-delta-state"` | KeyValueStore key for Incremental/Delta state. |
| `proxyConfiguration` | `object` | `{ "useApifyProxy": false }` | Optional Apify Proxy settings. |
| `maxConcurrency` | `integer` | `5` | Parallel HTTP requests (`1–20`). |

***

### Verified Output Examples

#### 1. `publication` Record (`publications` / `all` mode)

```json
{
  "recordType": "publication",
  "id": "https://www.lennysnewsletter.com",
  "publicationId": "https://www.lennysnewsletter.com",
  "subdomain": "lennysnewsletter",
  "customDomain": "lennysnewsletter.com",
  "publicationName": "Lenny's Newsletter",
  "authorName": "Lenny's Newsletter",
  "url": "https://www.lennysnewsletter.com",
  "description": "Deeply researched product, growth, and career advice for product leaders, founders, and ambitious builders. Click to read Lenny's Newsletter, a Substack publication with millions of subscribers.",
  "subscriberSignal": "1,000,000+ subscribers",
  "paidEnabled": false,
  "emails": [],
  "websites": [
    "https://www.lennysproductpass.com/",
    "https://www.lennysjobs.com/",
    "https://docs.google.com/document/d/1o_Szso0-TQAEEBCxKwvLHTm1fzE4BMiSjeYIKOfUYl0/edit"
  ],
  "aiSummary": "Lenny's Newsletter (https://www.lennysnewsletter.com) — 1,000,000+ subscribers. No public emails. Deeply researched product, growth, and career advice for product leaders, founders, and ambitious builders. Click to read Lenny's...",
  "scrapedAt": "2026-11-24T05:45:40.897Z"
}
```

#### 2. `post` Record (`posts` / `all` mode with `bodyMarkdown` + `outboundDomains`)

```json
{
  "recordType": "post",
  "id": "224972682",
  "postId": "224972682",
  "publicationId": "10845",
  "publicationName": "Lenny's Newsletter",
  "publicationUrl": "https://www.lennysnewsletter.com",
  "slug": "35-premium-tools-free-for-a-yearnow",
  "title": "35 premium tools free for a year—now with OpenRouter, LangChain, Sentry, TextExpander, and Ploy 💥",
  "subtitle": "Over $40,000 in value, exclusively for Lenny’s Newsletter subscribers",
  "postType": "newsletter",
  "audience": "everyone",
  "isPaid": false,
  "isPaywalled": false,
  "wordCount": 1758,
  "readingTimeMinutes": 8,
  "reactionCount": 228,
  "commentCount": 15,
  "restacks": 2,
  "authors": ["Lenny Rachitsky"],
  "tags": [],
  "outboundDomains": [
    "docs.google.com",
    "lennysproductpass.com",
    "openrouter.ai",
    "ploy.ai",
    "sentry.io",
    "textexpander.com",
    "langchain.com",
    "linkedin.com",
    "x.com",
    "g2.com",
    "youtube.com"
  ],
  "language": "en",
  "url": "https://www.lennysnewsletter.com/p/35-premium-tools-free-for-a-yearnow",
  "bodyMarkdown": "### 1. [OpenRouter](http://openrouter.ai/lenny)\n\n**What you get:** One year of no platform or BYOK fees and $100 in OpenRouter credits ($650 value)...",
  "emails": [],
  "aiSummary": "\"35 premium tools free for a year—now with OpenRouter, LangChain, Sentry...\" in Lenny's Newsletter (Free, 1758 words, 228 likes). Over $40,000 in value, exclusively for Lenny’s Newsletter subscribers",
  "publishedAt": "2026-11-17T18:02:02.477Z",
  "scrapedAt": "2026-11-24T05:45:41.721Z"
}
```

***

### MCP Standby Mode (AI Agents, Claude, Cursor & n8n)

This Actor supports Apify **Standby Mode** over Streamable HTTP at `/mcp` and exposes 3 tools:

1. `search_substack_publications` — Search Substack newsletters by keyword and return subscriber signals & contacts.
2. `get_substack_posts` — Fetch recent posts from any Substack or custom domain with clean RAG-ready Markdown.
3. `extract_substack_sponsors` — Batch-extract sponsorship emails & social links across publications or keywords.

#### Claude Desktop / Cursor MCP Client Config

```json
{
  "mcpServers": {
    "substack-intelligence": {
      "url": "https://<your-actor-standby-url>.apify.actor/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_APIFY_API_TOKEN>"
      }
    }
  }
}
```

# Actor input Schema

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

What to extract: 'publications' (newsletter profiles, subscriber badges & sponsorship contacts), 'posts' (articles + clean Markdown), or 'all' (both).

## `targets` (type: `array`):

Mix Substack URLs (https://stratechery.com or https://example.substack.com), custom domains (lennysnewsletter.com), bare slugs ('lenny'), keywords ('AI'), or leaderboard categories ('category:4').

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

Maximum total records to push to the dataset across all targets.

## `includeMarkdown` (type: `boolean`):

Fetches full post body_html and converts it into clean Markdown (`bodyMarkdown`) with subscribe widgets and script noise stripped.

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

Skip paywalled posts (`audience: only_paid`) when scraping posts.

## `startDate` (type: `string`):

Optional inclusive lower date bound for posts (e.g. 2026-01-01).

## `endDate` (type: `string`):

Optional inclusive upper date bound for posts (e.g. 2026-12-31).

## `enrichContacts` (type: `boolean`):

Parses /about pages, \_preloads metadata, and post footers for sponsorship emails, X/Twitter, LinkedIn, YouTube, Instagram, and external websites.

## `incrementalMode` (type: `boolean`):

Only emit new or updated publications/posts since the last run using Apify KeyValueStore state tracking.

## `stateKey` (type: `string`):

KeyValueStore record key used to persist Incremental/Delta hashes between runs.

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

Optional Apify Proxy settings. Public Substack JSON endpoints work cookie-free without proxies for moderate runs.

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

Maximum parallel HTTP requests.

## Actor input object example

```json
{
  "mode": "posts",
  "targets": [
    "https://www.lennysnewsletter.com",
    "AI"
  ],
  "maxItems": 20,
  "includeMarkdown": true,
  "onlyFree": false,
  "enrichContacts": true,
  "incrementalMode": false,
  "stateKey": "substack-delta-state",
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "maxConcurrency": 5
}
```

# Actor output Schema

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

Normalized Substack publication profiles, sponsorship contacts, and full articles with clean RAG-ready Markdown.

## `deltaState` (type: `string`):

Key-Value Store record tracking seen publication/post hashes when Incremental/Delta Mode is enabled.

# 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 = {
    "targets": [
        "https://www.lennysnewsletter.com",
        "AI"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ajengayu89/substack-intelligence-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 = { "targets": [
        "https://www.lennysnewsletter.com",
        "AI",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ajengayu89/substack-intelligence-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 '{
  "targets": [
    "https://www.lennysnewsletter.com",
    "AI"
  ]
}' |
apify call ajengayu89/substack-intelligence-scraper --silent --output-dataset

```

## MCP server setup

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