- Home
- Wearables
- Lab Testing
- API Reference
- Event Catalog
- Changelog
Users
Introspection
Orders
At-home Phlebotomy
Tests
Results
Health Insurance
Vitals
Body
Activity
Wellness
Nutrition
Core
Lab Testing
Timeseries Data
Summary
Get Daily sleep for user_id
API key based authentication
Provider oura/strava etc
Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00
Date to YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 23:59:59
curl --request GET \
--url {{BASE_URL}}/v2/summary/sleep/{user_id}?start_date={{START_DATE}}&end_date={{END_DATE}} \
--header 'Accept: application/json' \
--header 'x-vital-api-key: <API_KEY>'
{
"sleep": [
{
"id": "6f9d156f-a497-47b2-b940-d13771c7c937",
"calendar_date": "2022-08-04",
"bedtime_start": "2022-08-04T12:42:45.724597+00:00",
"bedtime_stop": "2022-08-04T12:42:45.724600+00:00",
"timezone_offset": 2400,
"duration": 28800,
"total": 28800,
"awake": 2400,
"light": 2400,
"rem": 2400,
"deep": 2400,
"hr_lowest": 43,
"hr_average": 50,
"hr_dip": 19.7,
"efficiency": 0.97,
"latency": 1000,
"temperature_delta": -0.2,
"average_hrv": 78,
"respiratory_rate": 14,
"source": {
"name": "Oura",
"slug": "oura",
"logo": "https://logo_url.com"
},
"user_id": "1ede2505-5ba1-41d2-a1a5-ed6887198fa4"
}
]
}
Authorizations
API key based authentication
Path Parameters
Query Parameters
Provider oura/strava etc
Date from in YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 00:00:00
Date to YYYY-MM-DD or ISO formatted date time. If a date is provided without a time, the time will be set to 23:59:59
Response
The average heart rate variability registered during the sleep period::rmssd
Total amount of awake time registered during the sleep period::seconds
UTC Time when the sleep period started
UTC Time when the sleep period ended
Date of the sleep summary in the YYYY-mm-dd format. This generally matches the sleep end date.
Date of the specified record, formatted as ISO8601 datetime string in UTC 00:00. Deprecated in favour of calendar_date.
Total amount of deep (N3) sleep registered during the sleep period::seconds
Total duration of the sleep period (sleep.duration = sleep.bedtime_end - sleep.bedtime_start)::seconds
Sleep efficiency is the percentage of the sleep period spent asleep (100% * sleep.total / sleep.duration)::perc
The average heart rate registered during the sleep period::beats per minute
Sleeping Heart Rate Dip is the percentage difference between your average waking heart rate and your average sleeping heart rate. In health studies, a greater "dip" is typically seen as a positive indicator of overall health. Currently only available for Garmin::perc
The lowest heart rate (5 minutes sliding average) registered during the sleep period::beats per minute
Detected latency from bedtime_start to the beginning of the first five minutes of persistent sleep::seconds
Total amount of light sleep registered during the sleep period::seconds
Total amount of REM sleep registered during the sleep period, minutes::seconds
Average respiratory rate::breaths per minute
A value between 1 and 100 representing how well the user slept. Currently only available for Withings, Oura, Whoop and Garmin::scalar
The skin temperature::celcius
Deprecated
The timestamp of the measurement.
Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source.
The reading type of the measurement. This is applicable only to Cholesterol, IGG and IGE.
Measured in bpm.
Heart rate in bpm
Deprecated
The timestamp of the measurement.
Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source.
The reading type of the measurement. This is applicable only to Cholesterol, IGG and IGE.
Measured in rmssd.
HRV calculated using rmssd during sleep
The end time (exclusive) of the interval.
Deprecated
The start time (inclusive) of the interval.
Depracated. The start time (inclusive) of the interval.
Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source.
The reading type of the measurement. This is applicable only to Cholesterol, IGG and IGE.
enum: 1: deep, 2: light, 3: rem, 4: awake, -1: missing_data.
Hypnogram for sleep stages {"deep": 1, "light": 2, "rem": 3, "awake": 4, "manual": 5, "missing_data": -1}
Deprecated
The timestamp of the measurement.
Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source.
The reading type of the measurement. This is applicable only to Cholesterol, IGG and IGE.
Measured in bpm.
Average respiratory rate::breaths per minute
Source the data has come from.
The identifier of the app which recorded this summary. This is only applicable to multi-source providers like Apple Health and Android Health Connect.
Deprecated. Subject to removal after 1 Jan 2024.
Deprecated. Subject to removal after 1 Jan 2024.
Provider slug. e.g., oura
, fitbit
, garmin
.
Deprecated. Use provider
instead. Subject to removal after 1 Jan 2024.
The type of the data source (app or device) by which the summary or the timeseries data were recorded. This defaults to unknown
when Vital cannot extract or infer that information
Skin temperature deviation from the long-term temperature average::celcius
Timezone offset from UTC as seconds. For example, EEST (Eastern European Summer Time, +3h) is 10800. PST (Pacific Standard Time, -8h) is -28800::seconds
Total amount of sleep registered during the sleep period (sleep.total = sleep.rem + sleep.light + sleep.deep)::seconds
User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api.
curl --request GET \
--url {{BASE_URL}}/v2/summary/sleep/{user_id}?start_date={{START_DATE}}&end_date={{END_DATE}} \
--header 'Accept: application/json' \
--header 'x-vital-api-key: <API_KEY>'
{
"sleep": [
{
"id": "6f9d156f-a497-47b2-b940-d13771c7c937",
"calendar_date": "2022-08-04",
"bedtime_start": "2022-08-04T12:42:45.724597+00:00",
"bedtime_stop": "2022-08-04T12:42:45.724600+00:00",
"timezone_offset": 2400,
"duration": 28800,
"total": 28800,
"awake": 2400,
"light": 2400,
"rem": 2400,
"deep": 2400,
"hr_lowest": 43,
"hr_average": 50,
"hr_dip": 19.7,
"efficiency": 0.97,
"latency": 1000,
"temperature_delta": -0.2,
"average_hrv": 78,
"respiratory_rate": 14,
"source": {
"name": "Oura",
"slug": "oura",
"logo": "https://logo_url.com"
},
"user_id": "1ede2505-5ba1-41d2-a1a5-ed6887198fa4"
}
]
}