API Directory › 🍔 Food & Drink › Open Food Facts
No authHTTPSCORS

Open Food Facts API

Open database of food products worldwide — ingredients, nutrition, labels.

Auth
No auth needed
HTTPS
Yes
CORS
Yes
Open Open Food Facts docs ↗

What it does

Open Food Facts is a collaborative, open database of food products from around the world — over 3 million items keyed by barcode — with ingredients, allergens, nutrition facts, Nutri-Score, NOVA processing group, labels, packaging and photos. The data is open (ODbL).

Base URL

https://world.openfoodfacts.org

Authentication

None for reads. A descriptive User-Agent (app name + version + contact) is required. Product lookup: /api/v2/product/{barcode}.json. Search: /api/v2/search or the older /cgi/search.pl.

Code examples

curl
curl -s "https://world.openfoodfacts.org/api/v2/product/737628064502.json" \
  -H "User-Agent: larzos-demo/1.0 (contact@example.com)"
Python (search a category)
import requests

H = {"User-Agent": "larzos-demo/1.0 (contact@example.com)"}
r = requests.get("https://world.openfoodfacts.org/api/v2/search", params={
    "categories_tags_en": "breakfast-cereals", "nutrition_grades_tags": "a",
    "fields": "product_name,brands,nutriscore_grade", "page_size": 5},
    headers=H, timeout=15)
for p in r.json()["products"]:
    print(p.get("product_name"), "-", p.get("brands"))

Rate limits & quotas

Recently added rate limits on the shared server: roughly 100 req/min for product reads, 10 req/min for search, and 2 req/min for facet queries. Over that: HTTP 429. Bulk users should download the data exports (MongoDB dump, CSV, Parquet) instead of crawling.

Key response fields

status / status_verbose1 = product found, 0 = not found
product.product_name / brands / quantityBasic identity
product.ingredients_text / allergens_tagsIngredients and allergens
product.nutrimentsPer-100g and per-serving nutrient values
product.nutriscore_grade / nova_group / ecoscore_gradeComputed scores

Common errors

status: 0Barcode not in the database — you can contribute it via the write API or the app.
429Rate limit exceeded — slow down or use the data dumps.
(missing fields)Crowd-sourced data is uneven — many products lack full nutrition or photos; code defensively.

When to use it (and alternatives)

The best free source for barcode → product lookups, allergen checks and Nutri-Score, especially for a scanning app. Coverage is strongest in Europe. For US-centric authoritative nutrient data use USDA FoodData Central; there are sibling projects for beauty, pet food and general products.

FAQ

Why is the User-Agent mandatory?

Open Food Facts runs on donated infrastructure and needs to identify and, if necessary, contact heavy users. Requests with a generic or missing User-Agent may be blocked.

The data for a product is incomplete — why?

It is entirely crowd-sourced. Popular products are well filled in; obscure ones may have just a name and a photo. Always null-check nutriments and score fields.

How do I do large-scale analysis?

Don’t crawl the API — download the full database export (available as MongoDB, CSV, JSONL and Parquet) and query it locally.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related Food & Drink APIs

← Back

More Food & Drink APIs · All 196 APIs