Food Image Analysis

Analyze a food photo and return a best-effort nutrition estimate, including macros and confidence metadata.

Endpoint

POST /v1/foods/analyze-image

Requests are made to:

Base URL

https://api.nutritionsignals.com

Authentication

All requests require an API key sent as a Bearer token in the Authorization header.

Authorization header

Authorization: Bearer YOUR_API_KEY

Public docs test key: Test_Test_API_Key

Request body

This endpoint accepts multipart/form-data.

Required fields

  • image (file) — the food photo (JPG/PNG/WebP recommended)

Optional fields

  • country (string) — e.g. "DE"

Try it

Paste your API key (or use the test key), upload an image, click Run, and you’ll see the raw JSON response.

Try it
POST /v1/foods/analyze-image
Tip: Use test_123 to try quickly, or get a real key in Authentication.
Fast mode (skip saving) (adds ?fast=1)
Choose a JPG/PNG/WebP (max 10MB).
Calling:
https://api.nutritionsignals.com/v1/foods/analyze-image ?fast=1
Response
{}

Examples

Use any standard HTTP client. Here are copy/paste examples:

curl -sS -X POST "https://api.nutritionsignals.com/v1/foods/analyze-image" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "image=@/path/to/meal.jpg" \
  -F "country=DE"

Response

Example response (fields may vary based on image quality and detection confidence):

Example response

{
  "id": "abc123",
  "title": "Chobani Greek Yogurt Strawberry 5.3 oz",
  "brand": "Chobani",
  "search_key": "chobani greek yogurt strawberry 5.3 oz",
  "serving": { "amount": 150, "unit": "g" },
  "calories_kcal_total": 130,
  "protein_g": 11,
  "carbs_g": 14,
  "fat_g": 0,
  "ingredients_text": "yogurt, strawberries, sugar",
  "match": {
    "confidence": 0.72,
    "source": "food_database",
    "country": "DE"
  },
  "image_url": "https://api.nutritionsignals.com/v1/images/scans/...",
  "image_hash": "sha256:..."
}

Behavior and expectations

  • Image results are estimates. Encourage users to confirm or edit detected items and serving sizes.
  • Confidence reflects how certain the system is about the detected food(s) and implied portions.
  • Consider falling back to Food Resolution with user-provided text if the scan is unclear.

Errors

  • 401 — Missing/invalid API key
  • 415 — Unsupported media or invalid image input
  • 422 — Invalid request body (missing image)
  • 429 — Rate limited
  • 5xx — Server error

What’s next?

  • Food Resolution
  • POST /v1/normalize — canonicalize nutrition inputs (coming soon)

Was this page helpful?