Food+API.SH

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
Nutrition search (generic foods)
GET https://api.api.sh/food/v1/nutrition
{ "success": true }
1 credit · $1 per 1,000 calls

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.

Product research and sustainability scores

Compare products in a category by Nutri-Score, Eco-Score and packaging, using the lifecycle CO2e figures returned for each product.

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

Search and discovery2
Nutrition search (generic foods)
/food/v1/nutrition
$1 · $2 PAYG
1 credit
Food product search
/food/v1/search
$1 · $2 PAYG
1 credit
Products, listings and places1
Food product by barcode
/food/v1/product
$1 · $2 PAYG
1 credit
More data1
Full nutrition facts of a food
/food/v1/nutrition-facts
$1 · $2 PAYG
1 credit

Call the Food API

Nutrition search (generic foods): GET https://api.api.sh/food/v1/nutrition

curl "https://api.api.sh/food/v1/nutrition?q=cheddar+cheese" \
  -H "x-api-key: $APISH_KEY"
  1. Create a free accountConfirm your email and get 1,000 free credits every month. No card needed.
  2. Create an API keyOne key works for all 483 platforms.
  3. Send the requestJSON back in one call. Add output=csv or output=ndjson for 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.

More public data APIs all public data APIs →

Start with 1,000 free credits
Every month, on every account. One key works for all 483 platforms.
Get a free API key