Sleep, every night
get_sleep_nightsRead night-by-night sleep history to compare periods and spot patterns: bed/wake times, stages, awakenings, and vitals, newest first.
Instructions
Every night as one compact row — the tool for reading a sleep HISTORY.
One row per night, newest first: date, weekday, bed and wake time, time
asleep, deep / REM / core / awake minutes, deep and REM share, number of
awakenings, longest unbroken stretch of sleep, heart and breathing rate
while asleep, and any OTHER sleep that day (naps, the second half of a
broken night) — so a day's total sleep is asleep plus other. Column names come once in columns; each row is the
values in that order, so a whole year is ~40k characters. Read it when
the question is about a period or a pattern: weekends vs weekdays,
drifting bedtimes, which nights were worst, what changed after a date.
Which sleep tool:
· THIS one for any span of time.
· get_metric with the sleep series (sleep_minutes, bedtime_minutes,
deep_sleep_minutes, awakenings, ...) when you want the arithmetic —
weekly/monthly averages computed for you, from these same rows.
· get_sleep_detail for one or two nights in depth (stage bands,
per-stage vitals).
limit = newest N nights (default 120; pass 400 for everything, and
check coverage.more_available). since = "YYYY-MM-DD" keeps every
night on or after that day — use it for "last month" rather than
guessing a limit; with since, limit applies only if you pass it.
Read legend once. Five flags, comma-separated when a night has several:
unworn means sleep was never measured that night (not zero sleep),
motion_inferred means phone motion guessed it (leave it out of averages,
as get_metric does), daytime means the day's only sleep was a daytime
nap (real, but not a night — out of get_metric's nightly series, still
a row here), short means a main sleep under 3 h with
no stages — a nap or a partly recorded night, left out of get_metric's
sleep-duration and clock series — and no_stages means the total is
known but the stage columns are null. A null anywhere is "not measured",
never zero. Reads YOUR nights; partner=true reads your partner's
shared sleep.
Carries a coverage block: quote coverage.days_covered beside any
average, and read coverage.more_available before saying how far back
the history goes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fresh | No | ||
| limit | No | ||
| since | No | ||
| partner | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||