Skip to content

Substack API

The TrueScrape Substack API exposes 5 public endpoints covering Post comments, Post, Publication posts, Profile and Publication. Every call is a GET against public, logged-out pages and returns the same unified schema as every other platform here. Calls cost 1 credit each. A cache hit is free, and a failed or empty response is never charged.

Endpoints

EndpointReturnsCreditsCacheableBatchable
/v1/substack/commentsPost comments1yesyes
/v1/substack/postPost1yesyes
/v1/substack/postsPublication posts1yesyes
/v1/substack/profileProfile1yesyes
/v1/substack/publicationPublication1yesyes

Reference

GET/v1/substack/comments1 creditcacheablebatchable

Post comments

Every public comment on a Substack post, replies included, newest first; parentId links a reply to its comment. Comments a publication shows only to paid subscribers are not available.

ParameterTypeRequiredDescription
idstringyesNumeric post id, as returned in id by substack.posts

Also accepts cache_max_age (a hit costs 0 credits) and include_raw (returns the untouched upstream payload under raw).

Returns a list of Comment in data.items.

Fields
FieldTypePresentDescription
platformone of 40 stringsalways
idstringalways
postIdstring | nullalways
parentIdstring | nullalwaysId of the comment this one replies to. Null on a top-level comment.
textstringalways
authorIdstring | nullalways
authorHandlestring | nullalways
authorNamestring | nullalways
authorAvatarUrlstring | nullalways
likeCountnumber | nullalways
replyCountnumber | nullalways
isPinnedboolean | nullalways
isAuthorReplyboolean | nullalwaysWhether the comment was written by the author of the post.
publishedAtstring | nullalwaysWhen the comment was posted. Usually an ISO 8601 timestamp; some platforms expose only relative text such as "2 days ago".
curl
curl "$API/v1/substack/comments?id=%3Cid%3E&cache_max_age=7d" \
  -H "x-api-key: $KEY"
TypeScript
const query = new URLSearchParams({
  id: '<id>',
  cache_max_age: '7d',
});

const response = await fetch(`${API}/v1/substack/comments?${query}`, {
  headers: { 'x-api-key': KEY },
});

const body = await response.json();
if (!body.success) throw new Error(body.error.code);

// 1 credit, 0 on a cache hit
console.log(body.data, body.meta.creditsCharged);
Python
Python
import os, httpx

r = httpx.get(
    f"{os.environ['API']}/v1/substack/comments",
    params={
        "id": "<id>",
        "cache_max_age": "7d",
    },
    headers={"x-api-key": os.environ["KEY"]},
    timeout=30,
)

body = r.json()
if not body["success"]:
    raise RuntimeError(body["error"]["code"])

print(body["data"], body["meta"]["creditsCharged"])
Response codes
200Success
400invalid_request. Not charged
401missing_api_key / invalid_api_key / revoked_api_key. Never a billing error
402insufficient_credits. The key is valid, the balance is not
429daily_cap_exceeded, upstream_rate_limited, or rate_limited (hourly calls to servers you named outside our known list). Not charged
501not_configured. This deployment is not set up to serve this endpoint. Not charged.
502upstream_blocked / upstream_schema_drift. Not charged
504upstream_timeout. Not charged
Try it here
GET/v1/substack/comments
Open the full playground
GET/v1/substack/post1 creditcacheablebatchable

Post

One Substack post with its text, reactions, comments, restacks and word count. For a subscriber-only post, text is the public preview and truncated is true.

ParameterTypeRequiredDescription
idstringyesNumeric post id, as returned in id by substack.posts

Also accepts cache_max_age (a hit costs 0 credits) and include_raw (returns the untouched upstream payload under raw).

Returns an object with platform, id, type, url, title, text, authorId, authorHandle, authorName, thumbnailUrl, mediaUrls, durationSeconds, viewCount, likeCount, commentCount, shareCount, hashtags, mentions, taggedUsers, isSponsored, publishedAt, fetchedAt, audience, wordCount, truncated.

Fields
FieldTypePresentDescription
platformone of 40 stringsalways
idstringalways
typevideo | short | image | carousel | text | live | story | reel | audio | album | episode | unknownalwaysWhat kind of post this is. `short` and `reel` are short-form video formats, `live` is a live stream or a recording of one, `carousel` holds several images or videos, `audio` is a music track, `album` is an album, `episode` is a podcast episode, and `unknown` covers anything else.
urlstring | nullalways
titlestring | nullalways
textstring | nullalwaysThe post's text: a caption, a description or the message body.
authorIdstring | nullalways
authorHandlestring | nullalways
authorNamestring | nullalways
thumbnailUrlstring | nullalways
mediaUrlsstring[]always
durationSecondsnumber | nullalways
viewCountnumber | nullalwaysViews. Null means the platform did not expose a count, which is not the same as zero.
likeCountnumber | nullalwaysLikes, or the platform's nearest equivalent. Null means not exposed, not zero.
commentCountnumber | nullalwaysComments. Null means not exposed, not zero.
shareCountnumber | nullalwaysShares, reposts, or the platform's nearest equivalent. Null means not exposed, not zero.
hashtagsstring[]alwaysHashtags or the platform's own topic tags, without the leading #.
mentionsstring[]alwaysHandles mentioned in the post text, without the leading @.
taggedUsersstring[]may be absentUsernames tagged in the media itself, as distinct from `mentions`, which come from the caption text. Absent when the platform does not report tags; an empty array means it reports none.
isSponsoredboolean | nullalwaysWhether the platform labels the post as an ad, promoted content or a paid partnership.
publishedAtstring | nullalwaysWhen the post was published. Usually an ISO 8601 timestamp; some platforms expose only a date or relative text such as "3 days ago".
fetchedAtstringalwaysWhen this record was fetched from the platform, as an ISO 8601 timestamp. A cached response keeps the time of the original fetch.
audiencestring | nullalwaysWho can read the whole post: `everyone`, `only_free` (free subscribers), `only_paid` or `founding`.
wordCountnumber | nullalways
truncatedbooleanalwaysTrue when the post is for subscribers only: `text` is then the public preview, not the whole post.
curl
curl "$API/v1/substack/post?id=%3Cid%3E&cache_max_age=7d" \
  -H "x-api-key: $KEY"
TypeScript
const query = new URLSearchParams({
  id: '<id>',
  cache_max_age: '7d',
});

const response = await fetch(`${API}/v1/substack/post?${query}`, {
  headers: { 'x-api-key': KEY },
});

const body = await response.json();
if (!body.success) throw new Error(body.error.code);

// 1 credit, 0 on a cache hit
console.log(body.data, body.meta.creditsCharged);
Python
Python
import os, httpx

r = httpx.get(
    f"{os.environ['API']}/v1/substack/post",
    params={
        "id": "<id>",
        "cache_max_age": "7d",
    },
    headers={"x-api-key": os.environ["KEY"]},
    timeout=30,
)

body = r.json()
if not body["success"]:
    raise RuntimeError(body["error"]["code"])

print(body["data"], body["meta"]["creditsCharged"])
Response codes
200Success
400invalid_request. Not charged
401missing_api_key / invalid_api_key / revoked_api_key. Never a billing error
402insufficient_credits. The key is valid, the balance is not
429daily_cap_exceeded, upstream_rate_limited, or rate_limited (hourly calls to servers you named outside our known list). Not charged
501not_configured. This deployment is not set up to serve this endpoint. Not charged.
502upstream_blocked / upstream_schema_drift. Not charged
504upstream_timeout. Not charged
Try it here
GET/v1/substack/post
Open the full playground
GET/v1/substack/posts1 creditcacheablebatchable

Publication posts

A publication's posts, newest first, with reactions, comments, restacks and word count. Substack shows no view counts. Pass the cursor from the previous response to page.

ParameterTypeRequiredDescription
publicationstringyesThe publication: its name on Substack (garymarcus), its host (garymarcus.substack.com or www.lennysnewsletter.com), or any URL on it
limitnumbernodefaults to 20
cursorstringnopagination.cursor from the previous response

Also accepts cache_max_age (a hit costs 0 credits) and include_raw (returns the untouched upstream payload under raw).

Returns a list of object in data.items.

Fields
FieldTypePresentDescription
platformone of 40 stringsalways
idstringalways
typevideo | short | image | carousel | text | live | story | reel | audio | album | episode | unknownalwaysWhat kind of post this is. `short` and `reel` are short-form video formats, `live` is a live stream or a recording of one, `carousel` holds several images or videos, `audio` is a music track, `album` is an album, `episode` is a podcast episode, and `unknown` covers anything else.
urlstring | nullalways
titlestring | nullalways
textstring | nullalwaysThe post's text: a caption, a description or the message body.
authorIdstring | nullalways
authorHandlestring | nullalways
authorNamestring | nullalways
thumbnailUrlstring | nullalways
mediaUrlsstring[]always
durationSecondsnumber | nullalways
viewCountnumber | nullalwaysViews. Null means the platform did not expose a count, which is not the same as zero.
likeCountnumber | nullalwaysLikes, or the platform's nearest equivalent. Null means not exposed, not zero.
commentCountnumber | nullalwaysComments. Null means not exposed, not zero.
shareCountnumber | nullalwaysShares, reposts, or the platform's nearest equivalent. Null means not exposed, not zero.
hashtagsstring[]alwaysHashtags or the platform's own topic tags, without the leading #.
mentionsstring[]alwaysHandles mentioned in the post text, without the leading @.
taggedUsersstring[]may be absentUsernames tagged in the media itself, as distinct from `mentions`, which come from the caption text. Absent when the platform does not report tags; an empty array means it reports none.
isSponsoredboolean | nullalwaysWhether the platform labels the post as an ad, promoted content or a paid partnership.
publishedAtstring | nullalwaysWhen the post was published. Usually an ISO 8601 timestamp; some platforms expose only a date or relative text such as "3 days ago".
fetchedAtstringalwaysWhen this record was fetched from the platform, as an ISO 8601 timestamp. A cached response keeps the time of the original fetch.
audiencestring | nullalwaysWho can read the whole post: `everyone`, `only_free` (free subscribers), `only_paid` or `founding`.
wordCountnumber | nullalways
curl
curl "$API/v1/substack/posts?publication=%3Cpublication%3E&cache_max_age=7d" \
  -H "x-api-key: $KEY"
TypeScript
const query = new URLSearchParams({
  publication: '<publication>',
  cache_max_age: '7d',
});

const response = await fetch(`${API}/v1/substack/posts?${query}`, {
  headers: { 'x-api-key': KEY },
});

const body = await response.json();
if (!body.success) throw new Error(body.error.code);

// 1 credit, 0 on a cache hit
console.log(body.data, body.meta.creditsCharged);
Python
Python
import os, httpx

r = httpx.get(
    f"{os.environ['API']}/v1/substack/posts",
    params={
        "publication": "<publication>",
        "cache_max_age": "7d",
    },
    headers={"x-api-key": os.environ["KEY"]},
    timeout=30,
)

body = r.json()
if not body["success"]:
    raise RuntimeError(body["error"]["code"])

print(body["data"], body["meta"]["creditsCharged"])
Response codes
200Success
400invalid_request. Not charged
401missing_api_key / invalid_api_key / revoked_api_key. Never a billing error
402insufficient_credits. The key is valid, the balance is not
429daily_cap_exceeded, upstream_rate_limited, or rate_limited (hourly calls to servers you named outside our known list). Not charged
501not_configured. This deployment is not set up to serve this endpoint. Not charged.
502upstream_blocked / upstream_schema_drift. Not charged
504upstream_timeout. Not charged
Try it here
GET/v1/substack/posts
Open the full playground
GET/v1/substack/profile1 creditcacheablebatchable

Profile

A Substack writer's public profile: followers, bio, links, and their main publication. Subscribers appear only as Substack's rounded badge.

ParameterTypeRequiredDescription
handlestringyesSubstack handle (lenny), @handle, or a substack.com/@handle URL

Also accepts cache_max_age (a hit costs 0 credits) and include_raw (returns the untouched upstream payload under raw).

Returns an object with platform, id, handle, displayName, bio, avatarUrl, bannerUrl, url, verified, followerCount, followingCount, postCount, viewCount, likeCount, isPrivate, isBusiness, category, location, externalLinks, createdAt, fetchedAt, subscriberBadge, publicationHost.

Fields
FieldTypePresentDescription
platformone of 40 stringsalways
idstringalwaysThe platform's own id for the account, such as a channel id or a numeric user id, always as a string.
handlestring | nullalwaysThe account handle without the leading @. Null when the platform has no handles.
displayNamestring | nullalways
biostring | nullalways
avatarUrlstring | nullalways
bannerUrlstring | nullalways
urlstring | nullalways
verifiedboolean | nullalwaysWhether the platform shows a verification badge on the account. Null where the platform has no public badge or does not expose it.
followerCountnumber | nullalwaysFollowers, subscribers, or the platform's nearest equivalent. Null when the account hides the count or the platform does not expose it.
followingCountnumber | nullalways
postCountnumber | nullalwaysPosts, videos, tracks, repositories, or the platform's nearest equivalent that the account has published.
viewCountnumber | nullalwaysLifetime views across the account, where the platform exposes a total.
likeCountnumber | nullmay be absentTotal likes received across all of the creator's posts. Distinct from `viewCount`. Absent when the platform does not expose it.
isPrivateboolean | nullalways
isBusinessboolean | nullalwaysWhether the platform classifies the account as a business or organisation rather than a person or creator. Null where the platform draws no such line or does not expose it. On Facebook every Page counts, including Pages for public figures.
categorystring | nullalwaysA label the platform attaches to the account, such as a business category, a genre or an account type. What it holds varies by platform.
locationstring | nullalwaysLocation as the platform shows it: a city, a country, a region code or an address, depending on the platform.
externalLinksstring[]alwaysLinks the account lists on its profile, such as a website or other social accounts.
createdAtstring | nullalwaysWhen the account was created. Usually an ISO 8601 timestamp; some platforms expose only the date as shown on the profile.
fetchedAtstringalwaysWhen this record was fetched from the platform, as an ISO 8601 timestamp. A cached response keeps the time of the original fetch.
subscriberBadgestring | nullalwaysSubscriber count as the rounded badge Substack shows, such as "1.2M+". Substack publishes no exact subscriber count.
publicationHoststring | nullalwaysThe host of the writer's main publication, to pass as `publication` to the other Substack endpoints.
curl
curl "$API/v1/substack/profile?handle=%40mkbhd&cache_max_age=7d" \
  -H "x-api-key: $KEY"
TypeScript
const query = new URLSearchParams({
  handle: '@mkbhd',
  cache_max_age: '7d',
});

const response = await fetch(`${API}/v1/substack/profile?${query}`, {
  headers: { 'x-api-key': KEY },
});

const body = await response.json();
if (!body.success) throw new Error(body.error.code);

// 1 credit, 0 on a cache hit
console.log(body.data, body.meta.creditsCharged);
Python
Python
import os, httpx

r = httpx.get(
    f"{os.environ['API']}/v1/substack/profile",
    params={
        "handle": "@mkbhd",
        "cache_max_age": "7d",
    },
    headers={"x-api-key": os.environ["KEY"]},
    timeout=30,
)

body = r.json()
if not body["success"]:
    raise RuntimeError(body["error"]["code"])

print(body["data"], body["meta"]["creditsCharged"])
Response codes
200Success
400invalid_request. Not charged
401missing_api_key / invalid_api_key / revoked_api_key. Never a billing error
402insufficient_credits. The key is valid, the balance is not
429daily_cap_exceeded, upstream_rate_limited, or rate_limited (hourly calls to servers you named outside our known list). Not charged
501not_configured. This deployment is not set up to serve this endpoint. Not charged.
502upstream_blocked / upstream_schema_drift. Not charged
504upstream_timeout. Not charged
Try it here
GET/v1/substack/profile
Open the full playground
GET/v1/substack/publication1 creditcacheablebatchable

Publication

A Substack publication: name, description, author, custom domain, whether it sells paid plans, and its rounded subscriber badge. Custom domains are accepted.

ParameterTypeRequiredDescription
publicationstringyesThe publication: its name on Substack (garymarcus), its host (garymarcus.substack.com or www.lennysnewsletter.com), or any URL on it

Also accepts cache_max_age (a hit costs 0 credits) and include_raw (returns the untouched upstream payload under raw).

Returns an object with platform, id, handle, displayName, bio, avatarUrl, bannerUrl, url, verified, followerCount, followingCount, postCount, viewCount, likeCount, isPrivate, isBusiness, category, location, externalLinks, createdAt, fetchedAt, host, customDomain, authorHandle, authorName, hasPaidPlans, subscriberBadge.

Fields
FieldTypePresentDescription
platformone of 40 stringsalways
idstringalwaysThe platform's own id for the account, such as a channel id or a numeric user id, always as a string.
handlestring | nullalwaysThe account handle without the leading @. Null when the platform has no handles.
displayNamestring | nullalways
biostring | nullalways
avatarUrlstring | nullalways
bannerUrlstring | nullalways
urlstring | nullalways
verifiedboolean | nullalwaysWhether the platform shows a verification badge on the account. Null where the platform has no public badge or does not expose it.
followerCountnumber | nullalwaysFollowers, subscribers, or the platform's nearest equivalent. Null when the account hides the count or the platform does not expose it.
followingCountnumber | nullalways
postCountnumber | nullalwaysPosts, videos, tracks, repositories, or the platform's nearest equivalent that the account has published.
viewCountnumber | nullalwaysLifetime views across the account, where the platform exposes a total.
likeCountnumber | nullmay be absentTotal likes received across all of the creator's posts. Distinct from `viewCount`. Absent when the platform does not expose it.
isPrivateboolean | nullalways
isBusinessboolean | nullalwaysWhether the platform classifies the account as a business or organisation rather than a person or creator. Null where the platform draws no such line or does not expose it. On Facebook every Page counts, including Pages for public figures.
categorystring | nullalwaysA label the platform attaches to the account, such as a business category, a genre or an account type. What it holds varies by platform.
locationstring | nullalwaysLocation as the platform shows it: a city, a country, a region code or an address, depending on the platform.
externalLinksstring[]alwaysLinks the account lists on its profile, such as a website or other social accounts.
createdAtstring | nullalwaysWhen the account was created. Usually an ISO 8601 timestamp; some platforms expose only the date as shown on the profile.
fetchedAtstringalwaysWhen this record was fetched from the platform, as an ISO 8601 timestamp. A cached response keeps the time of the original fetch.
hoststringalwaysThe host the publication is read on: its custom domain, or `<name>.substack.com`.
customDomainstring | nullalways
authorHandlestring | nullalways
authorNamestring | nullalways
hasPaidPlansboolean | nullalwaysWhether the publication sells paid subscriptions.
subscriberBadgestring | nullalwaysSubscriber count as the rounded badge Substack shows, such as "1.2M+". Substack publishes no exact subscriber count.
curl
curl "$API/v1/substack/publication?publication=%3Cpublication%3E&cache_max_age=7d" \
  -H "x-api-key: $KEY"
TypeScript
const query = new URLSearchParams({
  publication: '<publication>',
  cache_max_age: '7d',
});

const response = await fetch(`${API}/v1/substack/publication?${query}`, {
  headers: { 'x-api-key': KEY },
});

const body = await response.json();
if (!body.success) throw new Error(body.error.code);

// 1 credit, 0 on a cache hit
console.log(body.data, body.meta.creditsCharged);
Python
Python
import os, httpx

r = httpx.get(
    f"{os.environ['API']}/v1/substack/publication",
    params={
        "publication": "<publication>",
        "cache_max_age": "7d",
    },
    headers={"x-api-key": os.environ["KEY"]},
    timeout=30,
)

body = r.json()
if not body["success"]:
    raise RuntimeError(body["error"]["code"])

print(body["data"], body["meta"]["creditsCharged"])
Response codes
200Success
400invalid_request. Not charged
401missing_api_key / invalid_api_key / revoked_api_key. Never a billing error
402insufficient_credits. The key is valid, the balance is not
429daily_cap_exceeded, upstream_rate_limited, or rate_limited (hourly calls to servers you named outside our known list). Not charged
501not_configured. This deployment is not set up to serve this endpoint. Not charged.
502upstream_blocked / upstream_schema_drift. Not charged
504upstream_timeout. Not charged
Try it here
GET/v1/substack/publication
Open the full playground

Questions

How much does the Substack API cost?
Calls cost 1 credit each. Every endpoint is cacheable, and a cache hit costs nothing. A failed request and an empty result are both free, on every endpoint.
Does the Substack API need a login or cookies?
No. Every endpoint reads public, logged-out pages only — no account, no cookies, no session. An API key identifies your own TrueScrape account and nothing else.
Can I fetch many Substack targets in one request?
Yes. 5 of 5 are batchable: one POST to /v1/jobs/batch takes many targets and returns a job id to poll.
Can I watch Substack endpoints for changes?
Yes, 5 of 5. A subscription polls on your schedule and fires your webhook only when the content changed; the rest carry x-subscribable: false in the spec.