08-05-2019 02:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-05-2019 02:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
May I know is there an API available for getting sleep data that are auto-logged by tracker just like activities/tracker/steps? After referring to Fitbit Web API documentation only have get sleep log endpoint that gets all sleep data including manual log sleep data.
Answered! Go to the Best Answer.
Accepted Solutions
08-06-2019 14:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-06-2019 14:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @forAppAnonymous,
Currently, there isn't a great way to differentiate sleep data that was automatically logged by a device or manually logged on the app.
Though, one of the ways you can identify if a sleep log was tracked by the device is to look for the sleep "type" in the JSON response. If the sleep was properly recorded by a sleep stage enabled device, it will show up as "stages" on the JSON response, like so:
}, "logId": 23372319092, "minutesAfterWakeup": 0, "minutesAsleep": 506, "minutesAwake": 68, "minutesToFallAsleep": 0, "startTime": "2019-08-05T22:34:30.000", "timeInBed": 574, "type": "stages"
If the device was manually logged, you can expect to see "classic" in that field. Alternatively, if the sleep stage enabled device did not get enough data to compile a sleep stage log, it will also show up as a "classic" sleep log in that field. Right now, there isn't a way to determine if a sleep log was manually logged vs if the device did not have a strong enough reading throughout the night to create a sleep stage log.
}, "logId": 23372319092, "minutesAfterWakeup": 0, "minutesAsleep": 506, "minutesAwake": 68, "minutesToFallAsleep": 0, "startTime": "2019-08-05T22:34:30.000", "timeInBed": 574, "type": "classic"
For more information on how Sleep Stages is tracked, please see our help article "What should I know about Sleep Stages"
I hope this helps. Let me know if you have any additional questions.

08-05-2019 11:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-05-2019 11:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @forAppAnonymous,
The GET Sleep Logs endpoint that you are referring to pull sleep data that are both automatically logged by the device and manually logged on the app.
If you are referring to the type of data that the Activity Time Series offers, we did offer the v1 Sleep Time Series endpoints at one point but this has since been deprecated when moving to the v1.2 Sleep Stage endpoints.
I hope this helps. Please let me know if you have any additional questions.

08-05-2019 11:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-05-2019 11:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks for the info ,
1. Is there anyway we can differentiate sleep data that automatically logged by device and manual logged on the app for the GET Sleep Logs endpoint v1.2 ?
2. Is there any way to only get those sleep data which auto logged by device.

08-06-2019 14:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



08-06-2019 14:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @forAppAnonymous,
Currently, there isn't a great way to differentiate sleep data that was automatically logged by a device or manually logged on the app.
Though, one of the ways you can identify if a sleep log was tracked by the device is to look for the sleep "type" in the JSON response. If the sleep was properly recorded by a sleep stage enabled device, it will show up as "stages" on the JSON response, like so:
}, "logId": 23372319092, "minutesAfterWakeup": 0, "minutesAsleep": 506, "minutesAwake": 68, "minutesToFallAsleep": 0, "startTime": "2019-08-05T22:34:30.000", "timeInBed": 574, "type": "stages"
If the device was manually logged, you can expect to see "classic" in that field. Alternatively, if the sleep stage enabled device did not get enough data to compile a sleep stage log, it will also show up as a "classic" sleep log in that field. Right now, there isn't a way to determine if a sleep log was manually logged vs if the device did not have a strong enough reading throughout the night to create a sleep stage log.
}, "logId": 23372319092, "minutesAfterWakeup": 0, "minutesAsleep": 506, "minutesAwake": 68, "minutesToFallAsleep": 0, "startTime": "2019-08-05T22:34:30.000", "timeInBed": 574, "type": "classic"
For more information on how Sleep Stages is tracked, please see our help article "What should I know about Sleep Stages"
I hope this helps. Let me know if you have any additional questions.

