Food Recognition API

The TastyAPI food recognition API identifies the food in a photo and returns its full nutrition in a single step — no manual logging, no database lookups. Send an image, get the dish name plus calories, macros, vitamins, minerals, and allergens.

Recognition + nutrition in one call

From a photo to structured nutrition

Most "food recognition" returns only a label — you still have to map that label to nutrition yourself. TastyAPI does both in one request: it recognizes the dish and returns the nutrition for the portion it sees, so a single call is enough to log a meal.

Quickstart

Upload a file as multipart form data, or pass a public image URL. Authenticate with a bearer token.

Upload a file
curl -X POST https://tastyapi.com/analyze-image \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@lunch.jpg"
200 OK
{
  "analysis": {
    "foodName": "Margherita Pizza",
    "servingSize": { "amount": 107, "unit": "g" },
    "nutrients": {
      "calories": { "amount": 285, "unit": "kcal" },
      "protein": { "amount": 12, "unit": "g" },
      "carbohydrates": { "amount": 36, "unit": "g" },
      "fat": { "amount": 10, "unit": "g" }
    },
    "allergens": { "contains": ["gluten", "dairy"], "mayContain": [] },
    "dietaryInfo": { "isVegetarian": true, "isVegan": false, "isGlutenFree": false },
    "imageAnalysis": { "quality": 0.94, "multipleFoods": false, "needsClarification": false }
  },
  "language": "en"
}

What it handles

  • Prepared meals and plated dishes — the everyday photos people actually take of their food.
  • Packaged products and raw ingredients — from a snack wrapper to a single piece of fruit.
  • Portion estimation from context — nutrition scales to the amount visible, not a fixed 100 g.
  • Allergen and dietary flags — gluten, dairy, and vegan/vegetarian/gluten-free booleans in the same response.

Where it fits

  • Photo-based food logging. Replace manual search-and-select with a single snapshot — the highest-friction step in any diet app.
  • Fitness and coaching apps. Auto-fill macros for a meal from the photo a user already shares.
  • Restaurant and delivery. Generate nutrition estimates for dish photos across a catalog.
  • Health assistants. Add a vision "what am I eating?" capability to a chatbot or agent.

Accuracy and image tips

The model is trained on tens of millions of food images and returns calibrated estimates, typically within 10–15% of laboratory analysis. Recognition is strongest on clear, well-lit photos where the whole dish is visible. Heavy occlusion, extreme angles, or very mixed plates lower confidence — for those, a follow-up text call to the Nutrition API with a short description can refine the result. Estimates are for tracking and information, not medical use.

Frequently asked

File upload or URL?

Both. Post the image as multipart form data, or send a public image URL — whichever your stack makes easier.

Does it return nutrition, or just a label?

Both, in one response: the identified dish and its full nutrition breakdown for the visible portion.

What about multi-item plates?

It estimates nutrition for the meal as photographed. For itemized control, capture items separately or refine with a text description.

Add food recognition to your app

Get a key and analyze your first food photo in minutes. 7-day free trial.

Get an API key