Caffeine Clearance API¶
Estimate caffeine clearance duration and the time when remaining caffeine is expected to fall below a sleep-protection threshold.
Endpoint¶
GET /api/v1/wellness/caffeine-clearancePOST /api/v1/wellness/caffeine-clearance/post
Parameters¶
| Name | Type | Required | In | Description |
|---|---|---|---|---|
dose_mg | number | Yes | Query/Body | Caffeine dose in mg. |
ingestion_time_hours | number (0-24) | Yes | Query/Body | Ingestion time as decimal hour, such as 14.5. |
metabolizer_type | string | No | Query/Body | fast, moderate, or slow; defaults to moderate. |
lang | string | No | Query | Response language (en,fr,es,de,pt,ja,hi,ar,bn,gu,id,it,ko,mr,nl,pa,pl,ro,ru,ta,te,th,tr,ur,vi,zh). |
Request Example¶
curl -X GET "https://api.hefitapi.com/api/v1/wellness/caffeine-clearance?dose_mg=180&ingestion_time_hours=14.5&metabolizer_type=slow&lang=en" \
-H "X-API-Key: YOUR_API_KEY"
Response Example¶
{
"dose_mg": 180.0,
"ingestion_time_hours": 14.5,
"metabolizer_type": "slow",
"half_life_hours": 8.0,
"clearance_duration_hours": 17.36,
"sleep_safety_cutoff_time": 7.86,
"clearance_speed": "slow",
"clearance_speed_label": "Slow caffeine clearance",
"summary": "Slow metabolizers should protect a longer caffeine-free sleep window.",
"recommendations": [],
"language": "en",
"_api_metadata_": {"endpoint_name": "caffeine_clearance", "response_language": "en"}
}
Localization¶
This endpoint reads health_fitness_caffeine_clearance.json from the supported language catalogs.
Recommended Endpoints¶
GET /api/v1/fitness/sleep-optimizer- Sleep Optimizer APIGET /api/v1/fitness/cortisol-stress-load- Cortisol Stress Load APIGET /api/v1/fitness/fasted-training-risk- Fasted Training Risk API