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

Data exported via Web API and "Settings" page are not consistent

ANSWERED

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

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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"}

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

View best answer in original post

Best Answer
7 REPLIES 7

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

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

Hi @GordonFitbit ,

 

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

Best Answer
0 Votes

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"}

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

Hi @GordonFitbit ,

 

Thanks so much for your help!! After considering the timezone offset, it matches!

 

Thanks!

Meng

Best Answer
0 Votes

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

Best Answer
0 Votes

@GordonFitbit ,

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

Best Answer

Hi @GordonFitbit, I would want the answer to @bhavsar qtn too! 

Best Answer
0 Votes