+Food API
Nutrition facts for generic foods and packaged products by barcode, from USDA FoodData Central and Open Food Facts.
The API.SH Food API joins two public food databases under one key. Search about 13,500 generic foods from USDA FoodData Central (fruits, vegetables, meats, dairy, grains and dishes) for calories and key nutrients per 100 g with common portions, then get every nutrient USDA lists for a food, scaled to grams or a named portion such as a cup or a slice. For packaged food, look up a product by EAN or UPC barcode in Open Food Facts (3M+ products) for ingredients, allergens, additives, Nutri-Score, NOVA group, Eco-Score, nutrition per 100 g and per serving and images, or search products by text, brand, category, country and diet.
- 4 endpoints
- from $1 / 1,000 calls
- 1,000 free credits / month
- failed calls free
GET https://api.api.sh/food/v1/ nutrition
{ "success": true } What you can build with the Food API
Calorie and macro tracking apps
Let users search foods like "banana" or "chicken breast" and log calories, protein, fat and carbohydrate for the portion they ate.
Barcode scanning
Scan a packaged product and show its name, brand, nutrition per serving, allergens, Nutri-Score and NOVA group from the barcode.
Allergen and diet filters
Search products with allergens excluded, ingredients included or excluded, or a vegan, vegetarian or palm oil free diet filter to build safe shopping lists.
Recipe nutrition calculators
Scale full nutrition facts for each ingredient to its weight in grams or a named portion and add them up per recipe or serving.
Food data you get
Field names from real responses. Numbers come parsed, URLs absolute, dates in ISO 8601.
Food API endpoints and prices
Every Food endpoint costs 1 credit per call: credits are $1 per 1,000 on a monthly plan, $2 pay-as-you-go. Pricing
| Nutrition search (generic foods) /food/ | $1 · $2 PAYG 1 credit |
| Food product search /food/ | $1 · $2 PAYG 1 credit |
| Food product by barcode /food/ | $1 · $2 PAYG 1 credit |
| Full nutrition facts of a food /food/ | $1 · $2 PAYG 1 credit |
Call the Food API
Nutrition search (generic foods): GET https://api.api.sh/food/
curl "https://api.api.sh/food/v1/nutrition?q=cheddar+cheese" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/food/v1/nutrition",
params={"q": "cheddar cheese"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/food/v1/nutrition");
url.searchParams.set("q", "cheddar cheese");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); # Google Sheets (API.SH add-on)
=APISH("/food/v1/nutrition", "q", "cheddar cheese")
# Zapier, Make, n8n (verified node): pick the API.SH app,
# choose "Food" and "Nutrition search (generic foods)".
# AI agents (Claude, ChatGPT, Cursor): add the
# API.SH MCP server https://api.sh/mcp - Create a free accountConfirm your email and get 1,000 free credits every month. No card needed.
- Create an API keyOne key works for all 483 platforms.
- Send the requestJSON back in one call. Add
output=csvoroutput=ndjsonfor files.
Why API.SH for Food data
- Public data only: no Food login, cookies or account needed
- One key and one response shape for Food and 482 other platforms
- Built and maintained by API.SH, not third-party publishers
- Pay per call; errors on our side cost nothing
- Live status for every endpoint
API.SH vs the official Food API
Both sources offer free APIs: USDA FoodData Central needs a free data.gov key, and Open Food Facts is open. API.SH puts USDA generic foods and Open Food Facts products behind one key, with one JSON shape and paging style, portion scaling in a single call, and no-code and MCP support.
FatSecret, Edamam, Nutritionix and API Ninjas offer larger branded and restaurant databases or natural-language parsing on monthly plans. API.SH is pay-per-call and fits apps that need generic food nutrition plus barcode lookups.
Food API questions
What food data can I get?+
Generic food search with key nutrients per 100 g and portions (/food/v1/nutrition), every nutrient for one food scaled to grams or a portion (/food/v1/nutrition-facts), a packaged product by barcode with ingredients, allergens, Nutri-Score, NOVA and Eco-Score (/food/v1/product) and product search with brand, category, country, allergen and diet filters (/food/v1/search).
How much does the Food API cost?+
Every Food endpoint costs 1 credit per call. On a monthly plan 1,000 credits cost $1 (Starter is $50/month for 50,000 credits). Pay-as-you-go is $2 per 1,000 credits, with top-ups from $15 that never expire.
Is there a free food API available?+
Yes. Every account gets 1,000 free credits every month. That is 1,000 calls to /food/v1/nutrition at 1 credit each. USDA FoodData Central and Open Food Facts also offer free APIs of their own; API.SH combines them under one key.
Where does the data come from?+
Generic foods come from USDA FoodData Central (Foundation, SR Legacy and survey foods). Packaged products come from Open Food Facts, the open database of products identified by barcode.
Do I need keys for the underlying sources?+
No. You do not need a data.gov key or any other registration. One API.SH key covers all four food routes.
Can I look up food by barcode?+
Yes. Pass an EAN or UPC barcode to /food/v1/product. Coverage depends on Open Food Facts, which is strongest for products sold in Europe.
Does it include restaurant menus or recipes?+
No. It covers generic foods and packaged products. You can build recipe nutrition yourself by scaling each ingredient with /food/v1/nutrition-facts.
How do I get started?+
1. Sign up at api.sh. 2. Copy your API key. 3. Call /food/v1/nutrition with q=apple, then /food/v1/nutrition-facts with the fdc_id you got back. Request examples and every parameter are in the docs at https://api.sh/docs. You can also use the JS or Python SDK, Google Sheets, Zapier, Make, n8n or the MCP server at https://api.sh/mcp.