Open Food Facts API: Search packaged foods
Searches Open Food Facts packaged foods by name, optionally filtered by diet, country where sold and brand, ordered by popularity (most scanned first).
Unofficial. Not affiliated with or endorsed by Open Food Facts.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- Diet optional
diet Diet filter, for example vegan. Default: any.
vegan
One of
any,vegan,vegetarian,gluten_free,palm_oil_free. Defaultany.- Page optional
page Results page number, for example 2. Default: 1.
1 (default)
Whole number 1 or more.
- Brand optional
brand Brand to match, for example Nature Valley. Default: any.
any (default)
- Query, required
query Words to search for, for example granola or oat milk.
granola
- Country optional
country Country where the food is sold, for example United States or US. Default: any.
United States
Default
any.- Max Results optional
max_results Products per page, for example 20; maximum 100.
5
Whole number from 1 to 100. Default
20.
Input as JSON
{ "diet": "vegan", "query": "granola", "country": "United States", "max_results": 5}Output
{ "products": [ { "brand": "Kirkland Signature", "barcode": "0096619194261", "quantity": "35.3 oz (1 kg)", "photo_link": "https://images.openfoodfacts.org/images/products/009/661/919/4261/front_en.199.400.jpg" , "product_link": "https://world.openfoodfacts.org/product/0096619194261" , "product_name": "Ancient Grains Probiotic Granola", "fat_g_per_100g": 16.3636363636364, "salt_g_per_100g": 1.09090909090909, "processing_level": "Ultra-processed foods", "nutri_score_grade": "D", "sugars_g_per_100g": 16.3636363636364, "energy_kcal_per_100g": 454.545454545455 }, { "brand": "Nature's Path Organic", "barcode": "0058449770565", "quantity": "35.3 oz (2 lb 3.3 oz) 1 kg", "photo_link": "https://images.openfoodfacts.org/images/products/005/844/977/0565/front_en.111.400.jpg" , "product_link": "https://world.openfoodfacts.org/product/0058449770565" , "product_name": "Pumpkin Seed + Flax Granola", "fat_g_per_100g": 18.1818181818182, "salt_g_per_100g": 0.204545454545455, "processing_level": "Processed foods", "nutri_score_grade": "C", "sugars_g_per_100g": 18.1818181818182, "energy_kcal_per_100g": 472.727272727273 }, { "brand": "purely elizabeth.", "barcode": "0855140002175", "quantity": "12 oz (340 g)", "photo_link": "https://images.openfoodfacts.org/images/products/085/514/000/2175/front_en.72.400.jpg" , "product_link": "https://world.openfoodfacts.org/product/0855140002175" , "product_name": "ORIGINAL ANCIENT GRAIN GRANOLA", "fat_g_per_100g": 16.6666666666667, "salt_g_per_100g": 1.125, "processing_level": "Processed foods", "nutri_score_grade": "E", "sugars_g_per_100g": 20, "energy_kcal_per_100g": 433.333333333333 } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"openfoodfacts.org/search_products","input":{"diet":"vegan","query":"granola","country":"United States","max_results":5}}' # 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": "openfoodfacts.org/search_products" , "input": { "diet": "vegan", "query": "granola", "country": "United States", "max_results": 5 }})# 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": "openfoodfacts.org/search_products" , "input": { "diet": "vegan", "query": "granola", "country": "United States", "max_results": 5 } }), 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 openfoodfacts.org/search_products# with {"diet":"vegan","query":"granola","country":"United States","max_results":5}"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": [ "query" ], "properties": { "diet": { "enum": [ "any", "vegan", "vegetarian", "gluten_free", "palm_oil_free" ], "type": "string", "default": "any", "description": "Diet filter, for example vegan. Default: any." }, "page": { "type": "integer", "default": 1, "minimum": 1, "description": "Results page number, for example 2. Default: 1." }, "brand": { "type": "string", "default": "any", "description": "Brand to match, for example Nature Valley. Default: any." }, "query": { "type": "string", "minLength": 1, "description": "Words to search for, for example granola or oat milk." }, "country": { "type": "string", "default": "any", "description": "Country where the food is sold, for example United States or US. Default: any." }, "max_results": { "type": "integer", "default": 20, "maximum": 100, "minimum": 1, "description": "Products per page, for example 20; maximum 100." } }}Output schema
{ "type": "object", "required": [ "products" ], "properties": { "products": { "type": "array", "items": { "type": "object", "required": [ "product_name", "brand", "quantity", "nutri_score_grade", "processing_level", "energy_kcal_per_100g", "sugars_g_per_100g", "fat_g_per_100g", "salt_g_per_100g", "photo_link", "product_link", "barcode" ], "properties": { "brand": { "type": [ "string", "null" ], "description": "Brand name." }, "barcode": { "type": "string", "description": "Product barcode.", "x-fous-developer": true }, "quantity": { "type": [ "string", "null" ], "description": "Package quantity." }, "photo_link": { "type": [ "string", "null" ], "description": "Product photo link." }, "product_link": { "type": "string", "description": "Open Food Facts product page." }, "product_name": { "type": [ "string", "null" ], "description": "Product name." }, "fat_g_per_100g": { "type": [ "number", "null" ], "description": "Fat in grams per 100 g." }, "salt_g_per_100g": { "type": [ "number", "null" ], "description": "Salt in grams per 100 g." }, "processing_level": { "type": [ "string", "null" ], "description": "Processing category in words, when known." }, "nutri_score_grade": { "enum": [ "A", "B", "C", "D", "E", null ], "type": [ "string", "null" ], "description": "Nutri-Score grade, A to E, when known." }, "sugars_g_per_100g": { "type": [ "number", "null" ], "description": "Sugars in grams per 100 g." }, "energy_kcal_per_100g": { "type": [ "number", "null" ], "description": "Energy in kilocalories per 100 g." } }, "additionalProperties": false } } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
openfoodfacts.org/search_products- Returns
- product name, brand, quantity, Nutri-Score, processing level, energy, sugars, fat, salt per 100 g, photo, product link, barcode
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 openfoodfacts.org/search_products with the inputs above.
Ask your agent
- Find vegan oat milk brands sold in the United States and show me their Nutri-Score and sugar per 100 g
- What are the most popular gluten-free crackers available in Canada? I need the barcodes too
- On Open Food Facts, look up Nature Valley granola bars and list energy, fat and salt per 100 g
- Search Open Food Facts for palm oil free chocolate spreads sold in France, 50 results please
- Show me page 2 of vegetarian frozen pizza products in the UK with their processing level and photos
See more
All Open Food Facts methodsLooks 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_productSearches 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_foodsFinds 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_recallsSearches Trader Joe's public product catalogue by name or keywords, optionally within a main category. Prices are website reference prices and may vary by store.
traderjoes.com/search_productsFinds BBC Good Food recipes for a dish or ingredients in search order, with ratings, time, difficulty, photos and links. Excludes app-only recipes.
bbcgoodfood.com/search_recipesSearch 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 Network recipes for a dish or ingredient, optionally filtered by chef, in site search order.
foodnetwork.com/search_recipesSearches IKEA products in a chosen country and returns current prices, details, photos and reviews in IKEA's result order.
ikea.com/search_products