Food Barcode & Nutrition API
Scan a barcode, get the product: name, brand, ingredients, allergens, nutrition facts, Nutri-Score, NOVA & Eco-Score. Search 4M+ foods worldwide.
Get a free API key on RapidAPI Try it in the playgroundFood Barcode & Nutrition API
The data behind a food scanner app, in one API — 4M+ packaged foods from 150+ countries.
🏷️ Barcode lookup
Send an EAN-13 / UPC-A / EAN-8 code and get name, brand, quantity, images, categories, ingredients text, allergens & traces, additives (E-numbers), labels (organic, gluten-free…), vegan / vegetarian / palm-oil flags.
🥗 Nutrition
Per 100 g, per serving, or for any custom portion in grams: energy (kcal / kJ), fat, saturated fat, carbs, sugars, fiber, protein, salt and more — with Nutri-Score (A–E), NOVA group (1–4) and Eco-Score.
⚠️ Allergen check
Pass the allergens your user avoids and get a clear contains / may_contain / safe answer.
🔍 Search & compare
Full-text search with filters (brand, category, country, label, Nutri-Score, NOVA), and side-by-side nutrition comparison of up to 6 products.
Use cases: barcode-scanner & calorie-counter apps · diet and allergy apps · grocery and recipe apps · retail catalogs · health research
Keywords: food api, barcode lookup api, nutrition api, upc lookup, ean lookup, nutrition facts, calories api, nutri-score, allergens api, ingredients, open food facts
Endpoints (5)
| Endpoint | What it returns |
|---|---|
GET/product | Product by barcode Full product record for an EAN / UPC barcode: name, brands, quantity, images, categories, ingredients, allergens, traces, additives, labels, vegan / vegetarian flags, nutrition per 100 g and per serving, Nutri-Score, NOV |
GET/search | Search products Full-text product search with filters. Combine `query` with brand, category, country, label, Nutri-Score or NOVA group. Sorted by popularity (scan count) by default. |
GET/nutrition | Nutrition facts Nutrition facts per 100 g and per serving, and optionally for any portion in grams (`grams`). Includes Nutri-Score, NOVA group and traffic-light nutrient levels. |
GET/allergens | Allergens & diet check Allergens, traces, additives, ingredients and vegan / vegetarian flags. Pass `avoid` (comma-separated, e.g. milk,nuts,gluten) to get a contains / may-contain / safe verdict. |
GET/compare | Compare products Side-by-side nutrition per 100 g for 2-6 products, with the winner per nutrient (lowest sugar, salt, calories, saturated fat; highest protein and fiber). |
Quick start
Subscribe on RapidAPI (free plan available), copy your key, and call GET /product:
curl --request GET \
--url 'https://food-barcode-nutrition-api.p.rapidapi.com/product?barcode=3017620422003' \
--header 'x-rapidapi-host: food-barcode-nutrition-api.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'import requests
url = "https://food-barcode-nutrition-api.p.rapidapi.com/product?barcode=3017620422003"
headers = {
"x-rapidapi-host": "food-barcode-nutrition-api.p.rapidapi.com",
"x-rapidapi-key": "YOUR_RAPIDAPI_KEY",
}
resp = requests.get(url, headers=headers)
print(resp.json())const res = await fetch("https://food-barcode-nutrition-api.p.rapidapi.com/product?barcode=3017620422003", {
method: "GET",
headers: {
"x-rapidapi-host": "food-barcode-nutrition-api.p.rapidapi.com",
"x-rapidapi-key": "YOUR_RAPIDAPI_KEY"
}
});
console.log(await res.json());
Example response
{
"barcode": "3017620422003",
"name": "Nutella",
"brands": [
"Ferrero",
"Nutella"
],
"brand": "Ferrero",
"quantity": "400 g e",
"serving_size": null,
"nutri_score": "E",
"nova_group": 3,
"eco_score": "F",
"image": "https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.879.400.jpg",
"image_small": "https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.879.200.jpg",
"categories": [
"sweet spreads",
"pates a tartiner"
],
"url": "https://world.openfoodfacts.org/product/3017620422003",
"generic_name": "Hazelnut And Cocoa Spread",
"ingredients_text": "sugar, palm oil",
"allergens": [
"milk",
"nuts"
],
"traces": [],
"additives": [],
"labels": [
"vegetarian",
"no gluten"
],
"countries": [
"belgium",
"france"
],
"is_vegan": null,
"is_vegetarian": true,
"palm_oil_free": false,
"nutrition_per_100g": {
"energy_kcal": 539,
"energy_kj": 2252,
"fat_g": 30.9,
"saturated_fat_g": 10.6,
"trans_fat_g": null,
"carbohydrates_g": 57.5,
"sugars_g": 56.3,
"added_sugars_g": 52.13,
"fiber_g": 0,
"proteins_g": 6.3,
"salt_g": 0.107,
"sodium_g": 0.043,
"cholesterol_g": null,
"calcium_g": null,
"iron_g": null,
"potassium_g": null,
"vitamin_c_g": null,
"caffeine_g": null,
"alcohol_pct": null
},
"nutrition_per_serving": null,
"nutrient_levels": {
"fat": "high",
"salt": "low",
"saturated-fat": "high",
"sugars": "high"
},
"images": {
"front": "https://images.openfoodfacts.org/images/products/301/762/042/2003/front_en.879.400.jpg",
"ingredients": "https://images.openfoodfacts.org/images/products/301/762/042/2003/ingredients_en.1026.400.jpg",
"nutrition": "https://images.openfoodfacts.org/images/products/301/762/042/2003/nutrition_en.822.400.jpg"
},
"packaging": "pot: clear glass (recycle in glass bin),lid: plastic (recycle in sorting bin),seal: aluminium (recycle in sorting bin),jar: clear glass (recycle)",
"origins": null,
"manufacturing_places": null,
"stores": "Aldi, Auchan, Carrefour, Casino, Intermarché, Leclerc, Lidl, Super U",
"last_modified": "2026-11-18T18:59:10.000Z",
"data_completeness": 0.9,
"attribution": "Open Food Facts (ODbL) — https://world.openfoodfacts.org"
}
Start free. Every plan includes all endpoints; upgrade only when you need more requests. Runs on Cloudflare's global network for low latency worldwide.
Subscribe on RapidAPI