01-26-2021 16:03
01-26-2021 16:03
Hi,
I am trying to export my historical data (e.g. 2018-06-01) and the following methods are used:
(1) Web API: https://api.fitbit.com/1/user/-/activities/steps/date/<date>/1d/1min.json
(2) Go to "Export your Account Archive" section of "Settings" page (URL: https://www.fitbit.com/settings/data/export ) and click "request data" button to download it.
The data I got from method (1) and method (2) are not consistent. Here is an example:
(1) From Web API:
...,{"time":"00:11:00","value":0},{"time":"00:12:00","value":0},{"time":"00:13:00","value":0},...
(2) From "Settings" page: (Physical Activity/steps-2018-05-11.json file)
...,{"dateTime" : "06/01/18 00:11:00","value" : "0"},
{"dateTime" : "06/01/18 00:12:00","value" : "32"},
{"dateTime" : "06/01/18 00:13:00","value" : "26"},...
Does anybody know if this is expected or a bug?
Thanks!
Meng
Answered! Go to the Best Answer.
01-28-2021 17:30
01-28-2021 17:30
Hi @MengL
The timestamp for the API data is based off the timezone specified in your Fitbit settings. The timestamp for the data export is adjusted to the UTC. You'll probably notice with the data export that the timestamp did not start from midnight. When comparing the 2 datasets, you'll need to take into consideration the timezone offset.
For example, I'm in the pacific timezone which is -8 hours from UTC. The output from the intraday endpoint is displaying the data in my local time and shows
{
"activities-steps": [
{
"dateTime": "2020-12-30",
"value": "7892"
}
],
"activities-steps-intraday": {
"dataset": [
{"time": "00:00:00","value": 0},
...
{"time": "00:14:00","value": 0},
{"time": "00:15:00","value": 47},
{"time": "00:16:00","value": 28},
{"time": "00:17:00","value": 29},
{"time": "00:18:00","value": 19},
However, the data in the export shows the same information but represented +8 hours for UTC.
[{"dateTime" : "12/30/20 08:01:00","value" : "0"},
…
{“dateTime" : "12/30/20 08:10:00","value" : "0"},
{"dateTime" : "12/30/20 08:15:00","value" : "47"},
{"dateTime" : "12/30/20 08:16:00","value" : "28"},
{"dateTime" : "12/30/20 08:17:00","value" : "29"},
{"dateTime" : "12/30/20 08:18:00","value" : "19"}
01-27-2021 11:00
01-27-2021 11:00
Hi @MengL
Would you please confirm the date you used within the activity endpoint? The first section should display the date requested. For example,
{
"activities-steps": [
{
"dateTime": "2021-01-27",
"value": "0"
}
],
"activities-steps-intraday": {
"dataset": [
{
"time": "00:00:00",
"value": 0
},
{
"time": "00:01:00",
"value": 0
},
{
"time": "00:02:00",
"value": 0
},
{
"time": "00:03:00",
"value": 0
In your example 2, you show the date as 2018-05-11, not 2018-06-01.
Gordon
01-27-2021 14:43
01-27-2021 14:43
Hi @Gordon-C ,
Thanks for your reply. I just checked my activity endpoint and it is correct:
"activities-steps":[{"dateTime":"2018-06-01","value":"10754"}],"activities-steps-intraday":{"dataset":[...,{"time":"00:11:00","value":0},{"time":"00:12:00","value":0},{"time":"00:13:00","value":0},...
In example 2, the downloaded folder (Physical Activity) only contains: steps-2018-03-12.json, steps-2018-04-11.json, steps-2018-05-11.json, steps-2018-06-10.json, steps-2018-07-10.json,... Since steps-2018-05-11.json file contains the dates start from 2018-05-11 to 2018-06-09, the data I shared previously is correct. The chunked section is for 2018-06-01.
[{
"dateTime" : "05/11/18 04:00:00","value" : "0"},
{"dateTime" : "05/11/18 04:01:00","value" : "0"},
,...,
{"dateTime" : "06/01/18 00:11:00","value" : "0"},
{"dateTime" : "06/01/18 00:12:00","value" : "32"},
{"dateTime" : "06/01/18 00:13:00","value" : "26"},...
Thanks,
Meng
01-28-2021 17:30
01-28-2021 17:30
Hi @MengL
The timestamp for the API data is based off the timezone specified in your Fitbit settings. The timestamp for the data export is adjusted to the UTC. You'll probably notice with the data export that the timestamp did not start from midnight. When comparing the 2 datasets, you'll need to take into consideration the timezone offset.
For example, I'm in the pacific timezone which is -8 hours from UTC. The output from the intraday endpoint is displaying the data in my local time and shows
{
"activities-steps": [
{
"dateTime": "2020-12-30",
"value": "7892"
}
],
"activities-steps-intraday": {
"dataset": [
{"time": "00:00:00","value": 0},
...
{"time": "00:14:00","value": 0},
{"time": "00:15:00","value": 47},
{"time": "00:16:00","value": 28},
{"time": "00:17:00","value": 29},
{"time": "00:18:00","value": 19},
However, the data in the export shows the same information but represented +8 hours for UTC.
[{"dateTime" : "12/30/20 08:01:00","value" : "0"},
…
{“dateTime" : "12/30/20 08:10:00","value" : "0"},
{"dateTime" : "12/30/20 08:15:00","value" : "47"},
{"dateTime" : "12/30/20 08:16:00","value" : "28"},
{"dateTime" : "12/30/20 08:17:00","value" : "29"},
{"dateTime" : "12/30/20 08:18:00","value" : "19"}
01-30-2021 10:14
01-30-2021 10:14
Hi @Gordon-C ,
Thanks so much for your help!! After considering the timezone offset, it matches!
Thanks!
Meng
03-31-2021 10:09
03-31-2021 10:09
I have exported Fitbit data using https://www.fitbit.com/settings/data/export link. I have observed that data for sleep json is in local time zone & step json is in UTC. I am confused about how to read all other datasets as well from this export. I am exploring below dataset, but it would be good if you can confirm on time zone for all available datasets. I would appreciate your help in this matter.
• heart rate
• distance
• calories
• floors/altitude
• steps
• sleep
03-31-2021 10:51
03-31-2021 10:51
I have exported Fitbit data using https://www.fitbit.com/settings/data/export link. I have observed that data for sleep json is in local time zone & step json is in UTC. I am confused about how to read all other datasets as well from this export. I am exploring below dataset, but it would be good if you can confirm on time zone for all available datasets. I would appreciate your help in this matter.
• heart rate
• distance
• calories
• floors/altitude
• steps
• sleep
09-08-2022 06:08