Substack Newsletter & Archive Scraper (Markdown)
Pricing
from $1.05 / 1,000 substack posts
Substack Newsletter & Archive Scraper (Markdown)
Fetch public Substack archives and custom domains via JSON API or RSS fallback without login cookies. Outputs engagement counts, paywall flags, clean Markdown full text, and unwrapped external outbound links.
Pull public Substack publication archives from /api/v1/archive JSON (with automatic /feed RSS XML fallback on custom domains where archive JSON is restricted) across .substack.com subdomains, substack.com/@handle URLs, bare handles, and custom Substack domains like lennysnewsletter.com. No login cookies, browsers, or proxies are needed.
Each post record combines structured metadata (publicationName, reactionCount, commentCount, restackCount, wordCount, audience, isPaywalled, authorNames, coverImage, podcastUrl) with clean GitHub-Flavored Markdown and unwrapped external outboundLinks.
Use cases
- Build incremental daily or weekly newsletter RAG indexes using
postedWithinDays: 2orpublishedAfterso older archive pages are skipped before fetching full HTML or billing. - Track newsletter sponsors and cited tools across a roster of industry publications by analyzing unwrapped
outboundLinks. - Benchmark top-performing essays (
sort: "top") by comparingreactionCount,commentCount,restackCount,wordCount, andisPaywalledratios. - Archive public essays from custom-domain Substack writers into Notion, Airtable, or
pgvectorin clean Markdown.
Input options
| Parameter | Type | Default | Description |
|---|---|---|---|
publications | string[] | (required) | Substack URLs, custom domains, substack.com/@handle, or bare handles. |
sort | string | "new" | Archive order: "new" (chronological) or "top" (highest-performing). |
maxPostsPerPublication | integer | 25 | Max posts per publication (0-1000; 0 fetches up to 1,000). |
postedWithinDays | integer | 0 | Rolling recency cutoff in days (0-3650; 0 disables). |
publishedAfter | string | "" | UTC start date in YYYY-MM-DD format (filtered before billing). |
freePostsOnly | boolean | false | Skip paywalled (only_paid / founding) posts. |
searchQuery | string | "" | Case-insensitive keyword match (title/subtitle, plus body when includeFullText: true). |
includeFullText | boolean | true | Extract clean markdownText and unwrapped outboundLinks. |
concurrency | integer | 3 | Concurrent publication workers (1-8). |
Example input
{"publications": ["https://www.lennysnewsletter.com","pragmaticengineer"],"sort": "new","maxPostsPerPublication": 15,"postedWithinDays": 30,"includeFullText": true,"freePostsOnly": false,"concurrency": 3}
Output structure
{"publicationName": "Lenny's Newsletter","publicationUrl": "https://www.lennysnewsletter.com","postId": "159823412","title": "How to tell if a startup has a moat","subtitle": "Frameworks from top product leaders.","slug": "how-to-tell-if-a-startup-has-a-moat","canonicalUrl": "https://www.lennysnewsletter.com/p/how-to-tell-if-a-startup-has-a-moat","publishedAt": "2026-11-15T14:12:08.000Z","audience": "everyone","isPaywalled": false,"type": "newsletter","wordCount": 2410,"reactionCount": 402,"commentCount": 28,"restackCount": 19,"authorNames": ["Lenny Rachitsky"],"coverImage": "https://substackcdn.com/image/fetch/f_auto,q_auto:good/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fmoat-cover.png","podcastUrl": null,"markdownText": "## Key Takeaways\n\n- Distribution compounds faster than isolated feature launches.","outboundLinks": ["https://example.org/saas-retention-benchmark"],"source": "archive_api","scrapedAt": "2026-11-24T18:04:51.209Z"}
Field reference
| Field | Type | Description |
|---|---|---|
publicationName | string | Resolved publication title (falls back to handle or RSS channel title). |
publicationUrl | string | Normalized publication origin URL. |
postId | string | Substack post ID or RSS GUID. |
title | string | Post headline. |
subtitle | string | null | Post subtitle or plain-text RSS summary. |
slug | string | Post URL slug after /p/. |
canonicalUrl | string | Direct post URL. |
publishedAt | string | null | ISO 8601 UTC publication timestamp. |
audience | string | "everyone", "only_paid", or "founding". |
isPaywalled | boolean | true for subscriber-only or founding posts. |
type | string | "newsletter", "podcast", or "thread". |
wordCount | number | null | Post word count. |
reactionCount | number | null | Total reactions (null on RSS fallback). |
commentCount | number | null | Total comments (null on RSS fallback). |
restackCount | number | null | Total Notes restacks (null on RSS fallback). |
authorNames | string[] | Bylines or RSS <dc:creator> names. |
coverImage | string | null | Featured cover image URL. |
podcastUrl | string | null | Audio enclosure URL when present. |
markdownText | string | null | Clean Markdown body (null if includeFullText: false). |
outboundLinks | string[] | Unwrapped external links with Substack CDN and image links excluded. |
source | string | "archive_api" or "rss_feed". |
scrapedAt | string | ISO 8601 UTC extraction timestamp. |
Archive fetching, link hygiene & limits
Full post HTML downloads in parallel waves of 4 per archive page while preserving chronological order, per-publication limits, and budget caps. Subscribe forms, share dialogs, paywall widgets, and button wrappers are removed prior to Markdown conversion. Inside outboundLinks, substack.com/redirect/... wrappers decode to their real destination URL while self-links, substack.com, substackcdn.com, *.substackcdn.com, substack-post-media.s3.amazonaws.com, and <a class="image-link"> lightboxes are dropped so only editorial and sponsor links remain. Real publication titles (such as "Lenny's Newsletter") are extracted directly from archive byline metadata.
On Apify Cloud (256 MB memory), a 3-post full-text run completed in 2.69 s at 92.0 MB peak RAM (128 MB minimum memory). Posts stream to the dataset without buffering entire archives in RAM, responses cap at 5 MB with 15-second timeouts and capped Retry-After backoff on 429/5xx, DNS-level SSRF checks run across inputs and redirects, and OUTPUT flushes cleanly on abort.
This Actor never uses login cookies or bypasses paywalls, does not extract Substack Notes, subscriber rosters, or nested comment trees, and targets Substack publications only (for Ghost, Beehiiv, or ConvertKit sites, use Fast Website & Sitemap Markdown Crawler for AI/RAG or Google News & Universal RSS/Atom Feed Scraper).
Pay-Per-Event pricing
Pay-Per-Event billing on apify-default-dataset-item with $0 actor-start fee and $0 proxy fees. Skipped paywalled posts, date-filtered posts, and failed publications are never charged.
| Event (Apify Store Label) | Free / 1k | Bronze (-10%) | Silver (-20%) | Gold+ (-30%) |
|---|---|---|---|---|
| Substack post | $1.50 | $1.35 | $1.20 | $1.05 |
Gold+ includes Gold, Platinum, and Diamond plans (all -30%, or $0.00105 per post). Apify's $5 monthly free credit covers 3,333 Substack posts/month on the Free plan.
MCP setup
Claude Code
claude mcp add --transport http apify-substack \"https://mcp.apify.com/?tools=tsun_tsun/substack-intelligence-scraper" \--header "Authorization: Bearer $APIFY_TOKEN"
Claude Desktop, Cursor & Windsurf
{"mcpServers": {"apify-substack": {"url": "https://mcp.apify.com/?tools=tsun_tsun/substack-intelligence-scraper","headers": {"Authorization": "Bearer YOUR_APIFY_TOKEN"}}}}
Client SDKs & cURL
JavaScript / TypeScript (apify-client)
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('tsun_tsun/substack-intelligence-scraper').call({publications: ['https://www.lennysnewsletter.com', 'pragmaticengineer'],postedWithinDays: 14,maxPostsPerPublication: 10,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items[0].publicationName, items[0].title, items[0].reactionCount);
Python (apify-client)
import osfrom apify_client import ApifyClientclient = ApifyClient(os.environ["APIFY_TOKEN"])run = client.actor("tsun_tsun/substack-intelligence-scraper").call(run_input={"publications": ["https://www.lennysnewsletter.com"],"publishedAfter": "2026-11-01","maxPostsPerPublication": 10,})items = client.dataset(run["defaultDatasetId"]).list_items().itemsprint(len(items), items[0]["canonicalUrl"])
cURL
curl -X POST "https://api.apify.com/v2/acts/tsun_tsun~substack-intelligence-scraper/run-sync-get-dataset-items" \-H "Authorization: Bearer $APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"publications": ["pragmaticengineer"],"postedWithinDays": 14,"maxPostsPerPublication": 5}'
Frequently asked questions
How do postedWithinDays and publishedAfter behave if both are provided?
The stricter (more recent) cutoff wins. Under sort: "new", pagination halts as soon as an entire 12-item archive page falls older than the cutoff, and skipped posts never download full HTML or incur dataset charges.
What data is returned for paywalled subscriber-only posts?
When freePostsOnly: false (default), paywalled posts (isPaywalled: true) return full public metadata, engagement counts, coverImage, and whatever public preview text Substack serves before the paywall cutoff. Set freePostsOnly: true to skip paid posts completely at $0.
Why do some custom domains show source: "rss_feed" with null engagement counts?
If a custom Substack domain blocks /api/v1/archive, the Actor automatically falls back to /feed RSS XML. RSS feeds do not expose like, comment, or restack counts, so those three fields return null while markdownText, outboundLinks, authorNames, and media URLs are still extracted.
Does maxPostsPerPublication: 0 scrape an entire publication?
0 raises the per-publication limit to the maximum cap of 1,000 posts per run, streaming each item to the dataset as it is parsed.
Related Actors
Companion lightweight API Actors and free workflow templates in the Apify Automation Toolkit:
| Actor | Best paired for |
|---|---|
| Fast Website & Sitemap Markdown Crawler for AI/RAG | Crawl linked blogs, docs, and sponsor sites found in outboundLinks. |
| Google News & Universal RSS/Atom Feed Scraper | Combine Substack coverage with real-time Google News and RSS/Atom feeds. |
| Apple Podcasts & RSS Scraper (Host Emails & Shows) | Pull podcast shows, host emails, audio URLs, and episode show notes. |
| Wikipedia Knowledge & RAG Markdown Scraper (API) | Pair newsletter analysis with clean Wikipedia reference articles and Wikidata IDs. |
| Apple App Store & Reviews Scraper (iOS Apps & Ratings) | Track consumer app reviews and release notes alongside newsletter commentary. |
| Website Contact, Email MX/DMARC & Tech Stack Enricher | Enrich sponsor domains extracted from outboundLinks with contact and tech-stack data. |