Aller au contenu
GET /v1/meta

Spec

Essayez-le en direct

10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.

En-têtes personnalisés (facultatif)
api.oanor.com/sleep-api

Ça marche. Récupérez une clé API et utilisez-la dans votre projet.

Obtenez une clé API

Extraits de code

curl "https://api.oanor.com/sleep-api/v1/meta" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/sleep-api/v1/meta", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/sleep-api/v1/meta");
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/meta",
    headers={"x-oanor-key": "oanor_test_..."}
)

Exemple de réponse

Une réponse réelle de ce endpoint, capturée lors du dernier contrôle de santé.

{
    "data": {
        "notes": "All clock maths is modulo 24h. Times accept 24h ('23:15') or 12h ('10:30 PM'); 'now' uses server local time.",
        "service": "sleep",
        "endpoints": {
            "/v1/nap": "Given a start time, suggest nap lengths (power / short / slow-wave / full-cycle) and end times.",
            "/v1/bedtime": "Given a wake-up time, suggest bedtimes ending on a sleep-cycle boundary.",
            "/v1/duration": "Given a bedtime and wake time, report sleep duration, full cycles, and cycle alignment.",
            "/v1/wake-time": "Given a bedtime (or 'now'), suggest wake times ending on a sleep-cycle boundary."
        },
        "disclaimer": "Informational only — not medical advice.",
        "description": "Sleep-cycle calculator: recommended bedtimes, wake times, sleep duration analysis, and nap planning, based on ~90-minute sleep cycles.",
        "fall_asleep_minutes_default": 15,
        "cycle_length_minutes_default": 90
    },
    "meta": {
        "timestamp": "2026-06-03T17:42:02.078Z",
        "request_id": "43a2769f-9994-42ac-9b74-26039bba472d"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}