NutriScan Nutrition API
Calorie API
Send a food with an amount, a meal in words, a photo of a plate or a photo of a pack label. One request returns calories, protein, carbs and fat for each food and for the whole meal.
The test key costs nothing. Credit packs start at $49, with no subscription.
curl https://platform-api.nutriscan.app/v1/scans \
-H "Authorization: Bearer $NUTRISCAN_KEY" \
-H "Content-Type: application/json" \
-d '{ "type": "text", "text": "150 g grilled chicken breast" }'One food with an amount. A test key returns a fixed sample result for any request, so use a live key to get numbers for your own food.
How do I get calories from text, a photo or a label?
Post to POST /v1/scans and set type to text, meal or label. The rest of the call and the response stay the same.
Text covers one food and a whole meal. Photos and labels have their own pages: the food recognition API and the nutrition label OCR API. The request fields are in create a scan.
One food, with an amount
{ "type": "text", "text": "150 g grilled chicken breast" }A whole meal, in German
{ "type": "text", "text": "Rührei aus 2 Eiern und eine Scheibe Vollkornbrot", "language": "de" }A photo of a plate
{ "type": "meal", "image_url": "https://example.com/schnitzel-plate.jpg", "language": "de" }A pack label, in French
{ "type": "label", "image_base64": "/9j/4AAQSkZJRgABAQ...", "language": "fr" }Which fields hold the calories and macros?
Calories are in calories, in kcal, and the macros are protein_g, carbs_g and fat_g, in grams. They appear in meal.totals for the whole meal and on every entry in items.
Each item also carries grams and a portion.display label such as "150 g", so the number always comes with the amount it is for. The meal total is the sum of its items.
meal.totals.caloriesmeal.totals.protein_g, carbs_g, fat_gitems[].caloriesitems[].protein_g, carbs_g, fat_gWhat does the response look like?
It is one JSON object. Read meal.totals for the meal and loop over items for each food.
The first block is the sample a test key returns, trimmed to the calorie and macro fields. The second block reads it in JavaScript. A scan can take up to 95 seconds, so the timeout is 100.
Test key result, trimmed
{
"id": "scn_Q2mX8rT4vK1pLw9eZb3nYh6A",
"status": "succeeded",
"meal": {
"name": "Grilled chicken with rice and salad",
"nutri_score": "B",
"totals": { "calories": 515, "protein_g": 51.9, "carbs_g": 47.7, "fat_g": 11.1, "…": "…" }
},
"items": [
{
"name": "Grilled chicken breast",
"portion": { "value": 150, "unit": "g", "display": "150 g" },
"grams": 150,
"calories": 248, "protein_g": 46.5, "carbs_g": 0, "fat_g": 5.4,
"source": "food_db"
}
],
"credits_used": 0,
"test_mode": true
}Reading it in JavaScript
const res = await fetch("https://platform-api.nutriscan.app/v1/scans", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.NUTRISCAN_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ type: "text", text: "2 eggs and a slice of toast" }),
signal: AbortSignal.timeout(100_000),
});
const scan = await res.json();
console.log(scan.meal.totals.calories); // whole meal, kcal
for (const item of scan.items) {
console.log(item.name, item.grams, item.calories, item.protein_g);
}What comes back with the calories?
Every successful scan returns 21 nutrients and a NutriScore grade along with the calories. You do not pay per field.
The full nutrient list is on the nutrition analysis API page, and an app diary built on these results is covered in the food logging API guide.
21 nutrients per food
Calories, 7 macro fields and 13 micronutrients, for each item and for the meal. Fiber, sugar, saturated fat and trans fat sit next to protein, carbs and fat.
A NutriScore grade
A grade from A to E with a one-sentence reason in the language you asked for, such as lean protein or sodium. Show it as it is.
Portions in grams
Each item has grams and a label ready to show, so your users can adjust a portion and you can rescale the numbers.
A source on every item
Each item says food_db, web or estimate. Ask the user to confirm the portion when an item is an estimate.
What does a calorie lookup cost?
A short text request uses about 60 credits, which is about $0.06, and a meal photo about 65 credits. Every scan uses at least 20.
One credit is $0.001, in every pack. A scan is priced from the work it took, so your real figure is in credits_used on each result. Test scans and scans that fail on our side cost 0. Credits never expire. See pricing for the packs, which start at $49.
What limits and errors should I plan for?
An account can make 60 scans a minute, and a scan can take up to 95 seconds. Four responses need handling in your code.
422no_food_detected: a photo with no food in it.It is charged for the work used, at least 20 credits. Ask for a new photo.402insufficient_credits: your balance is below 20 credits.Buy a pack, then retry.429More than 60 scans in a minute.Wait the 60 seconds in the Retry-After header.500scan_failed: the scan failed on our side.It costs 0 credits. Retry with the same Idempotency-Key.Where does this calorie API not fit?
It reads what you describe or photograph. It does not search a database or look anything up by code.
It fits when you need
Calories and macros for a food or a meal from text, a photo or a pack label
Each food with its own portion in grams, plus the meal total
Results in 12 languages, set on each request
It does not fit when you need
Food search or autocomplete. There is no search endpoint.
Barcode lookup, or a searchable food database to browse.
An instant answer. A scan can take up to 95 seconds.
Photos from anywhere but an upload or a public https link. HEIC is not supported yet.
Numbers for medical decisions. They are estimates for food logging.
Calorie API questions
Anything else, the API docs cover every field and error.
How do I get the calories for one food?
Send POST /v1/scans with type text and the food with an amount, such as "150 g grilled chicken breast". The result lists the food in items with its own calories, and the same number appears in meal.totals.calories.
Does the API return calories per 100 g?
No. Each item's nutrient fields describe the portion shown in portion and grams. If you want a figure per 100 g, divide the item's calories by grams and multiply by 100.
Can I send a photo instead of text?
Yes. Set type to meal and send a photo of the plate as a public https link or as base64 image data, or set type to label for the nutrition table on a pack. The response has the same fields as a text request.
Can I look a food up by name or barcode?
No. There is no search endpoint, no barcode lookup and no searchable food database. To get calories for one food, describe it as text with an amount.
Can I try it before I buy credits?
Yes. A new account gets test keys at no cost. A test key returns a fixed sample result, grilled chicken with rice and salad at 515 kcal, and uses no credits, so you can build your screens first.
How long does a request take?
A scan can take up to 95 seconds. Set your HTTP client timeout to at least 100 seconds, or use streaming to receive progress events while the scan runs.
Can calories and food names come back in German or French?
Yes. Set language on the request. The names and the NutriScore reason come back in one of 12 languages: English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Russian, Turkish, Hindi or Arabic.
Get calories into your app with one request
Sign in with your email, send your first request with the test key, and buy credits when you are ready to go live.
- Test key at sign-up
- Packs from $49
- No subscription
- Credits never expire

