NutriScan Nutrition API
Food Database API
Search foods by name and read the nutrition data for each one: calories, macros and 13 micronutrients, per serving and per 100 g. Every food has an id you can store and fetch again.
The test key costs nothing. Credit packs start at $49, with no subscription.
curl "https://platform-api.nutriscan.app/v1/foods/search?q=apple&limit=5" \
-H "Authorization: Bearer $NUTRISCAN_KEY"A search by name. A test key knows three sample foods and returns the ones whose name matches, so use apple. Test calls use no credits.
What does one food record hold?
An id, a name, a serving label with its weight in grams, the nutrients per serving and per 100 g, and a list of portions with a unit and grams.
Every food has the same shape, so one parser reads them all. The record on the right is the Apple a test key returns, with the per 100 g panel shortened. Every field is described in the food search reference.
Test key record for apple, trimmed
{
"id": "fd_test_apple",
"name": "Apple",
"serving": { "label": "1 medium (182 g)", "grams": 182.0 },
"per_serving": {
"calories": 94.64,
"protein_g": 0.55,
"carbs_g": 25.12,
"fat_g": 0.36,
"fiber_g": 4.37,
"sugar_g": 18.93,
"saturated_fat_g": 0.0,
"trans_fat_g": null,
"micros": {
"sodium_mg": 1.82,
"potassium_mg": 194.74,
"calcium_mg": 10.92,
"iron_mg": 0.18,
"magnesium_mg": null,
"zinc_mg": null,
"vitamin_c_mg": 8.37,
"vitamin_e_mg": null,
"vitamin_a_mcg": null,
"vitamin_d_mcg": null,
"vitamin_k_mcg": null,
"vitamin_b12_mcg": null,
"omega_3_mg": null
}
},
"per_100g": { "calories": 52.0, "protein_g": 0.3, "carbs_g": 13.8, "fat_g": 0.2, "…": "…" },
"portions": [
{ "unit": "small", "grams": 149.0 },
{ "unit": "medium", "grams": 182.0 }
]
}Which 21 nutrients does each food carry?
Calories, 7 macro fields and 13 micronutrients. The same 21 fields appear in per_serving and in per_100g.
To show another amount, multiply per_100g by grams divided by 100. For one of the portions, use its grams.
calories1protein_g, carbs_g, fat_g, fiber_g, sugar_g, saturated_fat_g, trans_fat_g7microssodium_mg, potassium_mg, calcium_mg, iron_mg, magnesium_mg, zinc_mg, vitamin_c_mg, vitamin_e_mg, vitamin_a_mcg, vitamin_d_mcg, vitamin_k_mcg, vitamin_b12_mcg, omega_3_mg13What does null mean in a nutrient field?
The nutrient is unknown for that food. It is null, never 0.
The Apple record shows both cases. Its saturated_fat_g is 0.0, a known zero. Its magnesium_mg is null, so the value is not known.
Show it as unknown
Print a placeholder such as n/a or "no data" in the nutrient row. A blank or a 0 tells your user something the data does not say.
Keep it out of sums
When you add up a day, skip the nulls instead of adding them as zero. Tell the user that the total covers only the nutrients you know.
Check for null before you scale
Multiplying null by a portion gives an error or a 0 in most languages. Test the value first, then scale only the numbers you have.
Can I store food ids and fetch the food later?
Yes. A food keeps its id, so store the whole string, which starts with fd_ or cr_, and call GET /v1/foods/{id} for 1 credit.
Save ids in your own tables, for example in a user's saved foods or a recipe. Treat an id as an opaque string. An id we do not know, or one that has been retired, returns 404 not_found. Handle that by searching again by name.
Fetch one food by its id
curl https://platform-api.nutriscan.app/v1/foods/fd_test_apple \
-H "Authorization: Bearer $NUTRISCAN_KEY"Handle an id that is gone
const API = "https://platform-api.nutriscan.app/v1";
const headers = { Authorization: `Bearer ${process.env.NUTRISCAN_KEY}` };
const res = await fetch(`${API}/foods/fd_test_apple`, { headers });
if (res.status === 404) {
// search again by the saved name, then store the new id
} else {
const food = await res.json();
console.log(food.name, food.per_serving.calories);
}How do regional values work?
Add country to the search. Send a two-letter code such as US, DE or FR, or a country name such as Germany. Without it you get global values.
The response repeats the code we read in country. It is null when you sent none or sent a value we cannot read. country is optional, so a search by name works without it.
A two-letter code
curl "https://platform-api.nutriscan.app/v1/foods/search?q=apple&country=DE" \
-H "Authorization: Bearer $NUTRISCAN_KEY"A country name
curl "https://platform-api.nutriscan.app/v1/foods/search?q=apple&country=France" \
-H "Authorization: Bearer $NUTRISCAN_KEY"How do I get data from this nutrition database API?
With two calls: search by name, then fetch by id. There is no bulk download and no file export. You query the API as your users need foods.
For a search box with a type-then-pick flow, see the food search API guide. A key needs the search scope. Keys made on or after December 1, 2026 have it unless you untick it in the console. Older keys get 403 scope_missing and need a new key.
GET /v1/foods/searchFind foods by name. Up to 20 per call, best match first.3GET /v1/foods/{id}Fetch one food you found before.1Example, worked from our public pricing
What does a food database lookup cost?
A search costs 3 credits, or $0.003. A lookup by id costs 1 credit, or $0.001. For 10,000 searches and 15,000 lookups in a month that is 45,000 credits, or $45.
10,000searches a month
3credits a search
30,000credits
Add 15,000 lookups by id at 1 credit each and the month comes to 45,000 credits. One credit is $0.001 in every pack. A search that returns an empty list still costs 3 credits. Errors cost 0, and so do test keys.
Starter is $49 for 49,000 credits, Growth is $199 for 199,000 and Scale is $599 for 599,000. One Starter pack covers the month above. Credits never expire.
Pack pricesCan I try the food database before I buy credits?
Yes. Sign in with your email and you get a free test key. It knows three sample foods and uses no credits.
Three sample foods
Apple, Masala Dosa and Paneer Tikka. A lookup works for the three sample ids only, such as fd_test_apple.
Search by name works
A search returns the samples whose name matches your text. q=apple returns Apple, and q=pizza returns an empty list.
No balance needed
Test calls cost 0 credits and run with a zero balance, so your team can build the screens first.
What if a food is not in a table?
Send it as a scan. A meal photo, a photo of a pack label or a sentence returns the same 21 nutrients, plus a NutriScore grade.
The grade comes on scans only, not on food records. A scan costs at least 20 credits and about 65 for a typical plate, so use it when no named food fits. A scan uses POST /v1/scans with the same key.
What limits and errors should I plan for?
An account can make 60 calls a minute, and a daily limit applies too. Six responses need handling in your code, and none of them uses credits.
429rate_limited: more than 60 calls in a minute.Wait the seconds in the Retry-After header.429daily_limit: the daily limit of the account is reached.Wait for 00:00 UTC, when it resets. Retry-After counts the seconds.402insufficient_credits: fewer than 3 credits for a search or 1 for a lookup.Buy a pack, then retry.403scope_missing: the key has no search scope.Create a new key in the console.404not_found: no food has that id.Search again by name.503search_unavailable: search is down for a moment.Retry after a few seconds.What is this food database API not?
It answers a name with a food and its nutrients. You cannot copy the data out as a dataset, and nothing is looked up by code.
It fits when you need
Nutrition data for a food the user names, such as an apple, Greek yogurt or a pretzel
The same 21 nutrients per serving and per 100 g, with portions in grams
Stable ids you can store and fetch again for 1 credit
It does not fit when you need
Barcode lookup. There is no barcode endpoint.
A downloadable dataset or a file export. You query one search or one id at a time.
A NutriScore grade on a food record. Only scans return one.
Food database API questions
Anything else, the food search reference covers every field and error.
Can I download the whole food database?
No. There is no bulk download and no file export. You query the API for the foods your users need: search by name for 3 credits, or fetch a saved id for 1 credit.
How many foods are in the database?
We do not publish a count. To see how well it fits your product, run your own list of foods through GET /v1/foods/search with a live key. A test key only knows three sample foods. A search costs 3 credits, so 300 searches cost 900 credits, which is $0.90.
Can I look a food up by barcode?
No. There is no barcode lookup. Search by name, or send a photo of the pack label as a scan and read the nutrition table on it.
Can I store food ids in my own database?
Yes. Ids are stable, so you can store them in your own tables, for example in a user's saved foods. Keep the whole string, which starts with fd_ or cr_, and fetch the food again with GET /v1/foods/{id} for 1 credit. If an id returns 404 not_found, search again by name.
How do I get values for one country?
Add country to the search. Send a two-letter code such as US, DE or FR, or a country name such as Germany. Without country, or with a value we cannot read, you get global values and country comes back null.
What does null mean in a nutrient field?
The nutrient is unknown for that food. It is never 0. Show it as unknown, and do not add it to a daily total as zero.
Does a food record include a NutriScore grade?
No. Food records have no NutriScore grade and no confidence value. A scan of a meal photo, a pack label or a sentence returns a NutriScore grade along with the same 21 nutrients.
What does a food lookup cost?
A search costs 3 credits, which is $0.003, and a lookup by id costs 1 credit, which is $0.001. Errors and test keys cost 0. Packs start at $49 for 49,000 credits, and credits never expire.
Look up your first food with a test key
Sign in with your email, search for apple 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