/v1/timeline
Hour-by-hour decay + sleep-safe time
Essayez-le en direct
10 appels gratuits par jour — sans inscription, sans clé API. Passe par la passerelle oanor.
Ça marche. Récupérez une clé API et utilisez-la dans votre projet.
Obtenez une clé APIExtraits de code
curl "https://api.oanor.com/caffeine-api/v1/timeline" \ -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/caffeine-api/v1/timeline", {
headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/caffeine-api/v1/timeline");
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/caffeine-api/v1/timeline",
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": {
"note": "First-order decay: mg(t) = dose × 0.5^(t / half-life). 'Sleep safe' is when caffeine falls below the threshold (default 50 mg).",
"input": {
"step": 1,
"hours": 24,
"dose_mg": 200,
"half_life_hours": 5,
"sleep_threshold_mg": 50
},
"timeline": [
{
"mg": 200,
"hour": 0
},
{
"mg": 174.11,
"hour": 1
},
{
"mg": 151.57,
"hour": 2
},
{
"mg": 131.95,
"hour": 3
},
{
"mg": 114.87,
"hour": 4
},
{
"mg": 100,
"hour": 5
},
{
"mg": 87.06,
"hour": 6
},
{
"mg": 75.79,
"hour": 7
},
{
"mg": 65.98,
"hour": 8
},
{
"mg": 57.43,
"hour": 9
},
{
"mg": 50,
"hour": 10
},
{
"mg": 43.53,
"hour": 11
},
{
"mg": 37.89,
"hour": 12
},
{
"mg": 32.99,
"hour": 13
},
{
"mg": 28.72,
"hour": 14
},
{
"mg": 25,
"hour": 15
},
{
"mg": 21.76,
"hour": 16
},
{
"mg": 18.95,
"hour": 17
},
{
"mg": 16.49,
"hour": 18
},
{
"mg": 14.36,
"hour": 19
},
{
"mg": 12.5,
"hour": 20
},
{
"mg": 10.88,
"hour": 21
},
{
"mg": 9.47,
"hour": 22
},
{
"mg": 8.25,
"hour": 23
},
{
"mg": 7.18,
"hour": 24
}
],
"disclaimer": "Informational only — caffeine half-life varies widely (≈3–7 h, longer in pregnancy or with some medications). Not medical advice.",
"hours_to_sleep_safe": 10
},
"meta": {
"timestamp": "2026-06-04T01:59:17.545Z",
"request_id": "83eed1ea-6383-4119-a56b-5125816479e3"
},
"status": "ok",
"message": "Decay timeline",
"success": true
}