This endpoint estimates the nutritional information of food items based on an image. By analyzing the image, it identifies the food items present and calculates their nutritional content, including calories, fat, protein, and carbohydrates.
| Name | Example | Description |
|---|---|---|
image | ![]() | The photo file of the food. |
api-key | abcd1234 | Your API key. |
{
"nutrients": [
{
"name": "Calories",
"amount": 360.0,
"unit": "kcal",
"percent_of_daily_needs": 18.0
},
{
"name": "Fat",
"amount": 11.0,
"unit": "g",
"percent_of_daily_needs": 16.92
},
{
"name": "Saturated Fat",
"amount": 1.5,
"unit": "g",
"percent_of_daily_needs": 9.38
},
{
"name": "Carbohydrates",
"amount": 55.0,
"unit": "g",
"percent_of_daily_needs": 18.33
},
{
"name": "Net Carbohydrates",
"amount": 48.0,
"unit": "g",
"percent_of_daily_needs": 17.45
}
]
} Response Headers:
Content-Type: application/jsonX-API-Quota-Request: The number of tokens used by the requestX-API-Quota-Used: The number of tokens used in total todayX-API-Quota-Left: The number of tokens left today (depends on your plan)The API uses advanced computer vision to identify food items and estimate portion sizes. While it provides a good approximation, it is an estimate and may vary based on image quality and food preparation.
Yes, the API can identify multiple food items within a single image, but complex mixed dishes (like stews or casseroles) might be harder to analyze precisely than separated ingredients.
The API returns key nutritional data including calories, fat, saturated fat, carbohydrates, net carbohydrates, protein, and potentially others depending on the identified food.
The Nutrients from Photo API estimates nutrition by analyzing a food image, whereas the Compute Nutrition API calculates nutrition based on a precise list of ingredients or a recipe text.