Open Food Facts API
Free food product API with no key: look up nutrition, ingredients, allergens, Nutri-Score and eco-score by barcode. 3M+ products. Tested curl example.
Endpoint tested and returned HTTP 200 on 19 Aug 2026
What is the Open Food Facts API?
Open Food Facts is a free, open-data API covering over three million food products worldwide. Look up any product by barcode to get ingredients, nutrition facts, allergens, Nutri-Score and eco-score, with no API key.
Open Food Facts is a collaborative open-data project, effectively Wikipedia for food products. Scan a barcode, get back the full ingredient list, nutrition table per 100g, allergen warnings and computed scores — all as open data with no commercial tier.
Because the data is crowd-sourced, completeness varies by product and region. Coverage is excellent across Europe and steadily improving elsewhere, but you should always code defensively: any given field may be absent for a given product.
Quick facts
- Base URL
https://world.openfoodfacts.org/api/v2- Authentication
- No key for reads. Writing product data requires an account, and a descriptive User-Agent is requested.
- Rate limit
- 100 requests per minute for product queries; 10 per minute for search.
- Pricing
- Free open data under the Open Database Licence.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the Open Food Facts API
Every request below was executed against the live API on 19 Aug 2026, and the response shown is the real body it returned — not an illustration.
1. Look up a product by barcode
GET https://world.openfoodfacts.org/api/v2/product/737628064502.json
curl 'https://world.openfoodfacts.org/api/v2/product/737628064502.json'const res = await fetch("https://world.openfoodfacts.org/api/v2/product/737628064502.json");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://world.openfoodfacts.org/api/v2/product/737628064502.json", timeout=20)
res.raise_for_status()
print(res.json()){
"code": "0737628064502",
"product": {
"_id": "0737628064502",
"_keywords": [
"and",
"asia",
"beverage",
"cereal",
"food",
"gluten",
"include",
"kit",
"kitchen",
"no",
"noodle",
"pasta",
"peanut",
"plant-based",
"potatoe",
"product",
"rice",
"seasoning",
"simply",
"stir-fry",
"thai",
"thailand",
"their",
"vegan",
"vegetarian"
],
"added_countries_tags": [],
"additives_n": 1,
"additives_original_tags": [
"en:e330"
],
"additives_tags": [
"en:e330"
],
"allergens": "peanuts, sesame seeds, soybeans",
"allergens_from_ingredients": "en:sesame-seeds, en:peanuts, en:soybeans, en:peanuts, peanut",
"allergens_from_user": "(en) en:peanuts",
"allergens_hierarchy": [
"en:peanuts",
"en:sesame-seeds",
"en:soybeans"
],
"allergens_lc": "en",
"allergens_tags": [
"en:peanuts",
"en:sesame-seeds",
"en:soybeans"
],
"amino_acids_prev_tags": [],
"amino_acids_tags": [],
"brand_owner": "Simply Asia Foods, Inc.",
"brand_owner_imported": "Simply Asia Foods, Inc.",
"brands": "Simply Asia, Thai Kitchen",
"brands_tags": [
"Simply Asia",
"Thai Kitchen"
],
"categories": "Cereals and their products, Noodles, Rice Noodles",
"categories_hierarchy": [
"en:plant-based-foods-and-beverages",
"en:plant-based-foods",
"en:cereals-and-potatoes",
"en:cereals-and-their-products",Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
<barcode> | path | Required | EAN/UPC barcode of the product. 737628064502 |
fields | string | Optional | Comma-separated fields to return, shrinking a very large payload. product_name,nutriments |
lc | string | Optional | Language code for localised fields. en |
Response fields
statusinteger- 1 when the product was found, 0 when not.
product.product_namestring- Product name.
product.ingredients_textstring- Full ingredient list as text.
product.nutrimentsobject- Nutrition values per 100g and per serving.
product.allergens_tagsarray- Detected allergens as tags.
product.nutriscore_gradestring- Nutri-Score from a to e.
product.ecoscore_gradestring- Environmental score, where computed.
What you can build with the Open Food Facts API
- Build a barcode-scanning nutrition or diet-tracking app
- Check products against allergen or dietary restrictions
- Compare nutritional quality using Nutri-Score
- Support sustainability features with eco-score data
Common errors and how to fix them
status: 0
Barcode not in the database.
Fix: Coverage is crowd-sourced and incomplete — handle misses gracefully and consider letting users contribute the product.
Missing nutriment fields
Not every product has complete data.
Fix: Never assume a field exists; check before reading, especially for allergens and scores.
Very large response
Full product records are big.
Fix: Use the `fields` parameter to request only what you render.
Open Food Facts API — frequently asked questions
Is there a free barcode API for food products?
Yes. Open Food Facts covers over three million products worldwide with no API key, returning ingredients, nutrition, allergens and Nutri-Score by barcode.
How complete is the data?
It varies. The database is crowd-sourced, so coverage is strongest in Europe and thinner elsewhere, and individual fields may be missing for any product. Always code defensively.
What is Nutri-Score?
A front-of-pack nutritional rating from A (best) to E (worst) used across much of Europe, computed from the product's nutritional composition. Open Food Facts exposes it as `nutriscore_grade`.
Can I use Open Food Facts commercially?
Yes, the data is under the Open Database Licence, which permits commercial use provided you attribute the source and share adaptations under the same licence.
Tools that pair with this API
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Unit Converter
Convert between units of length, weight, temperature, area, volume, speed, time and data storage instantly, with a swap button and common conversion tables.
Percentage Calculator
Calculate what X% of a number is, what percent one number is of another, and percentage increase or decrease between two values — instantly and free.
Alternatives to Open Food Facts API
If Open Food Facts does not fit, these food & drink apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.
| API | What it does | Auth | CORS | Last verified |
|---|---|---|---|---|
| TheMealDB | Free recipe API with no signup: search meals by name, ingredient, category or area, with full instructions, ingredient lists and photos. Tested example. | No key | Yes | 19 Aug 2026 |
| TheCocktailDB | Free cocktail recipe API with no signup: search drinks by name, ingredient or category, with instructions, measures, glass type and photos. Tested example. | No key | Yes | 19 Aug 2026 |
| Fruityvice | Free fruit API with no key: nutritional data, family, genus and order for dozens of fruits. Simple flat JSON, ideal for beginners. Tested curl example. | No key | No | 19 Aug 2026 |
| Sample APIs Coffee | Free coffee API with no key: hot and iced coffee drinks with ingredients, descriptions and images. Small, clean dataset ideal for tutorials. Tested. | No key | Yes | 20 Aug 2026 |
| Open Prices (Open Food Facts) | Free grocery price API with no key for reads: crowdsourced product prices tied to a barcode, a shop location from OpenStreetMap and a date. Tested example included. | No key | Yes | 21 Aug 2026 |
| Status Pizza | Free HTTP status code API with no key: every status code mapped to a pizza photograph, plus JSON giving the code's title and category. Tested example included. | No key | No | 21 Aug 2026 |
Open Food Facts is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 19 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.