◐ Shell
clean mode source ↗

Support for Fitbit API rate limiting headers by epall · Pull Request #136 · orcasgit/python-fitbit

Fitbit's API returns several headers that help clients know how close they are to having their requests denied with an HTTP 429 error. By exposing the rate limiting-related headers as fields on the Fitbit client object, we help consumers make better decisions about how and when to make requests.
Fitbit gives us enough information in HTTP response headers to know when the next request would be refused with an HTTP 429 response due to rate limiting. Instead of making that request, we can avoid it and throw an informative error message to consumers.