The unofficial Substack API wrapper for Python.
Project description
Substack-api
An unofficial Python wrapper around Substack's API.
I developed this package as a lightweight tool to help researchers collect data about Substack newsletters, and to help writers archive their work off-platform. This is not a tool designed for bulk text extraction/web scraping. It supports the following functionality:
- Download full JSON metadata about newsletters by category
- Download full JSON metadata about posts by newsletter
- Download text of individual, publicly-available posts
- List newsletter categories
Installation
pip install substack-api
Usage
from substack_api import substack_api
List all categories on Substack:
substack_api.list_all_categories()
Get metadata for the first 2 pages of Technology newsletters:
substack_api.get_newsletters_in_category(4, start_page=0, end_page=2)
Get post metadata for the most recent 30 posts from a newsletter:
substack_api.get_newsletter_post_metadata("platformer", start_offset=0, end_offset=30)
Get post contents (HTML only) from one newsletter post:
substack_api.get_post_contents("platformer", "how-a-single-engineer-brought-down", html_only=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for substack_api-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6456d9f2570e5c6f2261f866bb78782338fd205ccd7760b4db6625cd340a84c9 |
|
MD5 | a3a8006286a28ad621c340027877a393 |
|
BLAKE2b-256 | 5c83b0e23e3b13a85bc46e5c262773281612e9221007122499ad9191b2c58660 |