Blog / API guides

Substack API: Get Publication Posts as JSON

Substack doesn't document a public API. What it documents is an RSS feed for every publication, at yourpublication.substack.com/feed, and an export that lets a writer download their own posts and subscriber list. For public posts as JSON, four endpoints cover the gap: publication, posts (sorted by new or top, paged with offset and limit), post by slug, and comments. Each costs 1 credit per successful call. This guide shows when the RSS feed is enough, how to pull a newsletter's archive with the endpoints, and what that costs.

Does Substack have an official API?

No public one. Substack's help centre documents two ways to get content out. Every publication has an RSS feed at its address followed by /feed, such as yourname.substack.com/feed (Substack support: RSS feed, 2026). And a writer can export their own publication from Settings, which produces a zip with their posts, subscriber list and stats (Substack support: export, 2026).

Developers sometimes call Substack's internal web endpoints directly, the ones its own site uses. Those aren't documented, can change without notice, and are governed by Substack's terms, so we don't recommend building on them.

Use what Substack documents first. If you want new posts from a few newsletters, the RSS feed is free, official and enough. If you're the writer and want your own archive or subscribers, use the export: it's the only legitimate route to subscriber data.

When is the RSS feed enough, and when isn't it?

The RSS feed is enough when you need recent posts from a known publication in a feed reader, a Slack channel or a simple script. It's a standard format every language can parse, and it's free. It falls short in three cases: a feed may hold only a publication's recent posts rather than its full archive, it's ordered by date only, and it has no comment data.

Need RSS feed Export Endpoints
New posts from a publication Yes Your own only Yes, posts with sort=new
Full archive of a publication May hold only recent posts Your own only Yes, page posts with offset
Most popular posts No No Yes, posts with sort=top
One post by URL In the feed if recent Your own only Yes, post by slug
Comments on a post No No Yes, comments (restricted)
Subscriber list No Your own only No, never
Cost Free Free 1 credit per successful call

If your need sits in the first column, stop here and use the feed. The rest of this guide is for the archive, popularity and many-publications cases.

How do you get a publication's posts as JSON?

Call posts with the publication's name, a sort order and a page. The publication parameter is the publication's name (up to 64 characters); the catalogue's example uses slowboring. This is that example request:

curl "https://api.perceptlayer.com/v1/substack/posts?publication=slowboring&sort=new&offset=0&limit=2" \
  -H "X-API-Key: $API_KEY"
Endpoint Required Optional Returns
GET /v1/substack/publication publication The publication's details
GET /v1/substack/posts publication sort (new, top), offset, limit A page of the publication's posts
GET /v1/substack/post publication, slug (up to 300 characters) One post
GET /v1/substack/comments publication, post_id (up to 32 characters) A post's comments

A post's slug is the last part of its URL: for yourname.substack.com/p/some-post-title it's some-post-title. We didn't run these requests for this post, and we haven't recorded a response from the Substack endpoints yet, so we can't show the fields. Run posts in the playground on the Substack API page to see what each item carries, including the slug and ID you pass to post and comments, and how large a limit the endpoint accepts. Send the key in the X-API-Key header; the authentication docs cover the rest.

How do you pull a newsletter's archive?

Page through posts with sort=new, raising offset by limit each time until a page comes back empty, then fetch each post you need with post. A minimal Python version:

import os
import time

import requests

API = "https://api.perceptlayer.com/v1/substack"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}


def get(path, **params):
    resp = requests.get(f"{API}/{path}", params=params, headers=HEADERS, timeout=90)
    if resp.status_code == 429:
        time.sleep(int(resp.headers.get("Retry-After", "5")))
        return get(path, **params)
    resp.raise_for_status()
    return resp.json()


def list_pages(publication, limit=20):
    offset = 0
    while True:
        page = get("posts", publication=publication, sort="new", offset=offset, limit=limit)
        if not page:
            break
        yield page
        offset += limit


for page in list_pages("slowboring"):
    print(page)  # inspect the shape once, then pick out slugs and fields
    break

We didn't run this against the live API; we ran it with a mocked HTTP client that answered a 429 and then one page, which it retried and printed. It stops at the first page and prints it on purpose: without a recorded response we don't know whether posts returns a list or an object with a list inside, so check the shape once and adjust the stop condition and the slug field before you run the full loop. Store each post's slug as you go, so a re-run only fetches new posts.

What does an archive pull cost?

Each successful call costs 1 credit, and failed calls cost nothing. A 200-post archive at 20 posts a page is 10 listing calls, plus 200 post calls if you need each full post: 210 credits. Checking 50 newsletters weekly for new posts is 50 × 4 = 200 credits a month. Both are more than the 100 free credits every account gets once, after verifying an email address, which cover a 50-post archive (3 listing calls plus 50 post calls) or the first two weekly checks of 50 newsletters; ongoing use needs a pack. See pricing for packs. Every successful response reports X-Credits-Used and X-Credits-Remaining, and the credits docs explain balances.

What are the terms for these endpoints?

All four Substack endpoints are restricted endpoints. They work after you accept the restricted-endpoint terms in your dashboard; before that, a call returns restricted_endpoint (403). Use them for public posts. Paid posts behind a paywall are the writer's paid content, not public data. Comments carry commenters' names, so use them only in aggregate, such as counts or topics, and never to profile or contact people. There's no subscriber endpoint, and nothing here should be used to build lists of readers.

Respect the writer, too: quote briefly and link back, as you would with any publication. Data is collected from publicly available sources and returned as found at the time of the call.

To start, accept the terms, then run publication and posts for a newsletter you read in the playground on the Substack API page. For turning posts into model input, see Website to Markdown: Clean Page Text for LLMs; other sources are under Social media. Get a free API key to run the archive script.

APIs in this post

Frequently asked questions

Is there an official Substack API?

Substack doesn't document a public API. It documents an RSS feed for each publication at /feed and an export of a writer's own posts, subscribers and stats from Settings. Its site uses internal endpoints, but they're undocumented and can change without notice. The endpoints here return public posts as JSON at 1 credit per call.

How do I get all posts from a Substack newsletter?

Call GET /v1/substack/posts with the publication, sort=new, an offset and a limit, and raise offset by limit until a page comes back empty. Each page costs 1 credit. Then fetch full posts with GET /v1/substack/post by slug, 1 credit each. If you only need recent posts, the free RSS feed may be enough.

Can I get a Substack newsletter's subscribers?

Only your own, through Substack's export in your publication's Settings. Subscriber lists of other newsletters are private, and no endpoint here returns them. Collecting readers' details without a lawful basis would break privacy law and the restricted-endpoint terms.

Can I read paywalled Substack posts through the API?

No. The endpoints return public content as found; paid posts are the writer's paid content. If you subscribe to a newsletter, read it on Substack or in your email. For your own paid posts, use Substack's export, which includes your full archive.

What happens if a Substack call fails?

You get an HTTP status and a JSON body with a code, a message and a request_id, and you aren't charged. restricted_endpoint (403) means the terms haven't been accepted; not_found (404) usually means a wrong publication or slug; rate_limited (429) carries Retry-After. The errors docs list every code.

  1. Depop API: Resale Listings as JSON

    Search Depop listings as JSON with brand, condition, sizes and price.amount per item; the recorded jacket search had a total_count of 6,815,522. 1 credit.

  2. Similarweb API: Website Traffic Data as JSON

    Get Similarweb traffic estimates as JSON: visits, bounce_rate, traffic_sources, top_countries and top_keywords for a domain, at 1 credit a call.

  3. StockTwits API: Symbol Streams as JSON

    Three StockTwits endpoints as JSON: a symbol's message stream with sentiment and cursor, symbol search and trending symbols, each 1 credit a call.

Start with 100 free credits

No password to set. We email you a sign-in link, and your key works on every API.

No credit card. 100 free credits on signup.