Nutrition returns the nutrition facts for a generic whole food by name - calories and the core macronutrients per 100 grams straight from the USDA food composition database - plus a full micronutrient panel and derived nutrition intelligence like calories per gram and the protein, fat and carbohydrate share of calories.
Try it — live request, no key required
No key required to try it. Get a key to use it in your app.
{
"status": "ok",
"error": null,
"data": {
// Nutrition response payload
}
}
About the Nutrition API
Nutrition works by matching your search term to the best generic food in the USDA FoodData Central SR Legacy database and returning its per-100-gram nutrition panel, layered with derived intelligence the raw USDA data does not carry - calories per gram, the percentage of calories from protein, fat and carbohydrate, and protein per 100 calories. Paid plans unlock the full micronutrient panel (sodium, potassium, cholesterol, the individual fats, minerals and vitamins), the percent Daily Value each nutrient supplies the way a Nutrition Facts label reads, plain-language dietary flags like high protein and low sodium, and can scale the whole panel to any serving weight in grams. Data comes from the public-domain USDA food composition dataset.
Ways to call it
One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.
- JSON
- Default REST response
- XML
- Markup format
- YAML
- Human-readable
- CSV
- Tabular export
- GraphQL
- Query language
- MCP
- For AI agents
Other ways to use Nutrition
Same data, same APIVerve account, same credit balance — one key works on all of them.
What does the Nutrition API do?
How do I authenticate Nutrition API requests?
How much does the Nutrition API cost?
How fast is the Nutrition API?
What response formats does the Nutrition API support?
What HTTP method does the Nutrition API use?
Request parameters — GET /v1/nutrition
Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them. Anything not listed here is dropped rather than passed through.
Required
| Parameter | Type | Example | Description |
|---|---|---|---|
foodRequired | string | banana | Name of the food to look up (e.g. banana, chicken breast, olive oil) length 1-100 |
Optional
| Parameter | Type | Example | Description |
|---|---|---|---|
gramsOptionalPremium | number | 118 | Serving weight in grams to scale the nutrition panel to. Defaults to a per-100-gram basis. range 1-10000 |
curl "https://api.apiverve.com/v1/nutrition?food=banana&grams=118" \
-H "x-api-key: YOUR_API_KEY"Authentication
Send your key in the x-api-key header. That is the only auth step — no token exchange, and no per-endpoint scope to configure.
| Header | When | Value |
|---|---|---|
x-api-keyRequired | Every request | Your API key. Header names are case-insensitive, so X-API-Key is the same header. |
AuthorizationAlternate | Instead of the above | Bearer <key> — for clients that only expose bearer auth. Resolves to the same account and the same billing. |
A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.
Response — GET /v1/nutrition
Every APIVerve endpoint returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape.
{
"status": "ok",
"error": null,
"data": {
"food": "Bananas, raw",
"fdcId": 173944,
"category": "Fruits and Fruit Juices",
"basis": "per 100g",
"servingSizes": [
{
"label": "1 NLEA serving",
"grams": 126
},
{
"label": "1 extra large (9\" or longer)",
"grams": 152
},
{
"label": "1 large (8\" to 8-7/8\" long)",
"grams": 136
}
],
"nutrition": {
"calories": 89,
"protein": 1.09,
"totalFat": 0.33,
"carbohydrates": 22.8,
"fiber": 2.6,
"sugars": 12.2
},
"micronutrients": {
"sodium": 1,
"potassium": 358,
"cholesterol": 0,
"saturatedFat": 0.112,
"transFat": 0,
"monounsaturatedFat": 0.032,
"polyunsaturatedFat": 0.073,
"calcium": 5,
"iron": 0.26,
"magnesium": 27,
"phosphorus": 22,
"zinc": 0.15,
"vitaminC": 8.7,
"vitaminA": 3,
"vitaminD": 0,
"vitaminE": 0.1,
"vitaminK": 0.5,
"thiamin": 0.031,
"riboflavin": 0.073,
"niacin": 0.665,
"vitaminB6": 0.367,
"folate": 20,
"vitaminB12": 0,
"water": 74.9
},
"analytics": {
"caloriesPerGram": 0.89,
"proteinCaloriePercent": 4.4,
"fatCaloriePercent": 3,
"carbCaloriePercent": 92.6,
"proteinPer100Calories": 1.22
},
"dailyValues": {
"protein": 2.2,
"totalFat": 0.4,
"saturatedFat": 0.6,
"cholesterol": 0,
"sodium": 0,
"carbohydrates": 8.3,
"fiber": 9.3,
"potassium": 7.6,
"calcium": 0.4,
"iron": 1.4,
"magnesium": 6.4,
"phosphorus": 1.8,
"zinc": 1.4,
"vitaminC": 9.7,
"vitaminA": 0.3,
"vitaminD": 0,
"vitaminE": 0.7,
"vitaminK": 0.4,
"thiamin": 2.6,
"riboflavin": 5.6,
"niacin": 4.2,
"vitaminB6": 21.6,
"folate": 5,
"vitaminB12": 0
},
"dietaryFlags": {
"highProtein": false,
"goodSourceOfProtein": false,
"highFiber": false,
"goodSourceOfFiber": false,
"lowSodium": true,
"lowFat": true,
"lowSaturatedFat": true,
"lowCholesterol": true,
"lowCalorie": false
}
}
}
Response fields
Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.
| Field | Type | Example | Description |
|---|---|---|---|
food | string | "Bananas, raw" | Matched food name from the USDA database |
fdcId | number | 173944 | USDA FoodData Central unique identifier for the food |
category | string | "Fruits and Fruit Juices" | USDA food category the item belongs to |
basis | string | "per 100g" | Basis the nutrition values are reported on (per 100g, or the requested serving) |
servingSizes | array[3] | Common household serving sizes reported for the food | |
label | string | "1 NLEA serving" | Description of the serving size (e.g. 1 cup, sliced) |
grams | number | 126 | Weight of the serving in grams |
nutrition | object | {...} | Headline calories and macronutrients |
calories | number | 89 | Energy in kilocalories |
protein | number | 1.09 | Protein in grams |
totalFat | number | 0.33 | Total fat in grams |
carbohydrates | number | 22.8 | Total carbohydrates in grams |
fiber | number | 2.6 | Dietary fiber in grams |
sugars | number | 12.2 | Total sugars in grams |
micronutrients | object | {...} | Full micronutrient panel |
sodiumPremium | number | 1 | Sodium in milligrams |
potassiumPremium | number | 358 | Potassium in milligrams |
cholesterolPremium | number | 0 | Cholesterol in milligrams |
saturatedFatPremium | number | 0.112 | Saturated fat in grams |
transFatPremium | number | 0 | Trans fat in grams |
monounsaturatedFatPremium | number | 0.032 | Monounsaturated fat in grams |
polyunsaturatedFatPremium | number | 0.073 | Polyunsaturated fat in grams |
calciumPremium | number | 5 | Calcium in milligrams |
ironPremium | number | 0.26 | Iron in milligrams |
magnesiumPremium | number | 27 | Magnesium in milligrams |
phosphorusPremium | number | 22 | Phosphorus in milligrams |
zincPremium | number | 0.15 | Zinc in milligrams |
vitaminCPremium | number | 8.7 | Vitamin C in milligrams |
vitaminAPremium | number | 3 | Vitamin A in micrograms |
vitaminDPremium | number | 0 | Vitamin D in micrograms |
vitaminEPremium | number | 0.1 | Vitamin E in milligrams |
vitaminKPremium | number | 0.5 | Vitamin K in micrograms |
thiaminPremium | number | 0.031 | Thiamin (B1) in milligrams |
riboflavinPremium | number | 0.073 | Riboflavin (B2) in milligrams |
niacinPremium | number | 0.665 | Niacin (B3) in milligrams |
vitaminB6Premium | number | 0.367 | Vitamin B6 in milligrams |
folatePremium | number | 20 | Folate in micrograms |
vitaminB12Premium | number | 0 | Vitamin B12 in micrograms |
waterPremium | number | 74.9 | Water content in grams |
analytics | object | {...} | Derived nutrition intelligence |
caloriesPerGramPremium | number | 0.89 | Energy density in calories per gram |
proteinCaloriePercentPremium | number | 4.4 | Share of calories from protein (percent) |
fatCaloriePercentPremium | number | 3 | Share of calories from fat (percent) |
carbCaloriePercentPremium | number | 92.6 | Share of calories from carbohydrate (percent) |
proteinPer100CaloriesPremium | number | 1.22 | Grams of protein per 100 calories |
dailyValues | object | {...} | Percent of the FDA Daily Value each nutrient supplies on the reported basis |
proteinPremium | number | 2.2 | Protein as a percent of the Daily Value |
totalFatPremium | number | 0.4 | Total fat as a percent of the Daily Value |
saturatedFatPremium | number | 0.6 | Saturated fat as a percent of the Daily Value |
cholesterolPremium | number | 0 | Cholesterol as a percent of the Daily Value |
sodiumPremium | number | 0 | Sodium as a percent of the Daily Value |
carbohydratesPremium | number | 8.3 | Total carbohydrates as a percent of the Daily Value |
fiberPremium | number | 9.3 | Dietary fiber as a percent of the Daily Value |
potassiumPremium | number | 7.6 | Potassium as a percent of the Daily Value |
calciumPremium | number | 0.4 | Calcium as a percent of the Daily Value |
ironPremium | number | 1.4 | Iron as a percent of the Daily Value |
magnesiumPremium | number | 6.4 | Magnesium as a percent of the Daily Value |
phosphorusPremium | number | 1.8 | Phosphorus as a percent of the Daily Value |
zincPremium | number | 1.4 | Zinc as a percent of the Daily Value |
vitaminCPremium | number | 9.7 | Vitamin C as a percent of the Daily Value |
vitaminAPremium | number | 0.3 | Vitamin A as a percent of the Daily Value |
vitaminDPremium | number | 0 | Vitamin D as a percent of the Daily Value |
vitaminEPremium | number | 0.7 | Vitamin E as a percent of the Daily Value |
vitaminKPremium | number | 0.4 | Vitamin K as a percent of the Daily Value |
thiaminPremium | number | 2.6 | Thiamin (B1) as a percent of the Daily Value |
riboflavinPremium | number | 5.6 | Riboflavin (B2) as a percent of the Daily Value |
niacinPremium | number | 4.2 | Niacin (B3) as a percent of the Daily Value |
vitaminB6Premium | number | 21.6 | Vitamin B6 as a percent of the Daily Value |
folatePremium | number | 5 | Folate as a percent of the Daily Value |
vitaminB12Premium | number | 0 | Vitamin B12 as a percent of the Daily Value |
dietaryFlags | object | {...} | Plain-language dietary attributes derived from FDA nutrient-content-claim thresholds |
highProteinPremium | boolean | false | True when protein is at least 20% of the Daily Value per 100g |
goodSourceOfProteinPremium | boolean | false | True when protein is 10-19% of the Daily Value per 100g |
highFiberPremium | boolean | false | True when fiber is at least 20% of the Daily Value per 100g |
goodSourceOfFiberPremium | boolean | false | True when fiber is 10-19% of the Daily Value per 100g |
lowSodiumPremium | boolean | true | True when sodium is 140mg or less per 100g |
lowFatPremium | boolean | true | True when total fat is 3g or less per 100g |
lowSaturatedFatPremium | boolean | true | True when saturated fat is 1g or less per 100g |
lowCholesterolPremium | boolean | true | True when cholesterol is 20mg or less per 100g |
lowCaloriePremium | boolean | false | True when energy is 40 kcal or less per 100g |
Response headers
Every response carries your balance, so your own code always knows where it stands without polling anything. All four are exposed to browsers through CORS.
| Header | What it carries |
|---|---|
x-api-remaining-credits | Credits left in the current cycle |
x-api-credits-used | Credits spent in the current cycle |
x-api-max-credits | The allowance for the cycle |
x-api-version | Version of the endpoint that answered |
Errors
Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change.
| Status | Meaning | What to do |
|---|---|---|
400 | Input was rejected | Read error; it names the parameter that has to change. |
401 | Key missing or invalid | Check the header name and the key value. |
403 | Key valid, but not permitted here | A key restriction or an IP allow-list — never a bad key. |
429 | Rate limited, or out of credits | Read error to tell them apart, then back off or top up. |
What a call costs — 2 credits per call
Credits are shared across every APIVerve API — one balance, one key, one bill. Failed requests never count against it, so a rejected input costs nothing.
| Plan | Per month | Credits | Nutrition calls | Per 1,000 calls |
|---|---|---|---|---|
| Free | Free | 200 | 100 | Free |
| Starter | $29.99 | 200,000 | 100,000 | $0.30 |
| Pro | $99.99 | 1,000,000 | 500,000 | $0.20 |
| Mega | $299.99 | 4,000,000 | 2,000,000 | $0.15 |
Calls are what the credits buy at this API's rate — spend them here, on any of the other APIs, or across both. Nothing is reserved per endpoint.
Call it from cURL — GET /v1/nutrition
No SDK to install — this is a plain HTTPS call to /v1/nutrition with your key in the x-api-key header. Swap in a real key and it runs as-is.
curl "https://api.apiverve.com/v1/nutrition" \
-H "x-api-key: YOUR_API_KEY"Resources
Call it from Node.js — GET /v1/nutrition
No SDK to install — this is a plain HTTPS call to /v1/nutrition with your key in the x-api-key header. Swap in a real key and it runs as-is.
const res = await fetch("https://api.apiverve.com/v1/nutrition", {
headers: { "x-api-key": "YOUR_API_KEY" },
});
const { data } = await res.json();
console.log(data);Resources
Call it from Python — GET /v1/nutrition
No SDK to install — this is a plain HTTPS call to /v1/nutrition with your key in the x-api-key header. Swap in a real key and it runs as-is.
import requests
res = requests.get(
"https://api.apiverve.com/v1/nutrition",
headers={"x-api-key": "YOUR_API_KEY"},
)
print(res.json()["data"])Resources
Call it from C# / .NET — GET /v1/nutrition
No SDK to install — this is a plain HTTPS call to /v1/nutrition with your key in the x-api-key header. Swap in a real key and it runs as-is.
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
var json = await client.GetStringAsync("https://api.apiverve.com/v1/nutrition");
Console.WriteLine(json);Resources
Call it from Go — GET /v1/nutrition
No SDK to install — this is a plain HTTPS call to /v1/nutrition with your key in the x-api-key header. Swap in a real key and it runs as-is.
req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/nutrition", nil)
req.Header.Set("x-api-key", "YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))Resources
Call it from PHP — GET /v1/nutrition
No SDK to install — this is a plain HTTPS call to /v1/nutrition with your key in the x-api-key header. Swap in a real key and it runs as-is.
$ch = curl_init("https://api.apiverve.com/v1/nutrition");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-api-key: YOUR_API_KEY"]);
$response = curl_exec($ch);
echo $response;Resources
Call it from Ruby — GET /v1/nutrition
No SDK to install — this is a plain HTTPS call to /v1/nutrition with your key in the x-api-key header. Swap in a real key and it runs as-is.
require "net/http"
uri = URI("https://api.apiverve.com/v1/nutrition")
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = "YOUR_API_KEY"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts res.bodyResources
Zero-code embed — one snippet, no backend
Drop an interactive Nutrition form onto any page. The widget calls the API for you, so no key ever appears in your markup and there is nothing to deploy.
Changelog — Nutrition API
Every change to this endpoint, newest first. Breaking changes ship as a new version and the previous one keeps serving — response fields are added, never removed or retyped in place, so an integration written against v1 keeps working.
Entries are picked up from dated catalog snapshots, so the first one appears after the next snapshot that moves something. A period where nothing changed produces no entry — silence is a valid changelog for the Nutrition API.
Food
- Cocktail Recipe
- Nutrition
- Recipe Generator
Related articles
All articles →
Extract Clean Content from Any WebpageTurn messy web pages into clean Markdown. Perfect for content migration, archiving, AI training data, and building read-later tools.Read
Take Your App Multilingual (No Rewrite)Add language support to an existing app without rearchitecting. Practical strategies for translation, detection, and localization.Read
Business Day Math Is Harder Than You ThinkWeekends, holidays, and country-specific rules make working day calculations surprisingly tricky. Here's what to watch for.Read