Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 1.99 KB

README.md

File metadata and controls

57 lines (37 loc) · 1.99 KB

English | 简体中文

Substack Posts API

List the posts of any Substack publication with likes, comments, restacks, word counts and authors as JSON.

Powered by Serpent API. Full reference: Substack Posts API docs.

Quick start

  1. Get an API key at apiserpent.com. Every account starts with 10 free API calls.
  2. Call the endpoint with your key in the X-API-Key header:
curl -G "https://apiserpent.com/api/substack/posts" \
  --data-urlencode "publication=astralcodexten" \
  --data-urlencode "sort=top" \
  -H "X-API-Key: $SERPENT_API_KEY"

Endpoint

GET https://apiserpent.com/api/substack/posts

Parameter Required Description
publication Yes Substack name (astralcodexten), a substack.com address, or a custom domain
sort No new (default) or top
cursor No next_cursor from the previous response

Response

success, publication, sort, posts[] (up to 25), next_cursor. Each post has id, title, subtitle, url, published_at, audience, type, tags, word_count, likes, comments, restacks, cover_image, authors[], excerpt.

See the docs for the complete field list and sample responses.

Examples

File Language Run
example.py Python 3 (pip install requests) SERPENT_API_KEY=sk_live_... python example.py
example.mjs Node.js 18+ (no dependencies) SERPENT_API_KEY=sk_live_... node example.mjs

Use cases

  • Newsletter research and benchmarking
  • Content trend analysis
  • Feeding posts into RAG or summarisation pipelines

More from Serpent API

License

MIT