Skip to content
  • There are no suggestions because the search field is empty.

Fitbit Sleep Log Data Export Format

The Fitbit data export contains information from participants' Fitbit sleep activity, including:

  • Sleep Log Summary - A high-level summary of each participant's daily sleep patterns.
  • Sleep Log Details - A detailed breakdown of sleep data. Each entry contains information for a particular participant and time period, indicating whether the participant was awake or asleep, and their quality of sleep. The detailed log also tracks short periods (<= 3 minutes) of wakefulness, which may overlap with other sleep periods.

In the CSV export, the summary and details will be found in two separate data files. In the JSON export, they are combined.

The data in the Fitbit export is obtained through the Fitbit API. The available data will vary based on the device capabilities and the user's privacy settings. See the Fitbit "Get Sleep Log" documentation for more information about using and interpreting Fitbit data.


Sleep Log Summary

Stages vs. Classic Types

The type of detailed data you are getting can be identified using the "Type" field of the session summary export. Those two types will be categorized as follows:

  • stages - Reports data with 30-second granularity, and grades sleep as deep, light, rem, or wake.

  • classic - Reports data with 60-second granularity, and grades sleep as asleep, restless, or awake.

In general, you can expect stages data for each sleep session, unless any of the following are true:

  • If the wearer slept in a position that prevented the device from getting a consistent heart-rate reading or wore it too loosely. (Implicitly, the device must support HR - which most Fitbits do)

  • If the wearer used the Begin Sleep Now option in the Fitbit app (instead of simply wearing the device to bed). 

  • If the wearer slept for less than 3 hours.

  • If the wearer's device’s battery is critically low.

Sleep Log Details

 

Sample CSV Export

In the CSV export, the summary and details are in separate files.

Sleep Log Summary

ParticipantIdentifier,StartDate,EndDate,Duration,Efficiency,InfoCode,MinutesAfterWakeup,MinutesAsleep,MinutesAwake,MinutesToFallAsleep,TimeInBed,Type,SleepLevelAwake,SleepLevelAsleep,SleepLevelDeep,SleepLevelLight,SleepLevelRem,SleepLevelRestless,SleepLevelWake,LogId,ParticipantID,IsMainSleep,LogType,ModifiedDate
aaaa-bbbb-cccc-dddd,2023-09-20T21:23:30,2023-09-21T06:38:00,33240000,98,0,0,501,53,0,554,stages,,,105,319,77,,53,45678901234,bbbb-cccc-dddd-eeee,True,auto_detected,2044f35e-3126-ee11-a197-d4d853adda9e,True,auto_detected,2023-10-19T15:13:52Z
1111-2222-3333-4444,2023-09-19T23:00:00,2023-09-20T07:00:00,28800000,100,0,0,480,0,0,480,classic,0,480,,,,0,,2345678901,2222-3333-4444-5555,True,manual,2044f35e-3126-ee11-a197-d4d853adda9e,True,auto_detected,2023-10-19T15:13:52Z

Sleep Log Details

ParticipantIdentifier,SleepLogDate,Type,StartDate,EndDate,Value,LogId,ParticipantID,ModifiedDate
aaaa-bbbb-cccc-dddd,2023-09-21T06:38:00,ShortSleepLevel,2023-09-20T21:45:00,2023-09-20T21:45:30,wake,45678901234,bbbb-cccc-dddd-eeee,2023-10-19T15:13:52Z
aaaa-bbbb-cccc-dddd,2023-09-21T06:38:00,ShortSleepLevel,2023-09-20T23:08:30,2023-09-20T23:09:00,wake,45678901234,bbbb-cccc-dddd-eeee,2023-10-19T15:14:57Z
aaaa-bbbb-cccc-dddd,2023-09-21T06:38:00,SleepLevel,2023-09-20T21:23:30,2023-09-20T21:41:00,wake,45678901234,bbbb-cccc-dddd-eeee,2023-10-19T15:14:58Z
aaaa-bbbb-cccc-dddd,2023-09-21T06:38:00,SleepLevel,2023-09-20T21:41:00,2023-09-20T21:58:00,light,45678901234,bbbb-cccc-dddd-eeee,2023-10-19T15:14:59Z
aaaa-bbbb-cccc-dddd,2023-09-21T06:38:00,SleepLevel,2023-09-20T21:58:00,2023-09-20T23:09:00,deep,45678901234,bbbb-cccc-dddd-eeee,2023-10-19T15:15:02Z
1111-2222-3333-4444,2023-09-20T07:00:00,SleepLevel,2023-09-19T23:00:00,2023-09-20T07:00:00,asleep,2345678901,2222-3333-4444-5555,2023-10-19T15:15:53Z

Sample JSON Export

In the JSON export, the summary and details are in the same file.

{
"ParticipantIdentifier": "aaaa-bbbb-cccc-dddd",
"StartDate": "2023-09-20T21:23:30",
"EndDate": "2023-09-21T06:38:00",
"Duration": "33240000",
"Efficiency": "98",
"InfoCode": "0",
"MinutesAfterWakeup": "0",
"MinutesAsleep": "501",
"MinutesAwake": "53",
"MinutesToFallAsleep": "0",
"TimeInBed": "554",
"Type": "stages",
"SleepLevelDeep": "105",
"SleepLevelLight": "319",
"SleepLevelRem": "77",
"SleepLevelWake": "53",
"SleepLogDetails": [
{
"Type": "ShortSleepLevel",
"StartDate": "2023-09-20T21:45:00",
"EndDate": "2023-09-20T21:45:30",
"Value": "wake"
},
{
"Type": "ShortSleepLevel",
"StartDate": "2023-09-20T23:08:30",
"EndDate": "2023-09-20T23:09:00",
"Value": "wake"
},
{
"Type": "SleepLevel",
"StartDate": "2023-09-20T21:23:30",
"EndDate": "2023-09-20T21:41:00",
"Value": "wake"
},
{
"Type": "SleepLevel",
"StartDate": "2023-09-20T21:41:00",
"EndDate": "2023-09-20T21:58:00",
"Value": "light"
},
{
"Type": "SleepLevel",
"StartDate": "2023-09-20T21:58:00",
"EndDate": "2023-09-20T23:09:00",
"Value": "deep"
},
],
"LogId": "45678901234",
"ParticipantID": "bbbb-cccc-dddd-eeee",
"IsMainSleep": "True",
"LogType": "auto_detected"
"ModifiedDate": "2023-10-19T15:48:19Z"
}
{
"ParticipantIdentifier": "1111-2222-3333-4444",
"StartDate": "2023-09-19T23:00:00",
"EndDate": "2023-09-20T07:00:00",
"Duration": "28800000",
"Efficiency": "100",
"InfoCode": "0",
"MinutesAfterWakeup": "0",
"MinutesAsleep": "480",
"MinutesAwake": "0",
"MinutesToFallAsleep": "0",
"TimeInBed": "480",
"Type": "classic",
"SleepLevelAwake": "0",
"SleepLevelAsleep": "480",
"SleepLevelRestless": "0",
"SleepLogDetails": [
{
"Type": "SleepLevel",
"StartDate": "2023-09-19T23:00:00",
"EndDate": "2023-09-20T07:00:00",
"Value": "asleep"
}
],
"LogId": "2345678901",
"ParticipantID": "2222-3333-4444-5555",
"IsMainSleep": "True",
"LogType": "manual" ],
{
"ParticipantID": "2044F35E-3126-EE11-A197-D4D853ADDA9E",
"IsMainSleep": "True",
"LogType": "auto_detected",
"ModifiedDate": "2023-10-19T15:48:19Z"
}