Estimate Nutrients from Photo API

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.

POST
https://api.apileague.com/estimate-nutrients
Example Request and Response
POST
https://api.apileague.com/{{ examples.postNutrientsFromPhoto }}
{
    "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
        }
    ]
}

Frequently Asked Questions

How accurate is the nutrition estimation?

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.

Does it work with mixed dishes?

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.

What nutrients are returned?

The API returns key nutritional data including calories, fat, saturated fat, carbohydrates, net carbohydrates, protein, and potentially others depending on the identified food.

How is the Nutrients from Photo API different from the Compute Nutrition API?

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.

Questions? Need Help? Ask Away