12-13-2021 05:02
12-13-2021 05:02
Hi,
We are implementing sleep data using the REST Web API. What we've noticed is that the sums of the individual logs for different sleep stages does not match the summary as given in the Fitbit mobile app or dashboard.
The data which gets returned in the API matches the data from the graph so that seems to be all good.
For instance the data as seen below for 11 december: https://prnt.sc/22t2zsx and https://prnt.sc/22t37au
The summary shows 39 minutes minutes in the REM stage but it should be 42.5 minutes according to the data coming from the API and as shown in the graph. How is this possible? Are there margins or accuracy faults I need to take into consideration?
Thanks!
Answered! Go to the Best Answer.
12-13-2021 12:09 - edited 12-13-2021 12:20
12-13-2021 12:09 - edited 12-13-2021 12:20
Hi @ottomania
When hovering over the graph, we are providing the total time the user was in REM sleep. This is the equivalent of totaling the REM values in the levels: [data] section of the JSON response. However, this does not give an accurate picture of a person's sleep patterns. A person has short periods of time where they enter a wake stage that occurs during the other stages, such as REM. The 39 minutes that you're seeing is the total time in REM stage minus the short wake periods that overlap. For more information on how the sleep data is calculated and returned in the JSON response, see Interpreting the Sleep Stage and Short Data.
Gordon
12-13-2021 12:09 - edited 12-13-2021 12:20
12-13-2021 12:09 - edited 12-13-2021 12:20
Hi @ottomania
When hovering over the graph, we are providing the total time the user was in REM sleep. This is the equivalent of totaling the REM values in the levels: [data] section of the JSON response. However, this does not give an accurate picture of a person's sleep patterns. A person has short periods of time where they enter a wake stage that occurs during the other stages, such as REM. The 39 minutes that you're seeing is the total time in REM stage minus the short wake periods that overlap. For more information on how the sleep data is calculated and returned in the JSON response, see Interpreting the Sleep Stage and Short Data.
Gordon
12-14-2021 00:21
12-14-2021 00:21
Hi @Gordon-C, thanks for your quick reply. That makes sense, thank you for supplying the documentation!