{ "opencollection": "1.0.0", "info": { "name": "Withings developer documentation answers sleep API", "version": "2.0" }, "items": [ { "info": { "name": "sleep", "type": "folder" }, "items": [ { "info": { "name": "Sleep v2 - Get", "type": "http" }, "http": { "method": "POST", "url": "https://wbsapi.withings.nethttps://wbsapi.withings.net/v2/sleep", "headers": [ { "name": "Authorization", "value": "" } ], "params": [ { "name": "action", "value": "", "type": "query", "description": "Service action name. Must take the string value ```get```." }, { "name": "startdate", "value": "", "type": "query", "description": "Data start date as a unix timestamp." }, { "name": "enddate", "value": "", "type": "query", "description": "Data end date as a unix timestamp." }, { "name": "data_fields", "value": "", "type": "query", "description": "List of requested data fields, separated by a comma.
Available data fields are listed below.
Ex: data_fields=hr,rr,snoring

hr
> Heart Rate (beats per minute).

rr
> Respiration Rate (breaths per minute).

snoring
> Total snoring time (seconds).

sdnn_1
> Heart rate variability - Standard deviation of the NN over 1 minute (in miliseconds).

rmssd
> Heart rate variability - Root mean square of the successive differences over \"a few seconds\" (in miliseconds).

hrv_quality
> Heart rate variability - quality score.

mvt_score
> Track the intensity of movement in bed on a minute-by-minute basis. The score ranges from 0 to 255, representing the intensity of movement. This metric is only available for Sleep Analyzer devices in the EU and prescription-based devices in the US (Sleep Rx).

chest_movement_rate
> Chest movement rate (events per minute).

withings_index
> Withings Sleep Rx (FDA Cleared) allows to estimate gaps in breathing sounds and to generate an index. This index corresponds to the number of breathing events per hour.\n\n\n
ValueDescription
0-15 (events per hour on average)No/Mild
15-30 (events per hour on average)Moderate
> 30 (events per hour on average)Severe
\n\n\nNote: 5 hours of sleep are required in order to calculate the Withings Index.

breathing_sounds
> Total time when breathing sounds were tracked. (seconds)

" }, { "name": "meastypes", "value": "", "type": "query", "description": "List of requested measure types (separated by a comma).
Ex: meastypes=1,4,12" } ] }, "docs": "\nReturns sleep data captured at high frequency, including sleep stages.

\n**Notes**\nIf your input ```startdate``` and ```enddate``` are separated by more than 24h, only the first 24h after ```startdate``` will be returned.

\n**IMPORTANT**: Please refer to this [page](https://developer.withings.com/developer-guide/v3/data-api/all-available-health-data/#sleep) to check the availability of metrics based on the sleep tracking device used. Some data types are regulated in the EU and U" }, { "info": { "name": "Sleep v2 - Getsummary", "type": "http" }, "http": { "method": "POST", "url": "https://wbsapi.withings.nethttps://wbsapi.withings.net/v2/sleep ", "headers": [ { "name": "Authorization", "value": "" } ], "params": [ { "name": "action", "value": "", "type": "query", "description": "Service action name. Must take the string value ```getsummary```." }, { "name": "startdateymd", "value": "", "type": "query", "description": "DO NOT USE WITH FOLLOWING PARAMS: [lastupdate]
Start date. Required if no lastupdate." }, { "name": "enddateymd", "value": "", "type": "query", "description": "DO NOT USE WITH FOLLOWING PARAMS: [lastupdate]
End date. Required if startdateymd is provided." }, { "name": "lastupdate", "value": "", "type": "query", "description": "DO NOT USE WITH FOLLOWING PARAMS: [startdateymd, enddateymd]
Timestamp for requesting data that were updated or created after this date.
Useful for data synchronization between systems.
Use this instead of startdateymd + enddateymd." }, { "name": "data_fields", "value": "", "type": "query", "description": "List of requested data fields, separated by a comma.
Available data fields are listed below.
Ex: data_fields=total_timeinbed,total_sleep_time,asleepduration

Standard sleep medicine metrics

total_timeinbed
> Total time spent in bed (seconds).

total_sleep_time
> Total time spent asleep. Sum of light, deep and rem durations (seconds).

asleepduration
> Duration of sleep when night comes from external source (seconds).
Light, Deep and Rem sleep durations are null in this case.

lightsleepduration
> Duration in state light sleep (seconds).

remsleepduration
> Duration in state REM sleep (seconds).

deepsleepduration
> Duration in state deep sleep (seconds).

sleep_efficiency
> Ratio of the total sleep time over the time spent in bed.

sleep_latency
> Time spent in bed before falling asleep (seconds).

wakeup_latency
> Time spent in bed after waking up (seconds).

wakeupduration
> Time spent awake (seconds).

wakeupcount
> Number of times the user woke up while in bed. Does not include the number of times the user got out of bed.

waso
> Time spent awake in bed after falling asleep for the 1st time during the night (seconds).

nb_rem_episodes
> Count of the REM sleep phases.


Sleep apnea and breathing disturbances

breathing_disturbances_intensity
> Intensity of breathing disturbances.
Available for all Sleep and Sleep Analyzer devices (wellness metric).

apnea_hypopnea_index
> Medical grade AHI. Average number of hypopnea and apnea episodes per hour, that occured during sleep time.
Only available for devices purchased in Europe and Australia, with the sleep apnea detection feature activated.

withings_index
> Withings Sleep Rx (FDA Cleared) allows to estimate gaps in breathing sounds and to generate an index. This index corresponds to the number of breathing events per hour.\n\n\n
ValueDescription
0-15 (events per hour on average)No/Mild
15-30 (events per hour on average)Moderate
> 30 (events per hour on average)Severe
\n\n\nNote: 5 hours of sleep are required in order to calculate the Withings Index.


Other sleep datapoints and vitals

durationtosleep
> Time to sleep (seconds). (deprecated)

durationtowakeup
> Time to wake up (seconds). (deprecated)

out_of_bed_count
> Number of times the user got out of bed during the night.

hr_average
> Average heart rate. (beats per minute).

hr_min
> Minimal heart rate (beats per minute).

hr_max
> Maximal heart rate (beats per minute)..

rr_average
> Average respiration rate (breaths per minute).

rr_min
> Minimal respiration rate (breaths per minute).

rr_max
> Maximal respiration rate (breaths per minute).

breathing_quality_assessment
> Intensity of breathing disturbances.
Available for all Sleep and Sleep Analyzer devices (wellness metric).

snoring
> Total snoring time (seconds).

snoringepisodecount
> Numbers of snoring episodes of at least one minute.

sleep_score
> Sleep score

night_events
> Summary of sleep events that happened during the sleep activity.\n\nIt is structured as a dictionary, where keys are the type of event, and the value is an array of timestamps relative to the activity startdate.\n\nTypes of events can be one of the following : \n\n
ValueDescription
1got in bed
2fell asleep
3woke up
4got out of bed
5start of asleep period that was manually input
6start of awake period that was manually input
\n\n

mvt_score_avg
> Track the average movement score in bed throughout the night. The score ranges from 0 to 255, representing the intensity of movement. This metric is only available for Sleep Analyzer devices in the EU and prescription-based devices in the US (Sleep Rx).

mvt_active_duration
> Track the duration (in seconds) of movement in bed. Only available for Sleep Analyzer devices (EU) and devices under prescriptions in the US (Sleep Rx)

rmssd_start_avg
> Heart rate variability - Start average

rmssd_end_avg
> Heart rate variability - End average

chest_movement_rate_wellness_average
> Average respiration rate (breaths per minute).

chest_movement_rate_wellness_min
> Minimal respiration rate (breaths per minute).

chest_movement_rate_wellness_max
> Maximal respiration rate (breaths per minute).

breathing_sounds
> Total time when breathing sounds were tracked. (seconds)

breathing_sounds_episode_count
> Numbers of breathing sounds episodes of at least one minute.

chest_movement_rate_average
> Average chest movement rate (events per minute).

chest_movement_rate_min
> Minimal chest movement rate (events per minute).

chest_movement_rate_max
> Maximal chest movement rate (events per minute).

core_body_temperature_min
> Minimal core body temperature (in celsius degrees).

core_body_temperature_max
> Maximal core body temperature (in celsius degrees).

core_body_temperature_avg
> Avenage core body temperature (in celsius degrees).

core_body_temperature_status
> Status of the temperature. *(Use 'data_fields' to request this data)* Value can be: 'unknown', 'usual' or 'elevated'.\n

" } ] }, "docs": "Returns sleep activity summaries, which are an aggregation of all the data captured at high frequency during the sleep activity.

\nUse the [Sleep v2 - Get](#operation/sleepv2-get) service to get the high frequency data used to build these summaries.

\n**IMPORTANT**: Please refer to this [page](https://developer.withings.com/developer-guide/v3/data-api/all-available-health-data/#sleep) to check the availability of metrics based on the sleep tracking device used. Some data types ar" } ] } ], "bundled": true }