API Reference
Food details API
A food details API returns one food by ID, including macros per 100 g and the nutrients array. The ID comes from search or suggest. Scale another portion with /calc/portion, or multiply the per-100 g values by grams / 100.
GET /api/v1/foods/{id}
curl "https://calorieapiadmin.com/api/v1/foods/12345" \ -H "X-API-Key: your_api_key_here"
Path parameters
idFood ID from search, suggest, or list responsesTypical flow
- Autocomplete with /search/suggest while the user types (lightweight id + name payloads).
- Fetch /foods/{id} when the user selects a suggestion to get full macros, nutrients, and verified_portions.
- Let the user pick a portion label; scale nutrients with grams/100 or GET /calc/portion.
- Store the food ID with the log entry so re-logging skips the search step.
Food IDs are stable, so caching details client-side or in your backend is safe and saves quota for frequently logged foods.
Frequently asked questions
Are food IDs stable across time?
Yes, IDs are stable identifiers, so you can persist them with user logs and re-fetch details later.
Does the details endpoint include micronutrients?
Yes, when available. The nutrients array covers vitamins and minerals alongside the guaranteed per-100g macro set.
