Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/oura_api/src/OuraBase.ts>Sleep

Typescript project to interact with v2 of the Oura Ring API
Latest
interface Sleep
Re-export
import { type Sleep } from "https://deno.land/x/oura_api@1.0.1/src/OuraBase.ts";

Holds a comprehensive set of sleep metrics provided by the Oura ring within a given timeframe. A user can have multiple sleep periods per day.

Properties

id: string

Unique identifier

average_breath: number

Average breathing rate during sleep as breaths/second

average_heart_rate: number

Average heart rate during sleep as beats/minut

average_hrv: number

Average heart rate variability during sleep

awake_time: number

Duration spent awake in seconds

bedtime_end: string

Bedtime end of the sleep

bedtime_start: string

Bedtime start of the sleep

day: string

Day that the sleep belongs to

deep_sleep_duration: number

Duration spent in deep sleep in seconds

efficiency: number

Sleep efficiency rating in range [1, 100]

heart_rate: SampleData

HR samples

HVR samples

latency: number

Sleep latency in seconds. This is the time it took for the user to fall asleep after going to bed.

light_sleep_duration: number

Duration spent in light sleep in seconds

low_battery_alert: boolean

Flag indicating if a low battery alert occurred

lowest_heart_rate: number

Lowest heart rate during sleep

movement_30_sec: string

30-second movement classification for the period where every character corresponds to: 1 no motion 2 restless 3 tossing and turning 4 active

period: number

Sleep period identifier

readiness: { contributors: { activity_balance: number | null; body_temperature: number | null; hrv_balance: number | null; previous_day_activity: number | null; previous_night: number | null; recovery_index: number | null; resting_heart_rate: number | null; sleep_balance: number | null; }; score: number; temperature_deviation: number; temperature_trend_deviation: number; }

Readiness

readiness_score_delta: number

Effect on readiness score caused by this sleep period

rem_sleep_duration: number

Duration spent in REM sleep in seconds

restless_periods: number

Number of restless periods during sleep

sleep_phase_5_min: string

5-minute sleep phase classification for the period where every character corresponds to: 1 deep sleep 2 light sleep 3 REM sleep 4 awake

sleep_score_delta: number

Effect on sleep score caused by this sleep period

sleep_algorithm_version: string

Version of the sleep algorithm used to calculate the sleep data

time_in_bed: number

Duration spent in bed in seconds

total_sleep_duration: number

Total sleep duration in seconds

type: string

Sleep period type