Food Image Analysis
Analyze a food photo and return a best-effort nutrition estimate, including macros and confidence metadata.
This endpoint is in active development. Image-based nutrition is inherently probabilistic — always treat results as suggestions and consider adding a user confirmation step.
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"
Tip: Photos taken in good lighting with the full plate visible typically yield better results.
Try it
Paste your API key (or use the test key), upload an image, click Run, and you’ll see the raw JSON response.
test_123 to try quickly, or get a real key in Authentication.{}If you’re running the Firebase Hosting + Functions emulator locally, set Base URL to http://localhost:3000.
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 key415— Unsupported media or invalid image input422— Invalid request body (missingimage)429— Rate limited5xx— Server error
What’s next?
- Food Resolution
POST /v1/normalize— canonicalize nutrition inputs (coming soon)