Skip to content

Foods

The food database backs meal logging (carb counting). Search is cached server-side via NutritionService.searchAndCache.

Public API (API key)

Terminal window
curl "https://api.levelcast.org/api/v1/public/foods/search?q=apple" \
-H "X-API-KEY: lc_your_key_here"
# → { "success": true, "data": [ …up to 20 items with macros… ] }
  • q needs at least 2 characters (400 otherwise).
  • No patient scoping: any valid key (read scope) can search.
  • Up to 20 results with macros per item.

Pair with POST /api/v1/public/patients/:patientId/events (eventType: "meal", value + valueUnit) to log what was eaten.