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

Extracting the most detailed sleep data (and others) from Fitbit Charge 6 – API, GitHub, any ideas?

Hi Fitbit community!

I’m looking for ways to extract the most detailed sleep data possible from my Fitbit Charge 6. I have a few questions and would really appreciate your insights:

  1. GitHub integrations – Do you know of any GitHub projects that allow extracting highly detailed sleep data from Fitbit?
        1.1. While we're at it – any general GitHub tools for Fitbit worth checking out?

  2. Fitbit API details – I know the API provides a general sleep score and some sleep phase data, but:

    • Does it allow extracting exact timestamps for each sleep phase transition (e.g., second-by-second or minute-by-minute tracking of phase predictions)?

    • Or does the API only return broad sleep summaries, making it not worth the effort?

Best Answer
0 Votes
1 REPLY 1

Hi @goderz 

1. We provide some sample code in the documentation that you could use to download sleep data.  See https://dev.fitbit.com/build/reference/web-api/developer-guide/libraries-and-sample-code/.  The sample code should get you started.  If the code doesn't contain the sleep endpoints, then you should be able to use it as a guideline when adding the Get Sleep Log by Date endpoint.  See https://dev.fitbit.com/build/reference/web-api/sleep/get-sleep-log-by-date/

I'm not aware of any Github tools.  Our support team uses 2 tools to reproduce questions from the developer community.

  1. https://dev.fitbit.com/build/reference/web-api/troubleshooting-guide/web-api-explorer/
  2. VS Code using the REST Client.  https://marketplace.visualstudio.com/items?itemName=humao.rest-client.

2. The Fitbit Web API doesn't provide the sleep score.  It provides a sleep efficiency values which is calculated differently.  

  1. The endpoint provides you all of the sleep data for a specific date.  We have an example in the documentation.   See https://dev.fitbit.com/build/reference/web-api/sleep/get-sleep-log-by-date/#Response.  For sleep stages, the data is returned in 30 second increments.  For classic sleep data, the response is returned in 60 second increments.  There is more information about how the sleep data is made available at the bottom of the page I provided.  Also, we have another page that explains how to interpret the data.  See https://dev.fitbit.com/build/reference/web-api/developer-guide/best-practices/#Interpreting-the-Slee...
  2. I believe I've already answered this question.
Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes