Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API response headers with error 429 does not contain details

When I am reaching the rate limit per hour with response error 429 or also before I want to access the values given in the response header as described here: https://dev.fitbit.com/build/reference/web-api/developer-guide/application-design#Rate-Limits

The values are not part of the response in python 3.smth and import fitbit.

response = requests.get(f'https://api.fitbit.com/1/user/-/activities/list.json?beforeDate={year}-{month:02d}-{day:02d}&sort=desc&offset=0&limit=100', headers=headers)
 
Is this not supported anymore and documentation on API is not updated or do you have an example snippet for python how to access the returned values from response headers correctly successfully?
  • Fitbit-Rate-Limit-Limit: The quota number of calls.
  • Fitbit-Rate-Limit-Remaining: The number of calls remaining before hitting the rate limit.
  • Fitbit-Rate-Limit-Reset: The number of seconds until the rate limit resets.
Best Answer
0 Votes
1 REPLY 1

Hi @Chrisatsg 

I'm not that familiar with python programming.  However, I have researched several python-related code pages and they all state using "response.headers" to retrieve the header values.  Here's an example.

Are you attempting this and not getting the response headers from the activity endpoint?

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes