September 3, 2026 · 3 min read

Caffeine intake

Where logged caffeine comes from, how the daily total is built, how to pair it with sleep latency and timing, and what to build.

What caffeine_intake measures

caffeine_intake is the total caffeine logged as consumed during the local day, in milligrams.

Fieldcaffeine_intake
UnitMilligrams
ReportedDaily total, on days with at least one log
WindowMidnight to midnight, profile local time
Wearable requiredNo
APIGET /api/v1/profile/biomarker/{externalId}?categories=nutrition&types=caffeine_intake plus a date range
WebhookBiomarkerCreatedIntegrationEvent. Entries update in place, upsert on id.

Data sources

PlatformRecordNotes
iOS, HealthKitdietaryCaffeineFood loggers with caffeine in the entry, dedicated caffeine trackers, manual entry
Android, Health ConnectNutritionRecord caffeine fieldSame kinds of apps
Direct integrationsNone
Phone onlyManual entry, or entries your own app writes

How Sahha calculates caffeine_intake

  1. Pick one source for the day, for caffeine. The source with the highest daily caffeine total wins, independently of other nutrients.
  2. Sum the winning source’s entries with an end time inside the local day.

Absence means nothing was logged that day.

Interpreting the value

A cup of coffee is roughly 80 to 100 mg [1], so a total of 300 is three or four coffees. Users think in cups; show cups.

Timing matters more than total for sleep, and the biomarker has no timing. For the late-afternoon question, use the timestamped entries in data logs.

Caffeine intake is not a score factor and has no trend or comparison insight.

Use cases

A caffeine-and-sleep correlation card. Over 30 days, compare sleep latency and sleep start time on days above and below the user’s median caffeine total. Show the difference only when it is large enough to be worth a sentence.

GET /api/v1/profile/biomarker/{externalId}?categories=nutrition&types=caffeine_intake&startDateTime=2026-08-04&endDateTime=2026-09-03

An afternoon cut-off nudge, from data logs. Subscribe to caffeine data logs and prompt when an entry lands after the user’s chosen cut-off time.

Limitations

  • Logged only, and often incomplete, since many food loggers omit caffeine.
  • No timing in the biomarker.
  • Absence is not zero.

References

  1. EFSA Panel on Dietetic Products, Nutrition and Allergies. Scientific opinion on the safety of caffeine. EFSA Journal. 2015;13(5):4102. https://doi.org/10.2903/j.efsa.2015.4102

Related