Substack Posts API
Returns recent posts from a Substack publication, or one article when you pass a post URL. Each post includes title, subtitle, engagement counts, author and publication details, and the article body as text, HTML and Markdown. The only required input is url.
Use cases
- Track engagement on each new post of a newsletter by comparing
reactionCount, commentCount and restackCount.
- Build a text archive of a publication by saving the
markdown or text of each post.
- Find long, free posts from a writer by filtering on
wordcount and isPaid.
- Collect reader discussion on a single article by setting
includeComments to true.
Request
curl -X POST "https://api.sandbase.ai/v1/api/substack/posts" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.astralcodexten.com", "limit": 3}'
The result is returned in outputs[0].data.
Parameters
Example response
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"items": [
{
"authorHandle": "astralcodexten",
"authorImage": "https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/http…",
"authorName": "Scott Alexander",
"authorUrl": "https://substack.com/@astralcodexten",
"commentCount": 244,
"comments": [],
"contentStatus": "full",
"createdUtc": 1793595877,
"description": "...",
"hasVoiceover": true,
"html": "<p>This is the weekly visible open thread. Post about anything you want, ask ran…",
"image": "https://substack-post-media.s3.amazonaws.com/public/images/9d8ea239-2d80-4635-9f…"
}
]
},
"found": true
}
Response fields
Notes
- Pass a publication URL or custom domain to get recent posts. Pass a post URL ending in
/p/slug to get one article.
- Use
limit (1-100) to set how many recent posts to return. The date filters apply only within the most recent limit posts, so raise limit to reach older posts.
comments is an empty list unless you set includeComments to true. maxComments sets the cap per post (0-500).
contentStatus shows full when the full body was returned. podcastUrl links to an audio file for the post.
Pricing
Billed at the actual cost of each call, about $0.0444 for the request above. Failed calls are not charged.