Food AI API

One request: a JPEG of a meal. One response: the dishes Food AI recognizes, with serving sizes and nutrition. This page documents exactly what the demo sends and receives.

Keys, plans, usage and billing are on the developer portal at dev.caloriemama.ai. Nothing there is duplicated here.

Request

curl -X POST \
  "https://api-2445582032290.production.gw.apicast.io/v1/foodrecognition?user_key=YOUR_KEY" \
  -F "media=@plate.jpg"
MethodPOST, multipart/form-data with one image file field. The field name is not significant.
Authuser_key query parameter, issued on the developer portal.
ImageJPEG. Longest side at most 544 pixels; larger images are rejected with HTTP 400 and the message Image size too big. Crop to 544x544 px please. Resize on the client before sending, as the demo does.
LanguageNames come back in English (en_US).

Response

A sample photo of enchiladas, trimmed to the first group. The full answer for this photo has seven groups.

{
  "is_food": true,
  "lang": "en_US",
  "imagecache_id": "…",
  "_timing": { "foodai_totaltime": 0.045, "foodai_classificationtime": 0.041 },
  "results": [
    {
      "group": "Enchilada",
      "items": [
        {
          "name": "Enchiladas",
          "food_id": "427d09b46a1b1395",
          "group": "Enchilada",
          "score": 105,
          "servingSizes": [
            { "unit": "1 enchilada", "servingWeight": 0.142 },
            { "unit": "100 g",       "servingWeight": 0.1 },
            { "unit": "1 oz",        "servingWeight": 0.0283495 }
          ],
          "nutrition": {
            "calories": 2042.25,
            "protein": 0.0775,
            "totalFat": 0.1268,
            "totalCarbs": 0.1549
          }
        }
      ]
    }
  ]
}
FieldMeaning
is_foodWhether the photo appears to contain food at all.
results[]Groups of related dishes, best first. A photo with several foods returns several groups.
results[].groupThe group name, for example Enchilada or Noodle Soup.
items[]Candidate dishes within the group, best first.
items[].nameDish name in English.
items[].food_idStable identifier for the dish.
items[].scoreConfidence. Higher is more likely. It is not a percentage and values above 100 occur; compare scores within one response.
items[].servingSizes[]Serving options. servingWeight is in kilograms.
items[].nutritionPer kilogram of food. calories in kcal/kg; protein, totalFat and totalCarbs as a fraction of weight. Multiply by a servingWeight to get one serving.
_timingServer-side timings in seconds, for diagnostics.
imagecache_idIdentifier of the processed image on the service.

Worked example: enchiladas at 2042 kcal/kg, one enchilada at 0.142 kg, gives 290 kcal per enchilada.

Errors

StatusBody
400{"error":{"code":400,"errorDetail":"…"}}. The message says what to fix, for example the image is too large.
401 / 403The key is missing, wrong or over its plan. Check the developer portal.

Changelog

September 2026
This site was rebuilt. No change to the API. Earlier changes are on the developer portal.