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

Does "totalMinutesAsleep" Always Match the Sum of "sleep > minutesAsleep"?

I am attempting to retrieve sleep duration values using the Fitbit Web API that match those displayed in the Fitbit app.

 

/1.2/user/[user-id]/sleep/date/[date].json

 

I understand that the "summary > totalMinutesAsleep" value returned by this API matches the total sleep time in a day as displayed in the Fitbit app.

 

/1.2/user/[user-id]/sleep/date/[startDate]/[endDate].json

 

I would like to know if the "sleep > minutesAsleep" values returned by this API, when summed for the same "dateOfSleep", always match the aforementioned "totalMinutesAsleep" value.

Is there a possibility of difference in these values due to rounding up or down of seconds?

Best Answer
0 Votes
1 REPLY 1

Hi @TatsuDev 

A user can create multiple sleeps logs for a specific date.   The minutesAsleep value is for the specific sleep log, and totalMinutesAsleep should be the sum of all minutesAsleep values for the specific date.   

If you are seeing the sum of minutesAsleep not equaling the totalMinutesAsleep for a single date, please let us know and provide an example.

Gordon

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