ข้อมูล

Conditions for reuse

ฐานข้อมูลผลิตภัณฑ์ของ Open Food Facts ใช้สัญญาอนุญาต Open Database License
ข้อมูลผลิตภัณฑ์แต่ละชนิดใช้สัญญาอนุญาต Database Contents License
รูปภาพผลิตภัณฑ์ใช้สัญญาอนุญาต Creative Commons Attribution ShareAlike ภาพเหล่านี้อาจมีส่วนที่อยู่ภายใต้ลิขสิทธิ์หรือสัญญาอนุญาตแบบอื่น ซึ่งอาจนำไปใช้งานได้ในบางกรณี (ตามสิทธิ์แบบ Quatation rights หรือ Fair use)

ควรอ่าน ข้อกำหนดและเงื่อนไขการใช้งาน และนำข้อมูลกลับมาใช้ใหม่ ก่อนนำข้อมูลไปใช้งาน

Tell us about your reuse

เราสนใจมากที่จะรู้ว่าคุณนำข้อมูล Open Food Facts นั้นไปใช้ทำอะไร It is not mandatory, but we would very much appreciate it if you tell us about your re-uses so that we can share them with the Open Food Facts community. เราสนใจมากที่จะรู้ว่าคุณนำข้อมูล Open Food Facts นั้นไปใช้ทำอะไร It is not mandatory, but we would very much appreciate it if you tell us about your re-uses so that we can share them with the Open Food Facts community. You can also fill this form to get a chance to get your app featured.

การส่งออกข้อมูล Open Food Facts

ระบบจะสำรองข้อมูลด้วยการทำ database dump ในทุกคืน The database is very big, so you can find different ways to use the data, depending on the export flavor.

ข้อมูลเกี่ยวกับฟิลด์ต่าง ๆ สำหรับการถ่ายโอนข้อมูล MongoDB และการส่งออก CSV มีอยู่ที่ https://world.openfoodfacts.org/data/data-fields.txt

MongoDB dump

ข้อมูลสำหรับผลิตภัณฑ์ทั้งหมดมีอยู่ใน ฐานข้อมูล MongoDB

ลิงก์
https://static.openfoodfacts.org/data/openfoodfacts-mongodbdump.gz
sha256sum
https://static.openfoodfacts.org/data/gz-sha256sum
md5sum
https://static.openfoodfacts.org/data/gz-md5sum

Delta Export

Daily delta exports are provided for the previous 14 days. The list of currently available delta files can be found at https://static.openfoodfacts.org/data/delta/index.txt.

Each line represents a file that is available at https://static.openfoodfacts.org/data/delta/{filename}.

The filename contains UNIX timestamp of the first and the last change contained in the JSON file, so that the delta files can be imported (after extraction) with mongoimport in alphabetical order.

Please note that due to the nature of mongoexport, the delta files cannot tell you about deleted products. To remove deleted products from your database, you will need to import the full MongoDB dump.

JSONL data export

The whole database is also available in JSONL format (sometimes called LDJSON or NDJSON) where each line is a JSON object. It represents the same data as the MongoDB export. The file is compressed with gzip.

ลิงก์
https://static.openfoodfacts.org/data/openfoodfacts-products.jsonl.gz

A suitable way to exploit the database is to use DuckDB, an in-process analytical tool designed to process large amount of data in a fraction of seconds. You can read our blog post where we walk you through exploring and processing the Open Food Facts database with DuckDB

Parquet Data Export on Hugging Face

A simplified version of the JSONL dump is also available in the Parquet format. During the conversion, we filtered columns that contains duplicated information, are used for internal debugging, or are simply irrelevant for users.

The Parquet format has proved to be handy:

  • Data is organized by column, rather than by row, which saves storage space and speeds up analytics queries, i.e. you can select just the columns you care about, optimizing query performances, even on entry-level computers.
  • Highly efficient data compression and decompression, making it good for storing and sharing big datasets of any kind,
  • Supports complex data types and advanced nested data structures.

The dataset is available on Hugging Face, a collaborative Machine Learning ecosystem where developers and researchers can share models and datasets.

ลิงก์
https://huggingface.co/datasets/openfoodfacts/product-database/resolve/main/food.parquet?download=true

Find more information in the Wiki, including guidelines for data reuse and example queries to get started.

CSV Data Export

Data for all products, or some of the products, can be downloaded in the CSV format (readable with LibreOffice, Excel and many other spreadsheet software) through the advanced search form.

Links
Food: https://static.openfoodfacts.org/data/en.openfoodfacts.org.products.csv.gz (compressed CSV in GZIP format: ~ 0.9 Gb, uncompressed: ~ 9 Gb)
Cosmetics: https://static.openbeautyfacts.org/data/en.openbeautyfacts.org.products.csv.gz
Pet Food: https://static.openpetfoodfacts.org/data/en.openpetfoodfacts.org.products.csv.gz
All other products: https://static.openproductsfacts.org/data/en.openproductsfacts.org.products.csv.gz

The file encoding is Unicode UTF-8. The character that separates fields is <tab> (tabulation).

RDF Data Export

The database is also available in the RDF format (this is an experiment, not actively maintained anymore). You can read the announcement in French.

ลิงก์
https://world.openfoodfacts.org/data/en.openfoodfacts.org.products.rdf.gz

Image Data Export

All images and OCR results can either be downloaded from our server or from AWS (through the AWS Open Data Program). Check out our documentation to learn more about how to download images

OpenAPI Documentation for the JSON API

A JSON API is also available to read the data for a product. This API is in particular used in the Open Food Facts mobile app.

We improve the API over-time but we are careful to keep backwards compatibility. Please get in touch if you use it, so that we can tell you about potential changes.

Discover our API
Digital Commons • Non-Profit NGO

Benefiting from our API? Support the infrastructure that powers your project

Open Food Facts is an independent, non-profit digital commons built for public benefit. We provide our database and API 100% free of charge and open to all, without commercial paywalls or advertising.

Serving millions of real-time queries daily incurs real costs in servers, database clusters, bandwidth, and maintenance. If your application, startup, research project, or company saves time and builds value with our API, please consider supporting Open Food Facts financially. Your contribution keeps our open infrastructure fast, resilient, and freely accessible to everyone worldwide.

Contributing to improving our API and OpenAPI documentation

We're eager to finish the documentation of the API, add use-cases, and automate SDK generation. If you are an OpenAPI connoisseur, you are very welcome to help.

You are very welcome to use the API for production cases, as long as 1 API call = 1 real scan by a user. Any attempt to scrape the database using the API will very likely be blocked, as full daily exports are available on this very page.

Also, sending an HTTP header with your API call is a good way we can get in touch, should any issue arise.

XML API (unsupported)

You can also get the result in XML by using .xml

Example: https://world.openfoodfacts.org/api/v2/product/737628064502.xml

This API is not actively maintained, and not officially documented.

Wrappers and SDKs

We probably have a wrapper for your favorite programming language. If we do, you can use it and improve it. If we don't, you can help create it.

They will let you consume data, as well as let your users contribute new data

General principles to make your users happy

  • You can search for information about products, including many useful computed values.
  • If you can't get the information on a specific product, you can get your user to send photos and data, that will then be processed by Open Food Facts AI and contributors to get the computed result you want to show them.
  • You can also implement the complete flow so that they get immediately the result with some effort on their side.

If your users do not expect a result immediately (e.g. Inventory apps)

  • Submit photos (front/nutrition/ingredients): most painless thing for your users
  • The Open Food Facts AI - Robotoff - will generate some derived data from the photos
  • Over time, other apps, and the Open Food Facts community will fill the data gaps

If your users expect a result immediately (e.g. Nutrition apps)

  • Submit nutrition facts + category > get Nutri-Score
  • Submit ingredients > get the NOVA group (about food ultra-processing), additives, allergens, normalized ingredients, vegan, vegetarian…
  • Submit category + labels > soon get the Eco-Score (about environmental impact)

Android/iPhone/Flutter mobile app

The code for the official Open Food Facts mobile apps is available on GitHub Flutter Kotlin Android Swift iOS

We look to turn the deprecated Kotlin and Swift codebases into Kotlin and Swift SDKs, help welcome :-)

The app allows users to scan the barcode of products, to view the product information, and to take and submit pictures and data for missing products.

You are welcome to reuse the code (it's open source) and help us improve it, for everyone, on all the planet.

SDKs

Icon Language / Framework ทรัพยากร Discussion
Cordova (Old App) GitHub ไม่มีข้อมูล
DART GitHub pub.dev ไม่มีข้อมูล
Elixir GitHub Slack Channel
Go GitHub Slack Channel
Java GitHub Slack Channel
Spring Boot GitHub Slack Channel
Kotlin GitHub Slack Channel
จาวาสคริปต์ GitHub Slack Channel
PHP GitHub Slack Channel
PHP (Laravel) GitHub Slack Channel
Python GitHub Slack Channel
React Native GitHub Slack Channel
Ruby GitHub Slack Channel
สนิม GitHub Slack Channel
R GitHub Slack Channel
Swift GitHub Slack Channel
.NET/C# GitHub Slack Channel

Discussing data, API and exports

You can look at common FAQ questions about the API and Data Exports and common Open Food Facts questions

You can join the Open Food Facts Slack chatroom which is the preferred way to ask questions and discuss the API. Please ask your questions in the #api channel

You can open a thread on our API documentation repository

For any question regarding the data, you can contact us at reuse@openfoodfacts.org