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

Possible to use the WebAPI to access live sleep data while sleeping?

I'm looking at the sleep section of the WebAPI docs and I can't tell when the logs are updated. I want to create an app that can track how long and what stage of sleep I am in to dynamically adjust when my alarm goes off (all of this happens while I am asleep). Will one of the end-points be able to give me that data that I can periodically pull every half hour or so? Thanks!

Best Answer
0 Votes
3 REPLIES 3

Hi @Nicolas_N 

 

The Get Sleep Log endpoint will display the sleep stages for you, but I'm not sure if the algorithm runs every time the device syncs while the user sleeps, or after the user officially wakes up.   I'll need a few days to track down the answer for you.

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

Awesome, thanks for taking a look! Let me know once you have an answer.

Best Answer
0 Votes

Unfortunately, the Web APIs are not going to work for you, since they don't send live sleep data to your tracker/smart watch.  The only suggestion I can provide is to build an application for the swart watch (Ionic or Versa family) that would track your movement and heart rate, similarly to what our sleep tracking functionality does today.  To do this, look at the Device SDK, https://dev.fitbit.com/build/reference/device-api/.  Support for the Device SDK is handled through the SDK forums, https://community.fitbit.com/t5/SDK-Development/bd-p/sdk.  I understand the developers are fairly active and might be able to provide suggestions on how you can determine when you're awake or asleep using heart rate and accelerometer data (movement).

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