06-26-2020 11:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-26-2020 11:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Hi there,
Our application will request the activities using en_GB in the header, which returns the following values as part of the response.
Looking at this data, the `distance` is in fact returned in km after checking the fitbit activity that matches this one, but the `distanceUnit` shows "Mile".
```
"activityName": "Walk",
"activityTypeId": 90013,
"averageHeartRate": 108,
"calories": 86,
"distance": 0.859961,
"distanceUnit": "Mile",
```
Is this expected?
We were using the `distanceUnit` to ensure we calculated our distance correctly assuming this would have come back matching the `distance`, but maybe that was an incorrect assumption to the `distanceUnit`'s intended purpose in this case?
06-29-2020 10:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



06-29-2020 10:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Would you please confirm what endpoint you're using?
Thanks!
Gordon
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

06-29-2020 10:39 - edited 06-29-2020 10:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-29-2020 10:39 - edited 06-29-2020 10:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Sure thing Gordon. I was just about to test out whether or not this changes if I update my settings to use km whether or not this affects this return value.
Headers being sent are {"Authorization"=>"Bearer xxxx", "Accept-Language"=>"en_GB"}

06-29-2020 11:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

06-29-2020 11:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Just as a note, I changed my setting to be km on my device and the results are the same. I am getting the distance in km and the distanceUnit returns "Mile" still.
06-29-2020 13:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



06-29-2020 13:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@frank.west.iii Thank you for the additional testing and information. Let me do some research on my end and get back with you.
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

01-18-2022 02:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-18-2022 02:33
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @Gordon-C - If someone configures their distance settings in their profile, does that take precedence? Here's an example scenario:
I'm in the US but I set my profile to use km
My research team pulls my data using the default localization (en_US)
Does the data return in km (because the profile's settings take precedence) or does the data get converted into miles (so the localization of the API pull takes precedence)?
Thanks!

