# Single Post
Source: https://substackapi.dev/api-reference/endpoint/post
GET /post
Get a single post from your publication by slug.
# Latest Posts
Source: https://substackapi.dev/api-reference/endpoint/posts-latest
GET /posts/latest
Get the latest posts from your publication.
# Search Posts
Source: https://substackapi.dev/api-reference/endpoint/posts-search
GET /posts/search
Search for posts in your publication.
# Top Posts
Source: https://substackapi.dev/api-reference/endpoint/posts-top
GET /posts/top
Get the most popular posts from your publication.
# FAQ
Source: https://substackapi.dev/faq
Frequently asked questions about the API.
No, this is not the official Substack API. This is a community-driven project to provide a free and easy-to-use API for Substack content creators. This API is not affiliated with Substack.
Yes, this API is free to use.
To get started, please refer to the [Quickstart guide](./quickstart).
You can get an API key by visiting the [API Key Generator](https://auth.substackapi.dev) and following the instructions.
While all Substack publications are available, you can only access data from publications you own or have explicit permission to access. Each API key is linked to one specific Substack publication and can only access data from that publication.
Yes, we collect data about API usage. This helps us understand how the API is used and how we can improve it. However, we do not collect any data related to the content of Substack publications.
Yes, the project is open source and the code is available on [GitHub](https://github.com/Noah-Bjorner/SubstackAPI).
If you need help, please reach out via email at [bjornernoah@gmail.com](mailto:bjornernoah@gmail.com).
This API was created by [Noah Bjorner](https://github.com/Noah-Bjorner). If you wish to reach out, please contact me at [bjornernoah@gmail.com](mailto:bjornernoah@gmail.com).
# Introduction
Source: https://substackapi.dev/introduction
Welcome to Substack API, the unofficial open-source API for Substack publications.
## What is Substack API?
Substack API allows Substack publications to access their content and display it on their own websites or applications. The API provides:
* Fast and reliable access to your publication's content
* Simple authentication using API keys
* Free to use with generous rate limits
## Available Endpoints
Get the latest posts from your publication.
Get the most popular posts from your publication.
Search for posts in your publication.
Get a single post from your publication by slug.
## How to get started
Visit the [API Key Generator](https://auth.substackapi.dev) to create your API key. You'll need your Substack publication URL.
Include your API key in the `X-API-Key` header when making requests to the API.
Refer to the [API Reference](/api-reference) for detailed endpoint documentation and examples.
You can try out the API without an API key using the [Try it](/api-reference/endpoint/posts-latest) feature available for all endpoints.
For a detailed walkthrough, check out our video tutorial and step-by-step guide in the [Quickstart](/quickstart) page.
## Need Help?
* Check out our [FAQ](/faq) for common questions
* View the technical details in our [Technical Overview](/technical-overview)
* Contact the developer at [bjornernoah@gmail.com](mailto:bjornernoah@gmail.com)
* View the source code on [GitHub](https://github.com/Noah-Bjorner/SubstackAPI)
# Quickstart
Source: https://substackapi.dev/quickstart
Learn how to use the Substack API.
## Step by Step Guide
Get started with SubstackAPI in just a few simple steps:
Go to the [API Key Generator](https://auth.substackapi.dev) to create your unique API key. You'll need:
* Your email address
* Your Substack publication URL (access will be limited to this publication)
Browse the API documentation to find available endpoints, including their URLs, parameters, and responses. Use the interactive "Try it" feature to test requests and verify your implementation before integrating.
With your API key and endpoint information ready, you can now authenticate your requests, make API calls from your application.
# Technical Overview
Source: https://substackapi.dev/technical-overview
How SubstackAPI provides reliable, high-performance access to Substack publication data.
SubstackAPI is open source and available on GitHub.
### Challenge
Substack does not offer a public API. There are currently two ways to access data from a Substack publication:
1. Use the Substack publication RSS feed
2. Use the Substack unofficial/internal API
Both of these options come with their own set of pros and cons.
RSS Feed:
* ✓ Publicly available and stable
* ✓ Official support from Substack
* ✗ Limited data access
* ✗ Slower query performance
Unofficial API:
* ✓ Rich data access
* ✓ Fast query performance
* ✗ No official support
* ✗ Could break without notice
* ✗ Restrictive rate limits
Neither option alone provides a complete solution for content creators to access their data reliably and efficiently.
### Solution
To address these limitations, SubstackAPI implements a hybrid approach:
```mermaid theme={null}
flowchart LR
Client[API Client]
Cache[(Redis Cache)]
API[Unofficial API]
RSS[RSS Feed]
Client --> Cache
Cache -- "Cache Miss" --> API
API -- "Error" --> RSS
API --> Cache
RSS --> Cache
Cache --> Client
```
1. **Primary Data Source**: Unofficial API
* Used to fetch publication data
* Rate limiting handled through minimizing requests
2. **Fallback Mechanism**: RSS Feed
* Provides backup data access
* Ensures service continuity if unofficial API changes
3. **Caching Layer**: Redis
* Minimizes calls to the unofficial API
* Provides fast, low-latency data access
* Handles large amounts of requests efficiently
This architecture ensures:
* Reliable and unlimited access to publication data
* Minimal dependency on the unofficial API
* Fast response times
* High availability through fallback mechanisms
The main tradeoff with this solution is a potential delay of up to a few hours for the latest publication updates due to caching.
If you are interested in seeing the source code, you can view it on [GitHub](https://github.com/Noah-Bjorner/SubstackAPI).
# Usage & Limits
Source: https://substackapi.dev/usage-limits
API request limits and intended usage guidelines.
## Intended Use
This API is intended exclusively for:
* Content owners accessing their own Substack publication data
* Applications authorized by publication owners to interact with their content
* Legitimate integrations with Substack publications by copyright holders
This API is not intended for:
* Unauthorized scraping of Substack content
* Accessing publications without explicit permission from the content owner
* Mass collection or aggregation of Substack content without authorization
Violation of these usage guidelines may result in immediate API access termination.
## Rate Limits
| Endpoint | Rate Limit |
| ------------- | ---------------------- |
| /posts/latest | 10 requests per minute |
| /posts/top | 10 requests per minute |
| /posts/search | 20 requests per minute |
| /post | 15 requests per minute |
* Production API keys use the limits shown above, while test API keys are limited to 3 requests per minute for all endpoints.
* Rate limits are tracked by the **client's IP address**, not by API key.
* Exceeding these limits will result in a `429 Too Many Requests` response.
## Authentication
Authentication is handled via the `X-API-Key` header. Each API key is linked to one Substack publication and can only access its data.
### API Key Format
* Production keys start with `sk_live_`
* Test keys start with `sk_test_`
### Using Your API Key
Include your API key in all requests using the `X-API-Key` header:
```bash theme={null}
curl https://api.substackapi.dev/api_key/validate \
-H "X-API-Key: sk_live_your_key_here"
```