You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to export breathing rate data intraday by date, however could not find specific help on this in the python fitbit documentation. I have successfully authorized and then exported heart rate data, using the following call:
Also, I added a new function in api.py that should work for breathing rate and for spo2 (and maybe others). I say should because when I try it I get a 403 error back and I don't know why.
def intraday_time_series2(self, resource, base_date='today'):
"""
another one to handle spo2 and probably some others
"""
url = "{0}/{1}/user/-/{resource}/date/{base_date}/all".format(
*self._get_common_args(),
resource=resource,
base_date=self._get_date_string(base_date)
)
url = url + '.json'
return self.make_request(url)
If you copy that in and call fit_statsBR = auth2_client.intraday_time_series2('br', base_date="2022-05-14") it should work. But you'll probably get a 403 error instead. If you figure out why, let me know :)
I can get my own breathing rate data via the Web API Explorer, strange that this does not work with python as the library should be built on those very same calls!
My theory is that on the Fitbit side, the Web API Explorer has permission to get the data but our "Personal" applications don't (even though the documentation says that Personal apps are supposed to be able to access all data of the app owner).
I'm hoping that the request for intraday data I mentioned above will help things.
Update: I also submitted a support request with Fitbit. I hope that does something.
Here's the info I got from Fitbit support:
_We've identified an issue with the personal application setting for querying intraday data from the new endpoints (SpO2, HRV, and Breathing Rate). While it is intended for personal applications to fetch this data, it is currently not behaving as expected today.
We're working with engineering to resolve this as soon as possible. In the meantime, I recommend continued use of the Web API Explorer to pull the data from your account._
Activity
mmcc-xx commentedon Jul 28, 2022
Similarly, spO2 intraday is now available according to API docs.
Thanks!
mmcc-xx commentedon Jul 30, 2022
In api.py, in the authorize_token_url function, the list of scopes need to be updated...
Also, I added a new function in api.py that should work for breathing rate and for spo2 (and maybe others). I say should because when I try it I get a 403 error back and I don't know why.
If you copy that in and call fit_statsBR = auth2_client.intraday_time_series2('br', base_date="2022-05-14") it should work. But you'll probably get a 403 error instead. If you figure out why, let me know :)
I suspect it is a problem on the Fitbit side, not in this library. I have posted a question on their developers forum:
https://community.fitbit.com/t5/Web-API-Development/Can-t-get-spo2-but-can-get-intraday-heart-rate/td-p/5200834
MEINHL commentedon Aug 2, 2022
Thanks @mmcc-xx for your help and posting to the fitbit forum! :)
I receive the same 403 error and not sure why, but would also suspect it is a problem on the fitbit side....
mmcc-xx commentedon Aug 2, 2022
You can try out the API calls with their Web API Explorer, which is described here: https://dev.fitbit.com/build/reference/web-api/troubleshooting-guide/debugging-tools/
I've also filled in the request form here to specifically ask for access to intraday data: https://dev.fitbit.com/build/reference/web-api/intraday/
No response yet.
MEINHL commentedon Aug 2, 2022
I can get my own breathing rate data via the Web API Explorer, strange that this does not work with python as the library should be built on those very same calls!
mmcc-xx commentedon Aug 2, 2022
My theory is that on the Fitbit side, the Web API Explorer has permission to get the data but our "Personal" applications don't (even though the documentation says that Personal apps are supposed to be able to access all data of the app owner).
I'm hoping that the request for intraday data I mentioned above will help things.
Update: I also submitted a support request with Fitbit. I hope that does something.
mmcc-xx commentedon Aug 3, 2022
Here's the info I got from Fitbit support:
_We've identified an issue with the personal application setting for querying intraday data from the new endpoints (SpO2, HRV, and Breathing Rate). While it is intended for personal applications to fetch this data, it is currently not behaving as expected today.
We're working with engineering to resolve this as soon as possible. In the meantime, I recommend continued use of the Web API Explorer to pull the data from your account._
MEINHL commentedon Aug 3, 2022
That is great news, thanks for the update ! :)
MEINHL commentedon Sep 16, 2022
Judging from this post
https://community.fitbit.com/t5/Web-API-Development/Can-t-get-spo2-but-can-get-intraday-heart-rate/td-p/5200834
it seems that fitbit has fixed the issue with the personal authorization, however my python code above still fails with the same error.
Any ideas why this could be?
@mmcc-xx did it solve the issue for you ?
cleye-sherpah commentedon Jul 24, 2024
Bit late but if anyone is after intraday time series for breathing rate, HRV or SpO2 - I've just created a pull request that adds support for this:
#177