substack-api
TypeScript icon, indicating that this package has built-in type declarations

0.17.0 • Public • Published

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

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();

Documentation

📚 Complete Documentation →

License

MIT

Package Sidebar

Install

npm i substack-api

Weekly Downloads

720

Version

0.17.0

License

MIT

Unpacked Size

98.1 kB

Total Files

71

Last publish

Collaborators

  • jakub_k_slys