Microproduct data guidebeginner

Open Food Facts

Collaborative packaged-food product records for building barcode lookup, label, and nutrition-comparison tools.

At a glance

Difficulty
Beginner — comfortable for a first prototype
Size
Large · 0.1–20 GB
Formats
JSON, CSV
Access
API or Download
API key
Not required
Provider
Open Food Facts
Updates
Continuous

From source to product signal

Test a product idea in four steps

Open Food Facts publishes packaged-product facts, including Nutri-Score and ingredient lists, under ODbL. Start with one barcode and a custom User-Agent. Contributor data can be incomplete, images have a separate share-alike licence, and the database is not medical advice.

1

Check the setup

  • Python 3.10 or newer
  • A notebook environment such as Jupyter or Google Colab
  • An internet connection
2

Access the data

  1. 1.Read the terms of use, including attribution and share-alike for derivative databases.
  2. 2.Request one product by barcode with a descriptive User-Agent.
  3. 3.Keep the barcode, product name, and Nutri-Score if present.
Open official source
3

Run the Python example

Install the packages, then run the notebook cell.

python -m pip install pandas requests

import pandas as pd
import requests

response = requests.get(
    "https://world.openfoodfacts.org/api/v2/product/737628064502.json",
    headers={
        "User-Agent": (
            "TrilemmaDataCatalogExample/1.0 "
            "(https://data.trilemma.foundation)"
        )
    },
    timeout=30,
)
response.raise_for_status()
product = pd.json_normalize(response.json()["product"])
print(product.filter(regex="code|product_name|nutriscore|brands").head())
4

Test a useful signal

Look up one packaged food by barcode

Test whether Open Food Facts can power a bounded product-fact card.

  1. 01Keep barcode, product name, brands, and Nutri-Score.
  2. 02Record missing nutrition or ingredient fields instead of filling them from other sites.
  3. 03Attribute Open Food Facts under ODbL and note that images and third-party packaging rights are separate.

Dataset details

Open Food Facts is a nonprofit source. Last verified 2026-08-18. Temporal coverage: continuously updated product records.

Theme

Health, Food & Safety

Domains

NutritionFood ScienceConsumer Safety

Data types

Product DataTabular

Tasks

Product LookupLabel AnalysisNutrition Comparison

Geography

Global

Formats

JSONCSV

Provider

Open Food Facts

Data terms

Open Database License