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

Daily summary distance inaccurate

ANSWERED

Hi All,

   I am kinda new to the fitbit api. I am trying to get the daily summary for distance, but I keep getting back data that doesn't match the users fitbit app. For instance, I get back a daily summary of 2.47 and the user reports thats wrong and it should be 1.84. I have tried ALL calculations on the distance returned and nothing is adding up to what she is saying she is showing in her app. So I am kinda confused as to how I should be calculating the distance to display to a customer on our site. Any one have any insight on this? I'll paste a response below:

 

{"dateTime":"2017-07-16","value":"5.74535"}

She is reporting that on this day, her fitbit is saying 3.57 miles. Here is the response from the server when requesting those daily summaries:

"distances": [
            {
                "activity": "total",
                "distance": 5.75
            },
            {
                "activity": "tracker",
                "distance": 5.75
            },
            {
                "activity": "loggedActivities",
                "distance": 0
            },
            {
                "activity": "veryActive",
                "distance": 0.67
            },
            {
                "activity": "moderatelyActive",
                "distance": 1.65
            },
            {
                "activity": "lightlyActive",
                "distance": 3.42
            },
            {
                "activity": "sedentaryActive",
                "distance": 0
            }
        ]

As you can see, it clearly matches up with what we are showing her, but definitely not what she says is displaying in her app. The endpoint I am calling is 

activities/tracker/distance

Can anyone point me in the right direction? I am kinda at a loss here and am not sure how this is actually calculated. Any help is greatly appreciated. Thanks Community! 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@Taddy_Mason The data is returned in metric units so that would be correct.

 

In the example you gave, 5.75 km = 3.57 miles.

Andrew | Community Moderator, Fitbit

What motivates you?

View best answer in original post

Best Answer
0 Votes
4 REPLIES 4

@Taddy_Mason The data is returned in metric units so that would be correct.

 

In the example you gave, 5.75 km = 3.57 miles.

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes

Yep! I figured that out the other day that it was coming back in Kilometers. I didn't see it in the docs, but I could have easily overlooked it. Thanks for the answer!

Best Answer


 https://api.fitbit.com/1/user/-/activities/tracker/distance/date/2018-06-05/2018-06-06.json

Will this API always return Distance in kilometers even I setup my Distance Unit = Miles in the Fitbit App?

 

 

Best Answer
0 Votes

@SowmiyaMadesh We will send the data back in the unit defined by the Accept-Language header.  The Accept-Language values "en_US" and "en_GB" are case sensitive.  If you use the Accept-Language header en_US, then your distance unit data should return in miles.

 

https://dev.fitbit.com/build/reference/web-api/basics/

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