USDA API: Get nutrition facts
Looks up a food in USDA FoodData Central and returns its nutrients per 100 g and for a chosen amount (grams, ounces, or a listed household portion).
Unofficial. Not affiliated with or endorsed by USDA.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Food, required
food Food in plain words, for example banana or cooked brown rice.
cooked brown rice
- Amount optional
amount Amount to calculate, for example 1 cup, 150 g, or 2 large. Defaults to 100 g.
1 cup
Default
100 g.
Input as JSON
{ "food": "cooked brown rice", "amount": "1 cup"}Output
{ "fdc_id": 169704, "page_link": "https://fdc.nal.usda.gov/food-details/169704/nutrients" , "per_100_g": { "fiber_g": 1.6, "iron_mg": 0.56, "sugars_g": 0.24, "protein_g": 2.74, "sodium_mg": 4, "calcium_mg": 3, "total_fat_g": 0.97, "potassium_mg": 86, "vitamin_c_mg": 0, "vitamin_d_ug": 0, "calories_kcal": 123, "cholesterol_mg": 0, "carbohydrates_g": 25.6, "saturated_fat_g": 0.26 }, "per_amount": { "fiber_g": 3.232, "iron_mg": 1.1312, "sugars_g": 0.4848, "protein_g": 5.5348, "sodium_mg": 8.08, "calcium_mg": 6.06, "total_fat_g": 1.9594, "potassium_mg": 173.72, "vitamin_c_mg": 0, "vitamin_d_ug": 0, "calories_kcal": 248.46, "cholesterol_mg": 0, "carbohydrates_g": 51.712, "saturated_fat_g": 0.5252 }, "amount_used": "1 cup", "amount_weight_g": 202, "data_source_type": "SR Legacy", "matched_food_name": "Rice, brown, long-grain, cooked (Includes foods for USDA's Food Distribution Program)"}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"fdc.nal.usda.gov/get_nutrition_facts","input":{"food":"cooked brown rice","amount":"1 cup"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "fdc.nal.usda.gov/get_nutrition_facts" , "input": { "food": "cooked brown rice", "amount": "1 cup" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "fdc.nal.usda.gov/get_nutrition_facts" , "input": { "food": "cooked brown rice", "amount": "1 cup" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run fdc.nal.usda.gov/get_nutrition_facts# with {"food":"cooked brown rice","amount":"1 cup"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "food" ], "properties": { "food": { "type": "string", "minLength": 1, "description": "Food in plain words, for example banana or cooked brown rice." }, "amount": { "type": "string", "default": "100 g", "description": "Amount to calculate, for example 1 cup, 150 g, or 2 large. Defaults to 100 g." } }}Output schema
{ "type": "object", "required": [ "matched_food_name", "amount_used", "amount_weight_g", "per_100_g", "per_amount", "page_link", "fdc_id", "data_source_type" ], "properties": { "fdc_id": { "type": "integer", "x-fous-developer": true }, "page_link": { "type": "string" }, "per_100_g": { "type": "object", "required": [ "calories_kcal", "protein_g", "carbohydrates_g", "sugars_g", "fiber_g", "total_fat_g", "saturated_fat_g", "cholesterol_mg", "sodium_mg", "potassium_mg", "calcium_mg", "iron_mg", "vitamin_c_mg", "vitamin_d_ug" ], "properties": { "fiber_g": { "type": [ "number", "null" ], "description": "Fiber in grams" }, "iron_mg": { "type": [ "number", "null" ], "description": "Iron in milligrams" }, "sugars_g": { "type": [ "number", "null" ], "description": "Sugars in grams" }, "protein_g": { "type": [ "number", "null" ], "description": "Protein in grams" }, "sodium_mg": { "type": [ "number", "null" ], "description": "Sodium in milligrams" }, "calcium_mg": { "type": [ "number", "null" ], "description": "Calcium in milligrams" }, "total_fat_g": { "type": [ "number", "null" ], "description": "Total fat in grams" }, "potassium_mg": { "type": [ "number", "null" ], "description": "Potassium in milligrams" }, "vitamin_c_mg": { "type": [ "number", "null" ], "description": "Vitamin C in milligrams" }, "vitamin_d_ug": { "type": [ "number", "null" ], "description": "Vitamin D in micrograms" }, "calories_kcal": { "type": [ "number", "null" ], "description": "Calories in kilocalories" }, "cholesterol_mg": { "type": [ "number", "null" ], "description": "Cholesterol in milligrams" }, "carbohydrates_g": { "type": [ "number", "null" ], "description": "Carbohydrates in grams" }, "saturated_fat_g": { "type": [ "number", "null" ], "description": "Saturated fat in grams" } }, "additionalProperties": false }, "per_amount": { "type": "object", "required": [ "calories_kcal", "protein_g", "carbohydrates_g", "sugars_g", "fiber_g", "total_fat_g", "saturated_fat_g", "cholesterol_mg", "sodium_mg", "potassium_mg", "calcium_mg", "iron_mg", "vitamin_c_mg", "vitamin_d_ug" ], "properties": { "fiber_g": { "type": [ "number", "null" ], "description": "Fiber in grams" }, "iron_mg": { "type": [ "number", "null" ], "description": "Iron in milligrams" }, "sugars_g": { "type": [ "number", "null" ], "description": "Sugars in grams" }, "protein_g": { "type": [ "number", "null" ], "description": "Protein in grams" }, "sodium_mg": { "type": [ "number", "null" ], "description": "Sodium in milligrams" }, "calcium_mg": { "type": [ "number", "null" ], "description": "Calcium in milligrams" }, "total_fat_g": { "type": [ "number", "null" ], "description": "Total fat in grams" }, "potassium_mg": { "type": [ "number", "null" ], "description": "Potassium in milligrams" }, "vitamin_c_mg": { "type": [ "number", "null" ], "description": "Vitamin C in milligrams" }, "vitamin_d_ug": { "type": [ "number", "null" ], "description": "Vitamin D in micrograms" }, "calories_kcal": { "type": [ "number", "null" ], "description": "Calories in kilocalories" }, "cholesterol_mg": { "type": [ "number", "null" ], "description": "Cholesterol in milligrams" }, "carbohydrates_g": { "type": [ "number", "null" ], "description": "Carbohydrates in grams" }, "saturated_fat_g": { "type": [ "number", "null" ], "description": "Saturated fat in grams" } }, "additionalProperties": false }, "amount_used": { "type": "string" }, "amount_weight_g": { "type": "number" }, "data_source_type": { "type": "string", "x-fous-developer": true }, "matched_food_name": { "type": "string" } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
fdc.nal.usda.gov/get_nutrition_facts- Returns
- matched food name, amount weight, nutrients per 100 g and per amount, page link, FDC id, data source type
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method fdc.nal.usda.gov/get_nutrition_facts with the inputs above.
Ask your agent
- How many calories and protein are in 150 g of cooked brown rice?
- Nutrition breakdown for one medium banana, per 100 g and per banana
- What's the sodium and fiber content of 2 ounces of raw spinach?
- Look up the USDA nutrient profile for 1 cup of rolled oats
- Protein, fat, and carbs in 3 large eggs according to USDA FoodData Central
See more
All USDA methodsSearches USDA FoodData Central foods and branded products by food or brand name, ranked by relevance. Calories and serving sizes are null when not supplied.
fdc.nal.usda.gov/search_foodsLooks up a McDonald's menu item by name on the US, UK or Canada site and returns its nutrition, allergens, ingredients and photo link.
mcdonalds.com/get_menu_item_nutritionSearches Open Food Facts packaged foods by name, optionally filtered by diet, country where sold and brand, ordered by popularity (most scanned first).
openfoodfacts.org/search_productsLooks up a packaged food by barcode or by product name and brand, returning ingredients, allergens, Nutri-Score, NOVA processing level and nutrition from Open Food Facts.
openfoodfacts.org/get_productFinds FDA food recall enforcement reports by product, brand, or allergen, newest first. Reports are updated weekly and recall statuses may lag.
open.fda.gov/search_food_recallsSearch ALDI US groceries in site order with prices for the selected store. Prices and availability vary by store; related search results may follow direct matches.
aldi.us/search_productsFinds food businesses by name and town, street or postcode and returns their official food hygiene rating, inspection date and score descriptions. Scottish ratings usually have no component scores.
ratings.food.gov.uk/get_hygiene_ratingLooks up a chemical on PubChem by common name or CAS number and returns its formula, molecular weight, names, description, SMILES, InChIKey and 2D structure image link.
pubchem.ncbi.nlm.nih.gov/get_chemical