Ballotpedia Data Client Documentation
  • Introduction
  • Geographic APIs
    • Getting started with geographic APIs
    • About redistricting
    • /districts
    • /officeholders
    • /election_dates
    • /elections_by_point
    • /elections_by_state
    • Practical guide
  • Rate limiting
  • Bulk data
    • Downloading bulk data via the client portal
  • Downloading bulk data via API
  • Dictionaries and Terms
    • About the Candidates data set
    • Data dictionary: Voting rules
    • Data dictionary: Officeholders
    • Data dictionary: Ballot Measures
    • Data dictionary: Candidates
    • Terms of Use
Powered by GitBook
On this page
  • Default limits
  • Throttling
  • Higher Limits
Export as PDF

Rate limiting

Default limits

This API is rate-limited using the token bucket algorithm.

Rate: 5 requests per second

  • The 5 requests per second applies to how many requests can be initiated each second; the requests do not need to finish before more can be started at the 5 request per second rate.

Burst Capacity: 100 requests

  • The burst capacity enables your application to temporarily exceed the 5 RPS limit by using pre-accumulated tokens. This allows for short spikes in traffic to be handled smoothly without triggering throttling, as long as tokens remain available in the burst bucket.

  • If you send fewer than 5 requests in a given second, burst tokens accumulate (up to 100), allowing for additional bursts in traffic.

Total Daily Quota: 200k requests

  • The total number of requests allowed in a 24 hour period.

Throttling

If the request rate is exceeded, a response with HTTP 429 Too Many Requests is sent.

To avoid throttling:

  • Keep steady usage at or below 5 requests per second.

  • Implement exponential backoff with retry logic to space out retries.

Higher Limits

If your application requires a higher sustained rate, burst capacity, or daily quota, please contact us.

PreviousPractical guideNextDownloading bulk data via the client portal

Last updated 19 days ago