New release: Substack API Python package 1.0
Today, I’m excited to announce the 1.0 release of my Substack API Python package. This represents a significant overhaul from the previous 0.1 version, transforming it from a collection of functions into a full-fledged, object-oriented library that makes interacting with Substack’s unofficial API more intuitive and powerful.
A complete redesign
When I first released this package, I mentioned my goal of creating a lightweight tool to help researchers collect data about Substack newsletters and to help writers archive their work. With this 1.0 release, I’ve completely redesigned the package architecture while keeping that same idea in mind.
The most noticeable change is the shift to an object-oriented approach. Instead of calling isolated functions, you now work with intuitive classes:
from substack_api import Newsletter, User, Post, Category
# Create a newsletter object
newsletter = Newsletter("https://example.substack.com")
# Get recent posts
recent_posts = newsletter.get_posts(limit=5)
# Get information about a user
user = User("username")
subscriptions = user.get_subscriptions()
Expanded functionality
Beyond the architectural changes, I’ve significantly expanded what the package can do:
Newsletter exploration
- Browse newsletters by category
- Search posts within newsletters
- Access podcast episodes
- Get newsletter recommendations and authors
User profiles
- Retrieve user metadata and subscriptions
- Access profile information programmatically
Post content
- Get post metadata and content
Category browsing
- List all categories on Substack
- Find newsletters by category
Why this matters
This release adds significant capabilities for researchers and writers working with Substack content. For researchers, the expanded functionality makes it easier to analyze newsletter networks, track content across publications, and understand the Substack ecosystem. For writers, it offers more robust ways to archive and manage your own content.
In the initial release, I mentioned how these tools could help understand networks of reading and recommending. This release takes that potential much further by providing more comprehensive access to the connections between newsletters, posts, and users.
Looking forward
As with the previous version, I want to emphasize that this is an unofficial API wrapper. It’s not affiliated with or endorsed by Substack, and Substack could make changes at any time that affect the library’s functionality. However, I’m committed to maintaining the package and adapting to any API changes as needed.
This latest release is available via pip (pip install substack-api
), and you can find the full documentation and source code on the GitHub repository.
I’m excited to see what researchers and writers build with these tools!