12-14-2023 18:07
12-14-2023 18:07
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?
01-02-2024 13:10
01-02-2024 13:10
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