07-25-2017 19:55
07-25-2017 19:55
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/distanceCan 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!
Answered! Go to the Best Answer.
07-31-2017 07:31
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
07-31-2017 07:31
@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.
Best Answer07-31-2017 07:31
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
07-31-2017 07:31
@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.
Best Answer07-31-2017 07:33
07-31-2017 07:33
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!
06-06-2018 00:11
06-06-2018 00:11
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 Answer06-12-2018 09:35
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
06-12-2018 09:35
@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/
Best Answer