Focus on Research & Community

Open Food Facts Days 2026

Fri 13th – Sat 14th November
Paris, France

Register here

数据

重用数据条款

The Open Products Facts database is available under the Open Database License (ODbL).
The individual contents of the database are available under the Database Contents License (DbCL).
Products images are available under the Creative Commons Attribution ShareAlike licence (CC-BY-SA). 它们可能包含受版权或其他权利保护的图形元素,在某些情况下可以复制(引用权或合理使用)。

Please read Terms and conditions of use and re-use before re-using the data.

Simplified ODbL summary

This is a human-readable summary of the ODbL 1.0 license (see also the Open Data Commons summary):

You are free:

  • To share: To copy, distribute and use the database.
  • To create: To produce works (such as applications, websites, services, or analytical studies) from the database.
  • To adapt: To modify, transform and build upon the database.

As long as you:

  • Attribute: You must attribute any public use of the database, or works produced from the database, in the manner specified in the ODbL (e.g. "Contains data from Open Products Facts, available under the Open Database License"). For any redistribution of the database, or works produced from it, you must make clear to others the license of the database and keep intact any notices on the original database.
  • Share-Alike: If you publicly use any adapted version of this database, or works produced from an adapted database, you must also offer that adapted database under the ODbL and share your modifications back.
  • Keep open: If you redistribute the database, or an adapted version of it, you may use technological measures that restrict the work (such as DRM) only as long as you also redistribute a version without such measures.

Be on the legal side: The technical route to compliance

We want everyone to succeed with their projects while keeping data open for everyone! To ensure your application or reuse complies with the license and our infrastructure policies, please follow this technical checklist (see also our license compliance tutorial):

  • 重用数据条款
  • Use bulk exports for offline, analytical, or caching needs: If you need access to all products or want to run complex queries, please download the nightly MongoDB dumps, CSV, or Parquet exports (described below) or build a local cache.
  • Contribute back (Share-Alike in practice): In the spirit of the ODbL Share-Alike obligation, if your app allows users to add new products, update nutrition/ingredients, or submit photos, please send those contributions back to Open Products Facts via our API or SDKs. This ensures everyone benefits from continuous data improvements.
  • Prominent UI attribution: Clearly attribute Open Products Facts in your app or website UI (for example, on product pages, search screens, and in the "About" or "Settings" sections) with clickable links back to Open Products Facts and the ODbL license.

Compliance resources:

告诉我们您使用我们数据的情况

We are very interested in learning what the Open Products Facts data is used for. 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 Products Facts community. We are very interested in learning what the Open Products Facts data is used for. 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 Products Facts community. 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 Products Facts community. You can also fill this form to get a chance to get your app featured. 您还可以 填写此表格 以获得让您的应用获得推荐的机会。

Open Products Facts data exports

数据库转储和导出每晚生成。数据库非常大,因此您可以找到 多种不同的方式来使用数据,具体取决于导出风格。

Information on the different fields for the MongoDB dump and CSV exports is available at https://world.openproductsfacts.org/data/data-fields.txt

MongoDB 转储

所有产品的数据都可以在 MongoDB 数据库转储中找到。

链接
https://static.openproductsfacts.org/data/openproductsfacts-mongodbdump.gz
SHA256 校验和
https://static.openproductsfacts.org/data/gz-sha256sum
MD5 校验和
https://static.openproductsfacts.org/data/gz-md5sum

Delta Export

提供前 14 天的每日增量导出数据。 The list of currently available delta files can be found at https://static.openproductsfacts.org/data/delta/index.txt.

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

文件名包含 JSON 文件中第一个和最后一个更改的 UNIX 时间戳,以便可以按字母顺序使用 mongoimport 导入增量文件(提取后)。

请注意,由于 mongoexport的性质,增量文件无法告诉您有关已删除产品的信息。要从数据库中删除已删除的产品,您需要导入完整的 MongoDB 转储。

JSONL 数据导出

整个数据库也可以采用 JSONL 格式 (有时称为 LDJSON 或 NDJSON),其中每一行都是一个 JSON 对象。它代表与 MongoDB 导出相同的数据。该文件使用 gzip 压缩。

链接
https://static.openproductsfacts.org/data/openproductsfacts-products.jsonl.gz

利用数据库的一个合适方法是使用 DuckDB,这是一种旨在在几分之一秒内处理大量数据的进程内分析工具。 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 Products Facts database with DuckDB

Hugging Face 上的 Parquet 格式数据导出

JSONL 转储的简化版本也可在 Parquet 格式中使用。在转换过程中,我们过滤掉了包含重复信息、用于内部调试或与用户无关的列。

Parquet 格式已被证明非常方便:

  • 数据是按列而不是按行组织,这样一来能节省储存空间并加快分析查询速度。换言之即使您只选择您关心的列,从而优化查询性能,即使在入门级电脑上也是如此。
  • 高效的数据压缩和解压缩,使得它非常适合存储和共享任何类型的大数据集,
  • 支持复杂数据类型和高级嵌套数据结构。

该数据集在 Hugging Face上可得,这是一个协作式机器学习生态系统,开发人员和研究人员可以在其中共享模型和数据集。

链接
https://huggingface.co/datasets/openfoodfacts/product-database/resolve/main/food.parquet?download=true

在维基中找到更多信息,包括数据复用指南和入门示例查询。

CSV 数据导出

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

链接
https://static.openproductsfacts.org/data/en.openproductsfacts.org.products.csv.gz (compressed CSV in GZIP format: ~ 0.9 Gb, uncompressed: ~ 9 Gb)

文件编码为Unicode UTF-8。分隔字段的字符是 <tab> (制表符)。

RDF数据导出

The database is also available in the RDF format. 您可以用法语阅读公告。

链接
https://world.openproductsfacts.org/data/en.openproductsfacts.org.products.rdf.gz

图像数据导出

所有图像和 OCR 结果都可以从我们的服务器或 AWS(通过 AWS 开放数据计划)下载。查看 我们的文档 以了解有关如何下载图像的更多信息。

实时 JSON 和 XML API

JSON API 也可用于读取产品数据。 This API is in particular used in the Open Products Facts mobile app for iPhone and Android.

我们会不断改进 API,但我们会小心保持旧版本兼容性。 Please get in touch if you use it, so that we can tell you about potential changes.

URL to read data for a product: https://world.openproductsfacts.org/api/v2/product/[barcode].json

Example: https://world.openproductsfacts.org/api/v2/product/8710847992063.json

请注意,如果输出太多,您可以对其进行过滤 - 按照 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.

寻求有关 OpenAPI 的帮助

我们渴望完成 API 的文档、添加用例并自动化 SDK 生成。如果您对 OpenAPI 十分了解,我们需要您的协助。

非常欢迎您将 API 用于生产案例,只要 1 次 API 调用 = 用户进行 1 次真实数据请求。 任何使用 API 抓取数据库的尝试都很可能被阻止,因为完整的每日导出数据就在这个页面上提供。

此外,如果出现任何问题,在 API 调用中发送您的 HTTP 标头是与我们联系的好方法。

如果您对任何事情不确定,或者有任何疑问(请大胆提问),请随时在 Slack 上的 #api 频道上提问 :-)

实验性 XML API

您还可以使用 .xml以 XML 格式获取结果

API V1- Old documentation available on the Wiki (Important note: the page is divided into subpages for READ and WRITE).

此 API 并未得到积极维护,也没有官方文档。

包装器和 SDK

我们可能有您最喜欢的编程语言的包装器。请尽量使用并改进它。如果你没有找到,你也可以帮助创建它。

它们不仅能让你消费数据,还能让你的用户贡献新数据

让用户满意的一般原则

  • 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 Products 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.

如果您的用户不期望立即获得结果(例如库存应用程序)

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

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

  • 提交成分 + 类别,然后获取成分分析、添加剂、过敏原、标准化成分、纯素食、素食等信息
  • 提交标签和它对应的内容
  • Submit nutrition

Android 和 iPhone 移动应用程序

The code for the Open Products Facts mobile app currently deployed is available on GitHub (Android. We need help to adapt the new Flutter code to cosmetics The app allows users to scan the barcode of products, to view the product information, and to take and send pictures and data for missing products.

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

该应用程序允许用户扫描产品的条形码,查看产品信息,以及拍摄和提交缺失产品的图片和数据。

欢迎您复用代码(它是开源的)并帮助我们改进它,造福地球上的每个人。

SDK(开发套件)

图标 语言/框架 参考资源 讨论
Cordova(旧应用程序) GitHub 不适用
DART GitHub pub.dev 不适用
Elixir GitHub Slack 频道
Go GitHub Slack 频道
Java GitHub Slack 频道
Spring Boot GitHub Slack 频道
Kotlin GitHub Slack 频道
JavaScript GitHub Slack 频道
PHP GitHub Slack 频道
PHP(Laravel) GitHub Slack 频道
Python GitHub Slack 频道
React Native GitHub Slack 频道
Ruby GitHub Slack 频道
赤色 GitHub Slack 频道
R GitHub Slack 频道
Swift GitHub Slack 频道
.NET/C# GitHub Slack 频道

讨论数据、API 和导出

您可以查看 有关 API 和数据导出的常见问题 和 常见的 Open Food Facts 问题

You can join the Open Products Facts Slack chatroom which is the preferred way to ask questions and discuss the API. Please ask your questions in the #api channel 请 在#api 频道中提出您的问题 请 在#api 频道中提出您的问题请 在#api 频道中提出您的问题

You can open a thread on our API documentation repository

如对数据有任何疑问,请联系我们 reuse@openfoodfacts.org