substack-api

substack-api is a skill for Claude Code, Codex from AnthonyDavidAdams/substack-api-reference. It costs 68 tokens per session (1,453 once invoked), scanned A, original, MIT.

A tool for working with Substack, a publishing platform for newsletters and posts, through a logged-in user's account. It uses the account's browser session rather than a public API key.

In plain words
What is it for?
Reading posts, creating drafts, publishing issues, scheduling sends, mirroring content, and extracting data such as subscribers from a Substack publication.
Why use it?
It removes the need to handle Substack tasks manually in a browser or build unsupported integrations from scratch. Account access still requires the user's session cookie and publication subdomain.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Reading posts, creating drafts, publishing issues, scheduling sends, mirroring content, and extracting data such as subscribers from a Substack publication.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/anthonydavidadams/substack-api-reference/substack-api-reference
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add AnthonyDavidAdams/substack-api-reference --skill substack-api-reference
Clone the repo
git clone --depth 1 https://github.com/AnthonyDavidAdams/substack-api-reference

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for substack-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/anthonydavidadams/substack-api-reference/substack-api-reference/github.svg)](https://agentmods.dev/skills/anthonydavidadams/substack-api-reference/substack-api-reference)
Your own site
<a href="https://agentmods.dev/skills/anthonydavidadams/substack-api-reference/substack-api-reference"><img src="https://agentmods.dev/badge/skills/anthonydavidadams/substack-api-reference/substack-api-reference/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for substack-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/anthonydavidadams/substack-api-reference/substack-api-reference"><img src="https://agentmods.dev/badge/skills/anthonydavidadams/substack-api-reference/substack-api-reference.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,453 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.01453
Opus 5.5 $0.00027 $0.00581
Sonnet 5.5 $0.00014 $0.00291
Haiku 4.5 $0.00007 $0.00145

Measured 1mo ago against content hash 6120983d3add, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

substack-api scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 4 executable files (examples/curl/01-validate-cookie.sh, examples/curl/02-create-draft.sh, examples/curl/03-publish-draft.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- [`examples/`](examples/) — drop-in curl + TypeScript code
SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Substack API Skill

You can drive Substack programmatically using their internal cookie-authenticated API. There is no public API key program — auth is the session cookie a normal browser uses.

When to use this skill

Trigger phrases (not exhaustive):

  • "post to Substack" / "send via Substack"
  • "create a draft in [my Substack]"
  • "publish to {publication}.substack.com"
  • "import my Substack subscribers"
  • "read my Substack posts"
  • "schedule a Substack send"

Before you do anything

You need TWO pieces of state from the user:

  1. Session cookie — connect.sid value (or substack.sid on older accounts). See AUTH.md for how to obtain.
  2. Publication subdomain — e.g. yournewsletter (NOT the full URL). Get this from /api/v1/user/profile/self if not supplied.

Always confirm both before making mutating calls. If the user supplied a URL like https://yournewsletter.substack.com, parse out the subdomain.

Canonical request shape

Cookie: connect.sid=<value>; substack.sid=<value>
User-Agent: Mozilla/5.0

Mozilla/5.0 is enough — default Node/Python User-Agents get 403'd.

The five operations you'll actually do

1. Validate a cookie + discover the user's publications

GET https://substack.com/api/v1/user/profile/self

Returns {id, handle, publicationUsers: [{publication: {id, name, subdomain}, role, is_primary}]}.

  • Any 200 = cookie valid
  • 401 = cookie expired or wrong
  • Pick the publication via subdomain — show user a picker if multiple exist

2. Create a draft (no send)

POST https://{subdomain}.substack.com/api/v1/drafts
Content-Type: application/json

{
  "draft_title": "Subject line",
  "draft_subtitle": "Optional preheader",
  "draft_body": "<p>HTML body</p>",
  "type": "newsletter"
}

draft_body accepts HTML. Substack will normalize. Returns the draft object with id and slug.

3. Update an existing draft (Replace flow)

PUT https://{subdomain}.substack.com/api/v1/drafts/{id}
Content-Type: application/json

{ "draft_title": "...", "draft_subtitle": "...", "draft_body": "..." }

Read the full file on GitHub · 178 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 178 lines · 68 tokens per session scan A 6120983d3add

Subscribe to this mod's changes

substack-api is a skill published in the GitHub repository AnthonyDavidAdams/substack-api-reference (6 stars, last pushed 3mo ago), licensed MIT. It adds 68 tokens to every session and 1,453 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

reddit-search-api

Pure API reference for reddapi.dev - authentication, all endpoints (vector search, semantic search, trends, subreddit lookup), request parameters, response schemas, and error codes, with no research-workflow framing. Use when the user wants raw endpoint documentation, is debugging a reddapi.dev integration, needs…

lignertys/reddit-research-skills · 118 tokens

reddapi

The original reddapi.dev Reddit search skill (vector search, semantic search, trends, subreddit discovery), no Reddit OAuth or app registration needed. This is the same engine now packaged as reddit-research with added market-research playbooks and a fuller pitch on semantic vs keyword search; reddapi is kept live…

lignertys/reddit-research-skills · 143 tokens

content-wand

Transforms content between formats and platforms. Use when user says 'turn this into', 'repurpose this as', 'make this a', 'atomize this', or 'reformat for'. Creates Twitter/X threads, LinkedIn posts, email newsletters, Instagram carousels, YouTube Shorts scripts, TikTok scripts, Threads posts, Bluesky posts, podcast…

baagad-ai/content-wand · 149 tokens

platform-writer

Use when content-wand needs to generate platform-native content from a ContentObject. Applies hard platform constraints and quality heuristics per format. Handles Twitter/X, LinkedIn, newsletter, Instagram carousel, YouTube Shorts, TikTok scripts, Threads posts, Bluesky posts, podcast talking points.

baagad-ai/content-wand · 62 tokens

writing-style-extractor

Use when content-wand needs to read or capture a Writing Style. Reads existing /.claude/content-wand/styles/[name].json in READ mode, or conducts a contextual interview to extract style DNA in SETUP mode.

baagad-ai/content-wand · 50 tokens

humanizer

Use when content-wand needs to remove AI writing patterns from platform outputs before delivery. Always the final pass after platform-writer or repurpose-transformer.

baagad-ai/content-wand · 34 tokens