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?
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.
Would you please confirm what endpoint you're using?
Thanks!
Gordon
Best AnswerSure 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"}
Best AnswerJust 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.
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.
@frank.west.iii Thank you for the additional testing and information. Let me do some research on my end and get back with you.
Best AnswerHi @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!
Best Answer