API Reference
Food Details
Fetch the complete nutrition payload for a single food by its ID, typically after a user picks a result from search or autocomplete suggest. The response includes per-100g macro values, the full structured nutrients array (micronutrients when available), serving metadata, verified_portions / suggested_serving for verified foods, default_portion, and portion_nutrients / meal scaled to that default. Use another portion by calling /calc/portion with its grams, or scale the per-100g values yourself — multiply calories_100g / protein_100g / … (or each nutrients[] item’s amount) by grams / 100.
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.
