To address these limitations, SubstackAPI implements a hybrid approach:
Primary Data Source: Unofficial API
Used to fetch publication data
Rate limiting handled through minimizing requests
Fallback Mechanism: RSS Feed
Provides backup data access
Ensures service continuity if unofficial API changes
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.