Skip to content

jakub-k-slys/substack-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

793 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Warning

This library is no longer actively developed. The current generation of this project is Substack Gateway OSS — a Python REST API and MCP server that replaces this TypeScript client. If you are building new integrations, start there.

Substack API

npm version Documentation Status License: MIT TypeScript

A modern, type-safe TypeScript client for the Substack API. Build newsletter automation, content management tools, and subscriber analytics with ease.

Quickstart

pnpm add substack-api
import { SubstackClient } from 'substack-api';

const client = new SubstackClient({
  token: 'your-connect-sid-cookie-value',
  publicationUrl: 'example.substack.com'
});

const profile = await client.ownProfile();
for await (const post of profile.posts({ limit: 5 })) {
  console.log(`"${post.title}" - ${post.publishedAt?.toLocaleDateString()}`);
}

const isConnected = await client.testConnectivity();

Documentation

📚 Complete Documentation

Successor Project

This library served as the foundation for a broader ecosystem. The current generation is Substack Gateway OSS — a language-agnostic REST API and MCP server that exposes the same capabilities to any client, including Claude, n8n, and custom agents.

Author

Built by Jakub Slys — Backend Engineer building distributed systems for telecoms, running a self-hosted Kubernetes homelab, and building AI automation pipelines with n8n, MCP, and Claude.

This library was the first step toward automating my own Substack at iam.slys.dev, where I write about system design, machine learning fundamentals, and the AI tools I actually build and run in production.

iam.slys.dev

License

MIT

About

Substack API client is a modern TypeScript library provides a clean, entity-based interface to interact with Substack publications, posts, comments, and user profiles.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors