A modern, type-safe TypeScript client for the Substack API. Build newsletter automation, content management tools, and subscriber analytics with ease.
npm install substack-api
import { SubstackClient } from 'substack-api';
// Initialize client with your API key
const client = new SubstackClient({
apiKey: 'your-connect-sid-cookie-value',
hostname: 'example.substack.com'
});
// Get your profile and iterate through posts
const profile = await client.ownProfile();
for await (const post of profile.posts({ limit: 5 })) {
console.log(`📄 "${post.title}" - ${post.publishedAt?.toLocaleDateString()}`);
}
// Test connectivity
const isConnected = await client.testConnectivity();
- Installation Guide - Setup and requirements
- QuickStart Tutorial - Get started in minutes
- API Reference - Complete method documentation
- Entity Model - Modern object-oriented API
- Examples - Real-world usage patterns
MIT