Docs/APIs/Nutrition

Nutrition

Get Nutrition Facts for a Food by Name

OperationalCredits 1 per callp50 189msFoodStar

Overview

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.

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

GEThttps://api.apiverve.com/v1/nutrition
curl "https://api.apiverve.com/v1/nutrition?food=banana&grams=118" \
  -H "x-api-key: your_api_key_here"
const res = await fetch('https://api.apiverve.com/v1/nutrition?food=banana&grams=118', {
  headers: { 'x-api-key': 'your_api_key_here' },
});

if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);

const { data } = await res.json();
console.log(data);
import requests

res = requests.get(
    "https://api.apiverve.com/v1/nutrition?food=banana&grams=118",
    headers={"x-api-key": "your_api_key_here"},
    timeout=15,
)
res.raise_for_status()

print(res.json()["data"])
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.apiverve.com/v1/nutrition?food=banana&grams=118", nil)
	req.Header.Set("x-api-key", "your_api_key_here")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

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.

Parameters

Sent in the query string. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
foodRequiredstringName of the food to look up (e.g. banana, chicken breast, olive oil)
length 1–100
gramsOptionalPremiumnumberServing weight in grams to scale the nutrition panel to. Defaults to a per-100-gram basis.
range 1–10000

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "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.

FieldTypeExampleDescription
foodstring"Bananas, raw"Matched food name from the USDA database
fdcIdnumber173944USDA FoodData Central unique identifier for the food
categorystring"Fruits and Fruit Juices"USDA food category the item belongs to
basisstring"per 100g"Basis the nutrition values are reported on (per 100g, or the requested serving)
servingSizesarray[3]Common household serving sizes reported for the food
labelstring"1 NLEA serving"Description of the serving size (e.g. 1 cup, sliced)
gramsnumber126Weight of the serving in grams
nutritionobject{...}Headline calories and macronutrients
caloriesnumber89Energy in kilocalories
proteinnumber1.09Protein in grams
totalFatnumber0.33Total fat in grams
carbohydratesnumber22.8Total carbohydrates in grams
fibernumber2.6Dietary fiber in grams
sugarsnumber12.2Total sugars in grams
micronutrientsobject{...}Full micronutrient panel
sodiumPremiumnumber1Sodium in milligrams
potassiumPremiumnumber358Potassium in milligrams
cholesterolPremiumnumber0Cholesterol in milligrams
saturatedFatPremiumnumber0.112Saturated fat in grams
transFatPremiumnumber0Trans fat in grams
monounsaturatedFatPremiumnumber0.032Monounsaturated fat in grams
polyunsaturatedFatPremiumnumber0.073Polyunsaturated fat in grams
calciumPremiumnumber5Calcium in milligrams
ironPremiumnumber0.26Iron in milligrams
magnesiumPremiumnumber27Magnesium in milligrams
phosphorusPremiumnumber22Phosphorus in milligrams
zincPremiumnumber0.15Zinc in milligrams
vitaminCPremiumnumber8.7Vitamin C in milligrams
vitaminAPremiumnumber3Vitamin A in micrograms
vitaminDPremiumnumber0Vitamin D in micrograms
vitaminEPremiumnumber0.1Vitamin E in milligrams
vitaminKPremiumnumber0.5Vitamin K in micrograms
thiaminPremiumnumber0.031Thiamin (B1) in milligrams
riboflavinPremiumnumber0.073Riboflavin (B2) in milligrams
niacinPremiumnumber0.665Niacin (B3) in milligrams
vitaminB6Premiumnumber0.367Vitamin B6 in milligrams
folatePremiumnumber20Folate in micrograms
vitaminB12Premiumnumber0Vitamin B12 in micrograms
waterPremiumnumber74.9Water content in grams
analyticsobject{...}Derived nutrition intelligence
caloriesPerGramPremiumnumber0.89Energy density in calories per gram
proteinCaloriePercentPremiumnumber4.4Share of calories from protein (percent)
fatCaloriePercentPremiumnumber3Share of calories from fat (percent)
carbCaloriePercentPremiumnumber92.6Share of calories from carbohydrate (percent)
proteinPer100CaloriesPremiumnumber1.22Grams of protein per 100 calories
dailyValuesobject{...}Percent of the FDA Daily Value each nutrient supplies on the reported basis
proteinPremiumnumber2.2Protein as a percent of the Daily Value
totalFatPremiumnumber0.4Total fat as a percent of the Daily Value
saturatedFatPremiumnumber0.6Saturated fat as a percent of the Daily Value
cholesterolPremiumnumber0Cholesterol as a percent of the Daily Value
sodiumPremiumnumber0Sodium as a percent of the Daily Value
carbohydratesPremiumnumber8.3Total carbohydrates as a percent of the Daily Value
fiberPremiumnumber9.3Dietary fiber as a percent of the Daily Value
potassiumPremiumnumber7.6Potassium as a percent of the Daily Value
calciumPremiumnumber0.4Calcium as a percent of the Daily Value
ironPremiumnumber1.4Iron as a percent of the Daily Value
magnesiumPremiumnumber6.4Magnesium as a percent of the Daily Value
phosphorusPremiumnumber1.8Phosphorus as a percent of the Daily Value
zincPremiumnumber1.4Zinc as a percent of the Daily Value
vitaminCPremiumnumber9.7Vitamin C as a percent of the Daily Value
vitaminAPremiumnumber0.3Vitamin A as a percent of the Daily Value
vitaminDPremiumnumber0Vitamin D as a percent of the Daily Value
vitaminEPremiumnumber0.7Vitamin E as a percent of the Daily Value
vitaminKPremiumnumber0.4Vitamin K as a percent of the Daily Value
thiaminPremiumnumber2.6Thiamin (B1) as a percent of the Daily Value
riboflavinPremiumnumber5.6Riboflavin (B2) as a percent of the Daily Value
niacinPremiumnumber4.2Niacin (B3) as a percent of the Daily Value
vitaminB6Premiumnumber21.6Vitamin B6 as a percent of the Daily Value
folatePremiumnumber5Folate as a percent of the Daily Value
vitaminB12Premiumnumber0Vitamin B12 as a percent of the Daily Value
dietaryFlagsobject{...}Plain-language dietary attributes derived from FDA nutrient-content-claim thresholds
highProteinPremiumbooleanfalseTrue when protein is at least 20% of the Daily Value per 100g
goodSourceOfProteinPremiumbooleanfalseTrue when protein is 10-19% of the Daily Value per 100g
highFiberPremiumbooleanfalseTrue when fiber is at least 20% of the Daily Value per 100g
goodSourceOfFiberPremiumbooleanfalseTrue when fiber is 10-19% of the Daily Value per 100g
lowSodiumPremiumbooleantrueTrue when sodium is 140mg or less per 100g
lowFatPremiumbooleantrueTrue when total fat is 3g or less per 100g
lowSaturatedFatPremiumbooleantrueTrue when saturated fat is 1g or less per 100g
lowCholesterolPremiumbooleantrueTrue when cholesterol is 20mg or less per 100g
lowCaloriePremiumbooleanfalseTrue when energy is 40 kcal or less per 100g

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Other ways to use Nutrition

Set up Nutrition on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKitReference →
Use it in Google Sheets or ExcelA =VERVE() formula fills a column — no script, no export, recalculates in place.VerveSheetsReference →
Ground an agent on itA cited, machine-checkable fact your model can't produce on its own.VerveContextReference →

More in Food:

Was this page helpful?