/v1/duration
Sleep duration & cycle analysis
Try it live
10 free calls per day — no sign-up, no API key. Goes through the oanor gateway.
It works. Grab an API key and use it in your project.
Get an API keyCode snippets
curl "https://api.oanor.com/sleep-api/v1/duration" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/sleep-api/v1/duration", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/sleep-api/v1/duration");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
"https://api.oanor.com/sleep-api/v1/duration",
headers={"x-oanor-key": "oanor_test_..."}
)
Example response
A real response from this endpoint, captured by the latest health check.
{
"data": {
"bedtime": {
"time_12h": "11:00 PM",
"time_24h": "23:00",
"minute_of_day": 1380
},
"wake_at": {
"time_12h": "7:00 AM",
"time_24h": "07:00",
"minute_of_day": 420
},
"assessment": "healthy duration",
"disclaimer": "Informational only — sleep needs vary by individual; not medical advice.",
"full_cycles": 5,
"sleep_hours": 8,
"time_in_bed": "8h",
"sleep_minutes": 480,
"sleep_duration": "8h",
"on_cycle_boundary": false,
"fall_asleep_minutes": 0,
"time_in_bed_minutes": 480,
"cycle_length_minutes": 90,
"minutes_into_current_cycle": 30,
"minutes_to_next_cycle_boundary": 60
},
"meta": {
"timestamp": "2026-06-03T17:42:01.779Z",
"request_id": "0f8c2983-3fde-4359-9778-57b725c95201"
},
"status": "ok",
"message": "Sleep duration analysis",
"success": true
}