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
{{ message }}
Repository navigation
intraday_time_series does not correctly retrieve the data #137
We want to obtain intraday step data and what we get is different from Fitbit dashboard. We have cases where we see zero steps for a particular date but the dashboard shows +3K steps. Or, dates where the total number of steps is different from what we see in dashboard.
This code illustrates the main steps of obtaining intra-day data and processing it (e.g. obtaining the daily counts)
# user_id, client_secret, _access_token_, _refresh_token_, start_date, and end_date are passed in as input
fitbit_auth = Fitbit(
user_id,
client_secret,
oauth2=True,
access_token=_access_token_],
refresh_token=_refresh_token_])
current_date = start_date;
date_increment = datetime.timedelta(days=1)
while(current_date < end_date):
current_date_str = current_date.strftime("%Y-%m-%d")
data = fitbit_auth.intraday_time_series(
'activities/steps',
base_date = current_date_str,
detail_level = '1min',
start_time = '0:00',
end_time = '23:59')
daily_steps = 0;
data = data['activities-steps-intraday']['dataset']
for item in data:
daily_steps += item['value’]
# other processing …
print(f’{daily_steps} steps on {current_date_str}’)
current_date += date_increment
The differences between the data we get and Fitbit dashboard do not seem to follow any pattern and appear in between dates where there is a complete match. So, I don’t think there is an issue with our calls given what we retrieve matches the dashboard some of the time; it can be an issue on the Fitbit side. Any thoughts / comment are much appreciated.
changed the title [-]intraday_time_series does not currently retrieve the data[/-][+]intraday_time_series does not correctly retrieve the data[/+]on Jun 20, 2018
@sefyas This is a problem on Fitbit's side. You can prove this to yourself by using a program like Postman to make the API request directly for a date where the values don't match the dashboard, then compare the daily summary to the sum of the intraday values. Fitbit admits (somewhere on their forums a few years ago) the following conditions can cause a disparity between intraday values and daily summaries:
User didn't sync for more than 7 days
User's battery got too low
User's timezone changed
Firmware update occurred
In my experience, even a user with a charged battery that sync everyday and doesn't change timezones or update firmware can still experience this problem.
Activity
[-]intraday_time_series does not currently retrieve the data[/-][+]intraday_time_series does not correctly retrieve the data[/+]justin-f-perez commentedon Oct 5, 2018
@sefyas This is a problem on Fitbit's side. You can prove this to yourself by using a program like Postman to make the API request directly for a date where the values don't match the dashboard, then compare the daily summary to the sum of the intraday values. Fitbit admits (somewhere on their forums a few years ago) the following conditions can cause a disparity between intraday values and daily summaries:
In my experience, even a user with a charged battery that sync everyday and doesn't change timezones or update firmware can still experience this problem.
HawkingsRainbow commentedon Oct 30, 2018
I wonder if there has been any update on this issue?
I'm unable to retrieve any intraday heartrate values, using the following code:
(Based on the great Medium tutorial by Stephen Hsu at https://towardsdatascience.com/collect-your-own-fitbit-data-with-python-ff145fa10873)
[Browser-based authorization]
fit_statsHR contains only an 'activities-heart-rate' key. 'activities-heart-intraday' seems to be missing.
The complete contents of fit_statsHR are as follows:
Setting 'base_date = "today" ' yields the same result.
At the moment, I'm testing with iPython, in a Python 3 Miniconda+Windows 10 environment.
Thanks a lot in advance for any help and/or commiseration!