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

What are the units of speed and pace in activities/list.json endpoint?

In Fitbit's Get Activity Logs List endpoint, what are the units of speed and pace?

 

GET https://api.fitbit.com/1/user/-/activities/list.json
      "pace": 309.30047594399764,
      "source": {
        "id": "2295XJ",
        "name": "Fitbit for Windows Phone",
        "type": "app",
        "url": "https://www.fitbit.com/"
      },
      "speed": 11.628206575689497,
      "startTime": "2016-01-31T19:11:49.000-08:00",

 

 

Best Answer
0 Votes
6 REPLIES 6

Hi @tryikram 

 

Speed and pace are calculated based on the localization specified by the Accept-Language header.   The Accept-Language header value is case sensitive.   If this header is missing or the value is misspelled we default to metric.   See https://dev.fitbit.com/build/reference/web-api/developer-guide/application-design/#Localization.

 

Best,

Gordon

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

Thank you Gordon for the reply. I did check this link before, however, Pace and Speed are not listed in it. (I am using en_UK).

 

 

Best Answer
0 Votes

en_UK is not one was have tested, but I would assume it uses the metric system.   Speed would km/h.  The definition of pace is time / distance.  In case, that would be h / km.

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

I am looking at Speed in a Swimming Activity. I don't think speed (1.431878820375335) is miles/hr, I tried yards/sec but that doesn't seem to equate to the duration swam or total yards swam. Any idea what unit speed is in for swimming in the US? Also I know duration is in millseconds but the only way I can work it out to what my fitbit app shoes for duration (2' 7")  is to multiply the duration (3357000) by 57 (not 60) and convert the milliseconds to time. So I guess I am looking for any additional information on the units for speed and duration in a swimming activity. Example of log data below

 

# "distance" : 1.335227,
# "distanceUnit" : "Mile",
# "duration" : 3357000,
# "activeDuration" : 3357000,

# "logType" : "auto_detected",
# "swimLengths" : 74,
# "speed" : 1.431878820375335,
# "pace" : 2514.179236938738,
# "poolLength" : 25,
# "poolLengthUnit" : "Yard",

Best Answer
0 Votes

OK, I take it back speed is miles/hour, my bad. But I would still like to know how to convert duration (in milliseconds) to what my app shows, e.g

duration" : 3357000 = 2' 07"

 

Best Answer
0 Votes

Sorry, I am having a bad day, I meant Pace not Duration

# "pace" : 2514.179236938738 (shown in JSON activity log) = 2' 07" (Shown in fitbit app)

 

The only way I can work tht out is 

pace2 = (j.pace * 57)

d_hours, d_minutes, d_seconds, timeStr = milli2time(pace2)

 

I would suspect 60 to have been an acceptable number but it always calculates to high compared to what the app shows. 57 seems to be spot on for all my swimming events, but there is not logical "math" to it.

 

Best Answer
0 Votes