hamelsmu/website-to-api/substack
Claude Code and agent skill by hamelsmu/website-to-api
- community
Checking that the SKILL.md file is still in the repository.
Retrieve posts from any Substack newsletter using its internal API. Use when asked to list, fetch, search, or download Substack articles/posts. Supports pagination, search, sorting, and full content retrieval for paid posts.
Install
npx vskill@latest install hamelsmu/website-to-api/substackSKILL.md
The same SKILL.md was published earlier as hamelsmu/website-to-api/substack.
Substack
Retrieve posts from any Substack newsletter via its internal API, with full authenticated access to paid/subscriber-only content.
Built using the website-to-api pattern. If this skill breaks, use the website-to-api meta-skill to re-discover the API.
If This Breaks
This skill uses Substack's internal, undocumented API. If commands fail:
- Read the error — 401/403 likely means expired cookie or renamed cookie.
- Re-discover using the
website-to-apimeta-skill. - Update this skill — fix the script and SKILL.md with the new API shape.
Known past changes: the session cookie was renamed from connect.sid to substack.sid. The COOKIE_NAME constant in the script controls this.
Prerequisites
SUBSTACK_SIDenvironment variable set to yoursubstack.sidcookie value- Python 3.9+, runs via
uv run
Getting the Cookie
- Open Chrome DevTools (Cmd+Option+I) on any
substack.compage - Go to Application > Cookies >
https://substack.com - Find
substack.sid(httpOnly, Secure) and copy its value export SUBSTACK_SID="<value>"
The cookie lasts ~3 months and survives MFA unless you sign out.
Verifying auth via Chrome extension
Script Location
skills/substack/scripts/substack.py (relative to plugin root)
Commands
list-posts
| Option | Default | Description | |
|---|---|---|---|
--limit | 12 | Number of posts (auto-paginates >50) | |
--offset | 0 | Pagination offset | |
--sort | new | new or top | |
--search | (none) | Full-text search query | |
--output | table | table or json | |
--sid | (none) | Cookie value (overrides env var) |
get-post
| Option | Default | Description | |
|---|---|---|---|
--output | summary | summary, html, or json |
get-text
Fetch a post and save as Markdown with metadata header.
| Option | Default | Description | |
|---|---|---|---|
--out / -o | /tmp/<slug>.md | Output file path |
Newsletter argument accepts full URLs or bare subdomains (e.g. lenny → https://lenny.substack.com).
API Reference
| Endpoint | Method | Description | |
|---|---|---|---|
/api/v1/archive | GET | List/search posts | |
/api/v1/posts/<slug> | GET | Get a single post |
Archive parameters
| Param | Values | |
|---|---|---|
sort | new, top | |
search | any string | |
offset | integer | |
limit | integer (max 50) |
Auth vs No-Auth
For audience: "only_paid" posts:
- Without auth:
body_htmltruncated at paywall - With auth (paid subscriber): full content returned
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/substack/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/hamelsmu/website-to-api/substack)