curl --request GET \
--url https://app-api.spikeapi.com/v3/queries/sleeps/{sleep_id} \
--header 'Authorization: Bearer <token>'{
"modified_at": "2023-11-07T05:31:56Z",
"start_at_timestamp": "2023-11-07T05:31:56Z",
"duration": 123,
"end_at_timestamp": "2023-11-07T05:31:56Z",
"input_method": "unknown",
"metrics": {
"air_temperature": 123,
"air_temperature_max": 123,
"air_temperature_min": 123,
"ascent": 123,
"basal_body_temperature": 123,
"basal_body_temperature_max": 123,
"basal_body_temperature_min": 123,
"bedtime_duration": 123,
"blood_pressure_diastolic": 123,
"blood_pressure_diastolic_max": 123,
"blood_pressure_diastolic_min": 123,
"blood_pressure_systolic": 123,
"blood_pressure_systolic_max": 123,
"blood_pressure_systolic_min": 123,
"body_bone_mass": 123,
"body_fat": 123,
"body_fat_max": 123,
"body_fat_min": 123,
"body_mass_index": 123,
"body_temperature": 123,
"body_temperature_max": 123,
"body_temperature_min": 123,
"breathing_rate": 123,
"breathing_rate_max": 123,
"breathing_rate_min": 123,
"cadence": 123,
"cadence_max": 123,
"cadence_min": 123,
"calories_burned": 123,
"calories_burned_active": 123,
"calories_burned_basal": 123,
"calories_intake": 123,
"descent": 123,
"distance": 123,
"distance_cycling": 123,
"distance_running": 123,
"distance_swimming": 123,
"distance_walking": 123,
"distance_wheelchair": 123,
"duration_active": 123,
"ecg_rri": 123,
"ecg_voltage": 123,
"elevation": 123,
"elevation_gain": 123,
"elevation_loss": 123,
"elevation_max": 123,
"elevation_min": 123,
"floors_climbed": 123,
"glucose": 123,
"heartrate": 123,
"heartrate_max": 123,
"heartrate_min": 123,
"heartrate_resting": 123,
"heartrate_resting_max": 123,
"heartrate_resting_min": 123,
"heartrate_zone0_duration": 123,
"heartrate_zone1_duration": 123,
"heartrate_zone2_duration": 123,
"heartrate_zone3_duration": 123,
"heartrate_zone4_duration": 123,
"heartrate_zone5_duration": 123,
"height": 123,
"hrv_rmssd": 123,
"hrv_sdnn": 123,
"latitude": 123,
"longitude": 123,
"pace": 123,
"skin_temperature": 123,
"skin_temperature_max": 123,
"skin_temperature_min": 123,
"sleep_breathing_rate": 123,
"sleep_breathing_rate_max": 123,
"sleep_breathing_rate_min": 123,
"sleep_duration": 123,
"sleep_duration_awake": 123,
"sleep_duration_deep": 123,
"sleep_duration_light": 123,
"sleep_duration_nap": 123,
"sleep_duration_rem": 123,
"sleep_efficiency": 123,
"sleep_interruptions": 123,
"sleep_latency": 123,
"sleep_score": 123,
"sleep_skin_temperature_deviation": 123,
"speed": 123,
"speed_max": 123,
"speed_min": 123,
"spo2": 123,
"spo2_max": 123,
"spo2_min": 123,
"steps": 123,
"swimming_distance_per_stroke": 123,
"swimming_lengths": 123,
"vo2max": 123,
"wakeup_latency": 123,
"weight": 123
},
"provider_slug": "<string>",
"record_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"samples": {
"durations": [
123
],
"offsets": [
123
],
"values": {
"air_temperature": [
123
],
"air_temperature_max": [
123
],
"air_temperature_min": [
123
],
"ascent": [
123
],
"basal_body_temperature": [
123
],
"basal_body_temperature_max": [
123
],
"basal_body_temperature_min": [
123
],
"bedtime_duration": [
123
],
"blood_pressure_diastolic": [
123
],
"blood_pressure_diastolic_max": [
123
],
"blood_pressure_diastolic_min": [
123
],
"blood_pressure_systolic": [
123
],
"blood_pressure_systolic_max": [
123
],
"blood_pressure_systolic_min": [
123
],
"body_bone_mass": [
123
],
"body_fat": [
123
],
"body_fat_max": [
123
],
"body_fat_min": [
123
],
"body_mass_index": [
123
],
"body_temperature": [
123
],
"body_temperature_max": [
123
],
"body_temperature_min": [
123
],
"breathing_rate": [
123
],
"breathing_rate_max": [
123
],
"breathing_rate_min": [
123
],
"cadence": [
123
],
"cadence_max": [
123
],
"cadence_min": [
123
],
"calories_burned": [
123
],
"calories_burned_active": [
123
],
"calories_burned_basal": [
123
],
"calories_intake": [
123
],
"descent": [
123
],
"distance": [
123
],
"distance_cycling": [
123
],
"distance_running": [
123
],
"distance_swimming": [
123
],
"distance_walking": [
123
],
"distance_wheelchair": [
123
],
"duration_active": [
123
],
"ecg_rri": [
123
],
"ecg_voltage": [
123
],
"elevation": [
123
],
"elevation_gain": [
123
],
"elevation_loss": [
123
],
"elevation_max": [
123
],
"elevation_min": [
123
],
"floors_climbed": [
123
],
"glucose": [
123
],
"heartrate": [
123
],
"heartrate_max": [
123
],
"heartrate_min": [
123
],
"heartrate_resting": [
123
],
"heartrate_resting_max": [
123
],
"heartrate_resting_min": [
123
],
"heartrate_zone0_duration": [
123
],
"heartrate_zone1_duration": [
123
],
"heartrate_zone2_duration": [
123
],
"heartrate_zone3_duration": [
123
],
"heartrate_zone4_duration": [
123
],
"heartrate_zone5_duration": [
123
],
"height": [
123
],
"hrv_rmssd": [
123
],
"hrv_sdnn": [
123
],
"latitude": [
123
],
"longitude": [
123
],
"pace": [
123
],
"skin_temperature": [
123
],
"skin_temperature_max": [
123
],
"skin_temperature_min": [
123
],
"sleep_breathing_rate": [
123
],
"sleep_breathing_rate_max": [
123
],
"sleep_breathing_rate_min": [
123
],
"sleep_duration": [
123
],
"sleep_duration_awake": [
123
],
"sleep_duration_deep": [
123
],
"sleep_duration_light": [
123
],
"sleep_duration_nap": [
123
],
"sleep_duration_rem": [
123
],
"sleep_efficiency": [
123
],
"sleep_interruptions": [
123
],
"sleep_latency": [
123
],
"sleep_score": [
123
],
"sleep_skin_temperature_deviation": [
123
],
"speed": [
123
],
"speed_max": [
123
],
"speed_min": [
123
],
"spo2": [
123
],
"spo2_max": [
123
],
"spo2_min": [
123
],
"steps": [
123
],
"swimming_distance_per_stroke": [
123
],
"swimming_lengths": [
123
],
"vo2max": [
123
],
"wakeup_latency": [
123
],
"weight": [
123
]
}
},
"score": 123,
"sleep_date": "2023-12-25",
"sleep_id": "<string>",
"source": {
"device_manufacturer": "<string>",
"device_model": "<string>",
"device_product": "<string>",
"device_version": "<string>",
"source_bundle_identifier": "<string>",
"source_os_version": "<string>",
"source_product": "<string>",
"source_version": "<string>"
},
"stages": [
{
"duration": 123,
"end_at": "2023-11-07T05:31:56Z",
"metrics": {
"air_temperature": 123,
"air_temperature_max": 123,
"air_temperature_min": 123,
"ascent": 123,
"basal_body_temperature": 123,
"basal_body_temperature_max": 123,
"basal_body_temperature_min": 123,
"bedtime_duration": 123,
"blood_pressure_diastolic": 123,
"blood_pressure_diastolic_max": 123,
"blood_pressure_diastolic_min": 123,
"blood_pressure_systolic": 123,
"blood_pressure_systolic_max": 123,
"blood_pressure_systolic_min": 123,
"body_bone_mass": 123,
"body_fat": 123,
"body_fat_max": 123,
"body_fat_min": 123,
"body_mass_index": 123,
"body_temperature": 123,
"body_temperature_max": 123,
"body_temperature_min": 123,
"breathing_rate": 123,
"breathing_rate_max": 123,
"breathing_rate_min": 123,
"cadence": 123,
"cadence_max": 123,
"cadence_min": 123,
"calories_burned": 123,
"calories_burned_active": 123,
"calories_burned_basal": 123,
"calories_intake": 123,
"descent": 123,
"distance": 123,
"distance_cycling": 123,
"distance_running": 123,
"distance_swimming": 123,
"distance_walking": 123,
"distance_wheelchair": 123,
"duration_active": 123,
"ecg_rri": 123,
"ecg_voltage": 123,
"elevation": 123,
"elevation_gain": 123,
"elevation_loss": 123,
"elevation_max": 123,
"elevation_min": 123,
"floors_climbed": 123,
"glucose": 123,
"heartrate": 123,
"heartrate_max": 123,
"heartrate_min": 123,
"heartrate_resting": 123,
"heartrate_resting_max": 123,
"heartrate_resting_min": 123,
"heartrate_zone0_duration": 123,
"heartrate_zone1_duration": 123,
"heartrate_zone2_duration": 123,
"heartrate_zone3_duration": 123,
"heartrate_zone4_duration": 123,
"heartrate_zone5_duration": 123,
"height": 123,
"hrv_rmssd": 123,
"hrv_sdnn": 123,
"latitude": 123,
"longitude": 123,
"pace": 123,
"skin_temperature": 123,
"skin_temperature_max": 123,
"skin_temperature_min": 123,
"sleep_breathing_rate": 123,
"sleep_breathing_rate_max": 123,
"sleep_breathing_rate_min": 123,
"sleep_duration": 123,
"sleep_duration_awake": 123,
"sleep_duration_deep": 123,
"sleep_duration_light": 123,
"sleep_duration_nap": 123,
"sleep_duration_rem": 123,
"sleep_efficiency": 123,
"sleep_interruptions": 123,
"sleep_latency": 123,
"sleep_score": 123,
"sleep_skin_temperature_deviation": 123,
"speed": 123,
"speed_max": 123,
"speed_min": 123,
"spo2": 123,
"spo2_max": 123,
"spo2_min": 123,
"steps": 123,
"swimming_distance_per_stroke": 123,
"swimming_lengths": 123,
"vo2max": 123,
"wakeup_latency": 123,
"weight": 123
},
"stage": "awake",
"start_at": "2023-11-07T05:31:56Z"
}
],
"user_time_offset_minutes": 123
}This endpoint returns sleep data including different sleep stages that represent the various phases of sleep a person goes through during a sleep cycle. Each stage is characterized by distinct physiological and neurological patterns.
The different sleep stages are:
The sleep date attribution follows two simple rules to determine which date a sleep record should be associated with:
Provider Payload Date: The primary source of truth is the date provided in the payload from the sleep tracking provider. This date is used if available.
End Date Rule: If the provider payload date is not available, the sleep date is attributed to the day on which the sleep session ended.
This straightforward approach ensures consistent date attribution for sleep records, regardless of when the sleep session started or ended.
There are two types of sleep: main sleep and nap. There can be only one main sleep per day, which is the longest sleep period. A nap is a shorter sleep taken during the day and will have a sleep_duration_nap value.
Total sleep duration is the sum of the durations of light, deep, and REM sleep stages, while total time in bed also includes time spent awake.
total sleep = light + deep + rem
time in bed = total sleep + awake
Note that nap time is not included in the total sleep time for a day. Sleep latency refers to the estimated time from when rest begins until the first occurrence of light or deep sleep. The accuracy of sleep stages and latency depends entirely on the provider’s sensors and calculations. Sleep duration values are reported in milliseconds.
curl --request GET \
--url https://app-api.spikeapi.com/v3/queries/sleeps/{sleep_id} \
--header 'Authorization: Bearer <token>'{
"modified_at": "2023-11-07T05:31:56Z",
"start_at_timestamp": "2023-11-07T05:31:56Z",
"duration": 123,
"end_at_timestamp": "2023-11-07T05:31:56Z",
"input_method": "unknown",
"metrics": {
"air_temperature": 123,
"air_temperature_max": 123,
"air_temperature_min": 123,
"ascent": 123,
"basal_body_temperature": 123,
"basal_body_temperature_max": 123,
"basal_body_temperature_min": 123,
"bedtime_duration": 123,
"blood_pressure_diastolic": 123,
"blood_pressure_diastolic_max": 123,
"blood_pressure_diastolic_min": 123,
"blood_pressure_systolic": 123,
"blood_pressure_systolic_max": 123,
"blood_pressure_systolic_min": 123,
"body_bone_mass": 123,
"body_fat": 123,
"body_fat_max": 123,
"body_fat_min": 123,
"body_mass_index": 123,
"body_temperature": 123,
"body_temperature_max": 123,
"body_temperature_min": 123,
"breathing_rate": 123,
"breathing_rate_max": 123,
"breathing_rate_min": 123,
"cadence": 123,
"cadence_max": 123,
"cadence_min": 123,
"calories_burned": 123,
"calories_burned_active": 123,
"calories_burned_basal": 123,
"calories_intake": 123,
"descent": 123,
"distance": 123,
"distance_cycling": 123,
"distance_running": 123,
"distance_swimming": 123,
"distance_walking": 123,
"distance_wheelchair": 123,
"duration_active": 123,
"ecg_rri": 123,
"ecg_voltage": 123,
"elevation": 123,
"elevation_gain": 123,
"elevation_loss": 123,
"elevation_max": 123,
"elevation_min": 123,
"floors_climbed": 123,
"glucose": 123,
"heartrate": 123,
"heartrate_max": 123,
"heartrate_min": 123,
"heartrate_resting": 123,
"heartrate_resting_max": 123,
"heartrate_resting_min": 123,
"heartrate_zone0_duration": 123,
"heartrate_zone1_duration": 123,
"heartrate_zone2_duration": 123,
"heartrate_zone3_duration": 123,
"heartrate_zone4_duration": 123,
"heartrate_zone5_duration": 123,
"height": 123,
"hrv_rmssd": 123,
"hrv_sdnn": 123,
"latitude": 123,
"longitude": 123,
"pace": 123,
"skin_temperature": 123,
"skin_temperature_max": 123,
"skin_temperature_min": 123,
"sleep_breathing_rate": 123,
"sleep_breathing_rate_max": 123,
"sleep_breathing_rate_min": 123,
"sleep_duration": 123,
"sleep_duration_awake": 123,
"sleep_duration_deep": 123,
"sleep_duration_light": 123,
"sleep_duration_nap": 123,
"sleep_duration_rem": 123,
"sleep_efficiency": 123,
"sleep_interruptions": 123,
"sleep_latency": 123,
"sleep_score": 123,
"sleep_skin_temperature_deviation": 123,
"speed": 123,
"speed_max": 123,
"speed_min": 123,
"spo2": 123,
"spo2_max": 123,
"spo2_min": 123,
"steps": 123,
"swimming_distance_per_stroke": 123,
"swimming_lengths": 123,
"vo2max": 123,
"wakeup_latency": 123,
"weight": 123
},
"provider_slug": "<string>",
"record_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"samples": {
"durations": [
123
],
"offsets": [
123
],
"values": {
"air_temperature": [
123
],
"air_temperature_max": [
123
],
"air_temperature_min": [
123
],
"ascent": [
123
],
"basal_body_temperature": [
123
],
"basal_body_temperature_max": [
123
],
"basal_body_temperature_min": [
123
],
"bedtime_duration": [
123
],
"blood_pressure_diastolic": [
123
],
"blood_pressure_diastolic_max": [
123
],
"blood_pressure_diastolic_min": [
123
],
"blood_pressure_systolic": [
123
],
"blood_pressure_systolic_max": [
123
],
"blood_pressure_systolic_min": [
123
],
"body_bone_mass": [
123
],
"body_fat": [
123
],
"body_fat_max": [
123
],
"body_fat_min": [
123
],
"body_mass_index": [
123
],
"body_temperature": [
123
],
"body_temperature_max": [
123
],
"body_temperature_min": [
123
],
"breathing_rate": [
123
],
"breathing_rate_max": [
123
],
"breathing_rate_min": [
123
],
"cadence": [
123
],
"cadence_max": [
123
],
"cadence_min": [
123
],
"calories_burned": [
123
],
"calories_burned_active": [
123
],
"calories_burned_basal": [
123
],
"calories_intake": [
123
],
"descent": [
123
],
"distance": [
123
],
"distance_cycling": [
123
],
"distance_running": [
123
],
"distance_swimming": [
123
],
"distance_walking": [
123
],
"distance_wheelchair": [
123
],
"duration_active": [
123
],
"ecg_rri": [
123
],
"ecg_voltage": [
123
],
"elevation": [
123
],
"elevation_gain": [
123
],
"elevation_loss": [
123
],
"elevation_max": [
123
],
"elevation_min": [
123
],
"floors_climbed": [
123
],
"glucose": [
123
],
"heartrate": [
123
],
"heartrate_max": [
123
],
"heartrate_min": [
123
],
"heartrate_resting": [
123
],
"heartrate_resting_max": [
123
],
"heartrate_resting_min": [
123
],
"heartrate_zone0_duration": [
123
],
"heartrate_zone1_duration": [
123
],
"heartrate_zone2_duration": [
123
],
"heartrate_zone3_duration": [
123
],
"heartrate_zone4_duration": [
123
],
"heartrate_zone5_duration": [
123
],
"height": [
123
],
"hrv_rmssd": [
123
],
"hrv_sdnn": [
123
],
"latitude": [
123
],
"longitude": [
123
],
"pace": [
123
],
"skin_temperature": [
123
],
"skin_temperature_max": [
123
],
"skin_temperature_min": [
123
],
"sleep_breathing_rate": [
123
],
"sleep_breathing_rate_max": [
123
],
"sleep_breathing_rate_min": [
123
],
"sleep_duration": [
123
],
"sleep_duration_awake": [
123
],
"sleep_duration_deep": [
123
],
"sleep_duration_light": [
123
],
"sleep_duration_nap": [
123
],
"sleep_duration_rem": [
123
],
"sleep_efficiency": [
123
],
"sleep_interruptions": [
123
],
"sleep_latency": [
123
],
"sleep_score": [
123
],
"sleep_skin_temperature_deviation": [
123
],
"speed": [
123
],
"speed_max": [
123
],
"speed_min": [
123
],
"spo2": [
123
],
"spo2_max": [
123
],
"spo2_min": [
123
],
"steps": [
123
],
"swimming_distance_per_stroke": [
123
],
"swimming_lengths": [
123
],
"vo2max": [
123
],
"wakeup_latency": [
123
],
"weight": [
123
]
}
},
"score": 123,
"sleep_date": "2023-12-25",
"sleep_id": "<string>",
"source": {
"device_manufacturer": "<string>",
"device_model": "<string>",
"device_product": "<string>",
"device_version": "<string>",
"source_bundle_identifier": "<string>",
"source_os_version": "<string>",
"source_product": "<string>",
"source_version": "<string>"
},
"stages": [
{
"duration": 123,
"end_at": "2023-11-07T05:31:56Z",
"metrics": {
"air_temperature": 123,
"air_temperature_max": 123,
"air_temperature_min": 123,
"ascent": 123,
"basal_body_temperature": 123,
"basal_body_temperature_max": 123,
"basal_body_temperature_min": 123,
"bedtime_duration": 123,
"blood_pressure_diastolic": 123,
"blood_pressure_diastolic_max": 123,
"blood_pressure_diastolic_min": 123,
"blood_pressure_systolic": 123,
"blood_pressure_systolic_max": 123,
"blood_pressure_systolic_min": 123,
"body_bone_mass": 123,
"body_fat": 123,
"body_fat_max": 123,
"body_fat_min": 123,
"body_mass_index": 123,
"body_temperature": 123,
"body_temperature_max": 123,
"body_temperature_min": 123,
"breathing_rate": 123,
"breathing_rate_max": 123,
"breathing_rate_min": 123,
"cadence": 123,
"cadence_max": 123,
"cadence_min": 123,
"calories_burned": 123,
"calories_burned_active": 123,
"calories_burned_basal": 123,
"calories_intake": 123,
"descent": 123,
"distance": 123,
"distance_cycling": 123,
"distance_running": 123,
"distance_swimming": 123,
"distance_walking": 123,
"distance_wheelchair": 123,
"duration_active": 123,
"ecg_rri": 123,
"ecg_voltage": 123,
"elevation": 123,
"elevation_gain": 123,
"elevation_loss": 123,
"elevation_max": 123,
"elevation_min": 123,
"floors_climbed": 123,
"glucose": 123,
"heartrate": 123,
"heartrate_max": 123,
"heartrate_min": 123,
"heartrate_resting": 123,
"heartrate_resting_max": 123,
"heartrate_resting_min": 123,
"heartrate_zone0_duration": 123,
"heartrate_zone1_duration": 123,
"heartrate_zone2_duration": 123,
"heartrate_zone3_duration": 123,
"heartrate_zone4_duration": 123,
"heartrate_zone5_duration": 123,
"height": 123,
"hrv_rmssd": 123,
"hrv_sdnn": 123,
"latitude": 123,
"longitude": 123,
"pace": 123,
"skin_temperature": 123,
"skin_temperature_max": 123,
"skin_temperature_min": 123,
"sleep_breathing_rate": 123,
"sleep_breathing_rate_max": 123,
"sleep_breathing_rate_min": 123,
"sleep_duration": 123,
"sleep_duration_awake": 123,
"sleep_duration_deep": 123,
"sleep_duration_light": 123,
"sleep_duration_nap": 123,
"sleep_duration_rem": 123,
"sleep_efficiency": 123,
"sleep_interruptions": 123,
"sleep_latency": 123,
"sleep_score": 123,
"sleep_skin_temperature_deviation": 123,
"speed": 123,
"speed_max": 123,
"speed_min": 123,
"spo2": 123,
"spo2_max": 123,
"spo2_min": 123,
"steps": 123,
"swimming_distance_per_stroke": 123,
"swimming_lengths": 123,
"vo2max": 123,
"wakeup_latency": 123,
"weight": 123
},
"stage": "awake",
"start_at": "2023-11-07T05:31:56Z"
}
],
"user_time_offset_minutes": 123
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Sleep ID
OK
Modified at
Record start time
Record duration
Record end time
Data input method
unknown, manual, device Metrics output
Show child attributes
Provider slugs
"strava"
"omron_eu"
"omron_us"
"health_connect"
"fitbit"
"garmin"
"huawei"
"dexcom"
"whoop"
"withings"
"suunto"
"apple"
"freestyle_libre"
"oura"
"polar"
"coros"
"ultrahuman"
"samsung_health_data"
"luna"
Unique identifier for a record.
Show child attributes
Calendar date for which the sleep is attributed
"2006-01-02"
Show child attributes
Show child attributes
User time offset in minutes