Fitbit Sleep Log Data Export Format
- Updated
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.
Table of Contents
Sleep Log Summary
Field | Description |
---|---|
Duration |
Sleep duration, in milliseconds. |
Efficiency |
A gauge of sleep efficiency. |
EndDate |
The end date of the time period, in ISO 8601 format. |
InfoCode |
An integer value representing the quality of data collected within the sleep log.
|
IsMainSleep |
Boolean value: true or false
|
LogId |
The unique identifier in Fitbit’s system for the activity log record. |
LogType |
The type of sleep in terms of how it was logged:
|
MinutesAfterWakeup |
Minutes it took the user to get out of bed after waking. |
MinutesAsleep |
Minutes the user spent asleep. |
MinutesAwake |
Minutes the user spent awake. |
MinutesToFallAsleep |
Minutes it took the user to fall asleep. |
ModifiedDate |
The date the entry was last modified, in ISO 8601 format. Is always in UTC. |
ParticipantID |
The stable, automatically generated, internal system identifier for this participant. Universally unique identifier (UUID). |
ParticipantIdentifier |
The MyDataHelps Designer identifier of the participant associated with the Fitbit user. Can be used to cross reference with Participants. |
SleepLevelAsleep |
Minutes spent asleep, when the data type is "classic." |
SleepLevelAwake |
Minutes spent awake, when the data type is "classic." |
SleepLevelDeep |
Minutes spent in deep sleep, when the data type is "stages." |
SleepLevelLight |
Minutes spent in light sleep, when the data type is "stages." |
SleepLevelRem |
Minutes spent in REM sleep, when the data type is "stages." |
SleepLevelRestless |
Minutes spent in restless sleep, when the data type is "classic." |
SleepLevelWake |
Minutes spent awake, when the data type is "stages." |
StartDate |
The start date of the time period, in ISO 8601 format. |
TimeInBed |
Minutes the user spent in bed. |
Type |
Fitbit provides two kinds of sleep data:
|
Sleep Log Details
Field | Description |
---|---|
EndDate |
The ending date/time of the log entry, in ISO 8601 format. |
LogId |
The unique identifier in Fitbit’s system for the activity log record. |
ParticipantID |
The stable, automatically generated, internal system identifier for this participant. Universally unique identifier (UUID). |
ParticipantIdentifier |
The MyDataHelps Designer identifier of the participant associated with the Fitbit user. Can be used to cross reference with Participants. |
SleepLogDate |
The End Date of the Sleep Log that this Sleep Log Detail corresponds to, in ISO 8601 format. |
StartDate |
The start date/time of the log entry, in ISO 8601 format. |
Type |
The type of log:
|
Value |
The type of sleep recorded (e.g., wake, deep, light, or REM). |
ModifiedDate |
The date the entry was last modified, in ISO 8601 format. Is always in UTC. |
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"
}
Was this article helpful?