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

speed and pace unit of activity retrieved in the Get Activity Log List API endpoint

Hello,

 

In the "Get Activity Log List" API endpoint, we get list of activities with attribute details. 

 

Does anyone know in which unit (e.g. MPH) we get speed and pace?

 

We tried to check API documentation but there is no information available regarding UNIT of speed and pace.

 

Thanks,

Niklas

Best Answer
0 Votes
6 REPLIES 6

Hi @NiklasOdegaar 

 

The default unit system is metric unless otherwise specified.   See https://dev.fitbit.com/build/reference/web-api/developer-guide/application-design/#Unit-Systems.  The value of the Accept-Language header is case sensitive.

 

Gordon

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

Thanks for your reply. 

 

We don't pass any specific value in the Accept-Language header so in our case it's default unit system metric but the documentation doesn't say anything about unit of speed and pace.

 

NiklasOdegaar_0-1664186211145.png

 

Can you help us to find out what will be unit of pace and speed values, we get in the response of "Get Activity Log List" API endpoint?

 

NiklasOdegaar_2-1664186372777.png

NiklasOdegaar_1-1664186347656.png

 

 

Best Answer
0 Votes

We use the standard algorithms for speed and pace.  

 

Speed = distance / time(hour)

Pace = time(sec) / distance

 

Distance unit will be specific to the accept-language header being used.  Since you're not passing it, the default is being used.

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

Here is the activity response we received for one of the fitbit activity.

 

NiklasOdegaar_0-1664351981234.jpeg

 

As per the documentation, we always get duration in the milliseconds so if convert duration of above activity to hour and sec then it will be 1.53138889 hour and 5513 seconds.

 

NiklasOdegaar_1-1664351981235.jpeg

 

Now if we apply the standard algorithm, then it should give us following values in the Speed and Pace.

 

Speed = distance/time(hour) = 1.95139/1.53138889 = 1.27426156

Pace = time(sec)/distance = 5513/1.95139 = 2825.16565

 

But this is different then what we actually get in the Activity response (Speed - 1.884549839228296, Pace - 1910.2705192844162).

 

Can you please clarify our doubt?

Best Answer
0 Votes

Can you please help us to understand different values for Speed and Pace in our case?

Best Answer
0 Votes

Speed and pace are calculated using the GPS data.  The total distance seen on an exercise is a rough approximation sent by the tracker (unrelated to the GPS data).  To keep the mobile application consistent with the tracker, we are displaying the same data.   If the device doesn't support GPS, then we use the distance sent by the tracker to calculate speed and pace.

 

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