Expose HRV, sleep stages, calories, and contributor scores - #1
Open
lextoumbourou wants to merge 1 commit into
Open
Expose HRV, sleep stages, calories, and contributor scores#1lextoumbourou wants to merge 1 commit into
lextoumbourou wants to merge 1 commit into
Conversation
Add average HRV, deep/REM/light sleep duration, and lowest heart rate to the sleep-details response, and active/total calories to activity. Flesh out the previously-stubbed daily sleep and readiness structs with their contributor scores.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the additional information already available via Oura v2 API:
Sleepstruct (get sleep-details,sleependpoint): add average HRV, total/deep/REM/light sleep duration, awake time, latency, restless periods, average & lowest heart rate, and average breath.DailyActivitystruct (get activity,daily_activityendpoint): add active and total calories.DailySleepstruct (get sleep,daily_sleependpoint): add thecontributorsbreakdown (deep sleep, efficiency, latency, REM, restfulness, timing, total sleep).DailyReadinessstruct (get readiness,daily_readinessendpoint): add thecontributorsbreakdown (activity balance, body temperature, HRV balance, previous day activity/night, recovery index, resting heart rate, sleep balance/regularity) plustemperature_deviationandtemperature_trend_deviation.Test plan
go build ./...,go vet ./...,gofmt -l .all cleanoura get sleep { "data": [ { "id": "<uuid>", "day": "2026-07-11", "score": 75, "timestamp": "2026-07-11T00:00:00.000+00:00", "contributors": { "deep_sleep": 75, "efficiency": 67, "latency": 37, "rem_sleep": 72, "restfulness": 70, "timing": 94, "total_sleep": 85 } } ], "next_token": "" } oura get sleep-details --start <D-1> --end <D> (long_sleep record) { "id": "<uuid>", "day": "2026-07-11", "score": 0, "efficiency": 78, "type": "long_sleep", "bedtime_start": "2026-07-10T20:36:59.000+10:00", "bedtime_end": "2026-07-11T06:18:54.000+10:00", "hypnogram_5min": "", "total_sleep_duration": 27120, "time_in_bed": 34915, "deep_sleep_duration": 3750, "rem_sleep_duration": 4860, "light_sleep_duration": 18510, "awake_time": 7795, "latency": 2280, "restless_periods": 246, "average_hrv": 56, "average_heart_rate": 50.75, "lowest_heart_rate": 43, "average_breath": 13.5 } oura get activity --start <D-1> --end <D> { "data": [ { "id": "<uuid>", "day": "2026-07-11", "score": 94, "steps": 1629, "active_calories": 72, "total_calories": 2093 } ], "next_token": "" } oura get readiness --start <D-1> --end <D> { "id": "<uuid>", "day": "2026-07-11", "score": 83, "timestamp": "2026-07-11T00:00:00.000+00:00", "contributors": { "activity_balance": 73, "body_temperature": 97, "hrv_balance": 88, "previous_day_activity": 80, "previous_night": 72, "recovery_index": 65, "resting_heart_rate": 100, "sleep_balance": 93, "sleep_regularity": 85 }, "temperature_deviation": -0.22, "temperature_trend_deviation": -0.05 }