MuckRock / squarelet

MuckRock User Service
GNU Affero General Public License v3.0
11 stars 10 forks source link

Call Airtable API and cache requests #112

Closed allanlasser closed 2 weeks ago

allanlasser commented 1 month ago

The data for the Election Resource Hub is stored in Airtable, which is accessible via an API with a 5 requests/second rate limit.

First, we'll need to set up a wrapper for making authorized calls to the correct table for ERH data—the pyairtable library seems like a well-maintained utility for this.

Due to the rate limit, we'll also need to cache data returned from Airtable within Squarelet, with a reasonable time-to-live.