Dữ liệu
Conditions for reuse
Cơ sở dữ liệu của Open Food Facts có sẵn theo Giấy phép Open Database License.
Các nội dung riêng lẻ của cơ sở dữ liệu có sẵn theo Giấy phép Database Contents License.
Các hình ảnh Sản phẩm có sẵn theo giấy phép Creative Commons Attribution ShareAlike.
Các dữ liệu có thể chứa các yếu tố đồ họa tuân theo bản quyền hoặc các quyền khác, trong một số trường hợp có thể là được sao chép lại (quyền trích dẫn hoặc sử dụng hợp pháp).
Vui lòng đọc Điều khoản và điều kiện sử dụng và sử dụng lại trước khi sử dụng lại dữ liệu.
Tell us about your reuse
Chúng tôi rất quan tâm đến việc tìm hiểu mục đích sử dụng dữ liệu từ 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.
Xuất dữ liệu từ Open Food Facts
Kết xuất và xuất cơ sở dữ liệu được tạo hàng đêm. The database is very big, so you can find different ways to use the data, depending on the export flavor.
Thông tin về các trường khác nhau cho kết xuất MongoDB và xuất CSV có sẵn tại https://world.openfoodfacts.org/data/data-fields.txt
Kết xuất MongoDB
Dữ liệu cho tất cả các sản phẩm có sẵn trong kết xuất cơ sở dữ liệu MongoDB.
- Liên kết
- https://static.openfoodfacts.org/data/openfoodfacts-mongodbdump.gz
- sha256sum
- https://static.openfoodfacts.org/data/gz-sha256sum
- md5sum
- https://static.openfoodfacts.org/data/gz-md5sum
Xuất dữ liệu kiểu Delta
Xuất dữ liệu delta hàng ngày được cung cấp cho dữ liễu trong vòng 14 ngày trước đó. The list of currently available delta files can be found at https://static.openfoodfacts.org/data/delta/index.txt.
Mỗi dòng đại diện cho một tệp có sẵn tại 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.
Xin lưu ý rằng do bản chất của mongoexport
, các tệp delta không thể lưu trữ thông tin về các sản phẩm đã bị xóa. To remove deleted products from your database, you will need to import the full MongoDB dump.
Xuất dữ liệu JSONL
Toàn bộ cơ sở dữ liệu cũng có sẵn ở định dạng JSONL (đôi khi được gọi là LDJSON hoặc NDJSON) trong đó mỗi dòng là một đối tượng JSON. Nó đại diện cho dữ liệu giống như xuất MongoDB. Tệp được nén dạng file gzip.
Xuất dữ liệu CSV
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.
- Liên kết
- https://static.openfoodfacts.org/data/en.openfoodfacts.org.products.csv.gz (compressed CSV in GZIP format: ~ 0.9 Gb, uncompressed: ~ 9 Gb)
Tệp mã hóa dưới dạng Unicode UTF-8. Ký tự ngăn cách các trường là <tab> (lập bảng).
Xuất dữ liệu RDF
Cơ sở dữ liệu cũng có sẵn ở định dạng RDF. You can read the announcement in French.
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
API JSON cũng có sẵn để đọc dữ liệu cho một sản phẩm. API này đặc biệt được sử dụng trong ứng dụng di động Open Food Facts dành cho iPhone và Android.
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.
URL để đọc dữ liệu sản phẩm: https://world.openfoodfacts.org/api/v2/product/[barcode].json
Example: https://world.openfoodfacts.org/api/v3/product/737628064502.json
Note that if the output is too overwhelming, you can filter it - as described in the API documentation.
OpenAPI help wanted
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.Chúng tôi rất hoan nghênh bạn sử dụng API cho các trường hợp sản xuất, miễn là 1 lần gọi API = 1 lần quét thực bởi người dùng. Bất kỳ nỗ lực nào để loại bỏ cơ sở dữ liệu bằng cách sử dụng API sẽ rất có thể bị chặn, vì các bản xuất hàng ngày đầy đủ luôn có sẵn trên chính trang này.
Ngoài ra, gửi tiêu đề HTTP với lệnh gọi API của bạn là một cách tốt để chúng tôi có thể liên hệ, nếu có bất kỳ vấn đề nào phát sinh.
If you are unsure about anything, or have any question (there is no silly question), feel free to ask it on the #api channel on Slack :-)
Experimental XML API
You can also get the result in XML by using .xml
Ví dụ: https://world.openfoodfacts.org/api/v2/product/737628064502.xml
This API is not actively maintained, and not officially documented.Wrappers và SDKs
Chúng tôi có thể cung cấp wrapper cho ngôn ngữ lập trình yêu thích của bạn. Nếu có nó, bạn có thể sử dụng và cải thiện nó. Nếu chúng tôi không thể cung cấp, bạn có thể giúp tạo mới.
Chúng sẽ cho phép bạn sử dụng dữ liệu cũng như cho phép người dùng của bạn đóng góp dữ liệu mới
General principles to make your users happy
- You can search for information about products, including many useful computed values.
- Nếu bạn không thể lấy thông tin về một sản phẩm cụ thể, bạn có thể yêu cầu người dùng gửi ảnh và dữ liệu sẽ được xử lý bởi Open Food Facts AI và những người đóng góp để có được kết quả tính toán mà bạn muốn cho họ xem.
- Bạn cũng có thể thực hiện quy trình hoàn chỉnh để họ nhận được kết quả ngay lập tức với một vài thao tác.
Nếu người dùng của bạn cần kết quả ngay lập tức (ví dụ: các ứng dụng kho vận)
- 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
- Theo thời gian, các ứng dụng khác và cộng đồng Open Food Facts sẽ bổ sung các khoảng trống dữ liệu
Nếu người dùng của bạn cần kết quả ngay lập tức (ví dụ: ứng dụng Dinh dưỡng)
- 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.
Bạn có thể sử dụng lại mã (mã nguồn mở) và giúp chúng tôi cải thiện nó, cho mọi người, trên toàn cầu.
SDKs
- Cordova: GitHub (ứng dụng Open Food Facts chính thức cũ)
- DART: GitHub - Gói trên pub.dev
- Elixir: GitHub - Discussion channel
- Go: GitHub - Discussion channel
- Java: GitHub - Discussion channel
- Kotlin: GitHub - Discussion channel
- NodeJS: GitHub - Discussion channel
- PHP: GitHub - Discussion channel
- PHP (Laravel): GitHub - Discussion channel
- Python: GitHub - Discussion channel
- React Native: GitHub - Discussion channel
- Ruby: GitHub - Discussion channel
- Rust: GitHub - Discussion channel
Thảo luận về dữ liệu, API và xuất dữ liệu
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