Aller au contenu
GET /v1/level

Caffeine remaining after a time

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/caffeine-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/caffeine-api/v1/level" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/caffeine-api/v1/level", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/caffeine-api/v1/level");
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/level",
    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": {
        "input": {
            "hours": 5,
            "dose_mg": 200,
            "half_life_hours": 5
        },
        "disclaimer": "Informational only — caffeine half-life varies widely (≈3–7 h, longer in pregnancy or with some medications). Not medical advice.",
        "remaining_mg": 100,
        "threshold_mg": 50,
        "metabolized_mg": 100,
        "percent_remaining": 50,
        "hours_to_threshold": 10
    },
    "meta": {
        "timestamp": "2026-06-04T01:59:17.356Z",
        "request_id": "a5138b3e-1557-452d-af6c-f797a8a4da07"
    },
    "status": "ok",
    "message": "Caffeine remaining",
    "success": true
}