How Your Barcode Scans Help Build Open Food Facts, the Free Food Database
When you scan a barcode that Open Food Facts doesn't know yet and add the product in AI Food Coach, you're not just logging your meal — you're adding the product for everyone who scans it after you. Here's how that works, and what goes to Open Food Facts, the free food products database.
What is Open Food Facts?
Open Food Facts is a free, open food database with more than 4,000,000 products from 150 countries, added by more than 100,000 contributors (Open Food Facts, October 2026). Think of it as Wikipedia for food — anyone can contribute, and all data is freely available.
The database is released under the Open Database License (ODbL), which means any app, researcher, or organization can use it without paying licensing fees.
Open Food Facts by the numbers (October 2026)
4,000,000+ products · 150 countries · 100,000+ contributors
How It Started — Why We Use Open Food Facts
When we built the barcode scanning feature for AI Food Coach, we needed a food database. The options were:
- Commercial databases — a paid license, tied to one vendor
- USDA FoodData Central — great for generic foods, but no barcode coverage for packaged products outside the US
- Open Food Facts — free, global, community-maintained, built around barcodes
The choice was clear: Open Food Facts covers packaged products from around the world, including European and regional brands.
The API is straightforward: send a barcode, get back nutrition data. One endpoint, no API key required for reads:
GET https://world.openfoodfacts.org/api/v2/product/{barcode}.json
The Problem: Missing Products
No food database is complete. New products launch every week. Regional and store-brand items are often missing. When you scan a barcode that isn't in Open Food Facts, you get... nothing.
For a calorie tracking app, this is a dead end. The user scanned the barcode to avoid manual entry — and now they need to type everything in anyway.
We solved this with AI. When a product isn't found, you take a photo of its nutrition table (and, if you like, of the front of the pack), and AI reads the table in seconds. You check the values, correct anything it misread, and log your meal.
But we realized: if AI already extracted all the nutrition data, why not share it back?
Why We Contribute Back
Open Food Facts gave us a free, high-quality food database. Contributing back is the natural thing to do.
- Every contribution helps other apps — every app that uses Open Food Facts data gets the product too.
- Regional products get coverage — our users scan products from their own countries and local stores.
- The database gets more accurate — AI-extracted values are verified by the user before submission, providing a human-in-the-loop quality check.
- Everyone wins — you get your macros from the barcode scan. The product lands in the database. Next time anyone scans the same barcode — instant results, no AI needed. One scan saves AI costs for every future lookup, and the database grows with every new product.
- No lock-in — unlike proprietary databases, Open Food Facts data belongs to everyone.
How It Works — Step by Step
Here's what happens when you scan a barcode in AI Food Coach:
- Scan — Point your camera at the barcode. The app reads it instantly.
- Database lookup — The app checks Open Food Facts for nutrition data.
- Found? — If yes, you see the product with nutrition info. Confirm and log.
- Not found? — The app asks for a photo of the nutrition table (and, optionally, the front of the pack).
- AI reads the label — it extracts the nutrition values from the photo; salt is converted to sodium.
- You confirm — Review the AI-extracted values, edit if needed, then log your meal.
- Auto-submit — After you confirm, the app sends the product data to Open Food Facts in the background. Fire-and-forget — it doesn't slow you down.
- Edit later — If you correct a product you saved, your changes go to Open Food Facts too.
Your meal logging isn't affected
The Open Food Facts submission happens after you've already logged your meal. It's a background task that runs silently. If it fails (no internet, server busy), the product's data waits in a queue on your phone — without the photos, up to 10 products — and is sent the next time you open the app. Your tracking is never interrupted.
How AI Makes It Fast
Manually entering nutrition data from a label means typing every value — calories, carbs, protein, fat, fiber, sugar, sodium, and more. That's tedious enough for your own tracking, let alone contributing to a public database.
AI changes this. You take a photo of the nutrition label, and AI reads the entire table — extracting every value into a structured format the app can use for calorie counting. The same structured data that powers your macro tracking is exactly what Open Food Facts needs.
That's the key insight: the data already exists in the right format. AI extracted it, you confirmed it, and the app used it for your meal log. Sending it to Open Food Facts is just one extra step — and it happens automatically in the background.
Instead of typing every value from the label, you take a photo and confirm — and the open food database grows with every product you add.
What Gets Contributed
When you add a product, the app sends:
| Field | Notes |
|---|---|
| Product name | As you confirmed it |
| Brand | Optional |
| Barcode | The code you scanned (EAN-13 or UPC-A) |
| Calories, carbohydrates, sugars, protein, fat, saturated fat, fiber, sodium, cholesterol | Per 100 g; sodium converted from salt when the label lists salt |
| Package size | If you entered it |
| Country | The country of your phone's region |
| Photos | The nutrition table, and the front of the pack if you took one |
An edit of a product you saved sends your corrections. Every submission goes through our backend as a proxy — Open Food Facts API credentials stay on our server, never in the app — and the product is filed under AI Food Coach's Open Food Facts account with the comment “Added via AI Food Coach app”.
The Bigger Picture
Here's what makes this work so well — every scan creates a cycle where everyone wins:
- You scan a new product. AI reads the label. You get your macros and log your meal.
- The product lands in the database. Confirmed by you, submitted automatically.
- Next time anyone scans that barcode — anywhere in the world, in any app that uses Open Food Facts — they get instant results. No AI needed, no processing cost, no waiting.
One AI call costs a fraction of a cent. But it only needs to happen once per product. After that, the data stays in the database — free for everyone. The more people scan, the fewer products are missing, and the less AI processing is needed overall.
This is the real network effect of open data. Every user who adds a missing product makes the database better for all future users — across all apps, not just ours.
- Researchers use Open Food Facts data in their studies
- France's National Nutrition and Health Program used it to validate its nutrition score
- Other calorie trackers get the same product data instantly
There's no vendor lock-in. If you switch to a different app that uses Open Food Facts, your contributions are still there. The data belongs to the community, not to any single company.
You get your macros. The database grows. Future scans are instant and free. It's a small action with a big ripple effect — and it happens automatically while you track your meals.