
<h1>Data</h1>

<p>The Open Food Facts database is available under the <a href="https://opendatacommons.org/licenses/odbl/1.0/">Open Database License</a>.<br/>
The individual contents of the database are available under the <a href="https://opendatacommons.org/licenses/dbcl/1.0/">Database Contents License</a>.<br/>
Products images are available under the <a href="https://creativecommons.org/licenses/by-sa/3.0/deed.en">Creative Commons Attribution ShareAlike licence</a>.
They may contain graphical elements subject to copyright or other rights, that may in some cases be reproduced (quotation rights or fair use).</p>

<p>Please read <a href="https://world.openfoodfacts.org/terms-of-use">Terms and conditions of use and re-use</a> before re-using the data.</p>


<p>We are very interested in learning what the Open Food Facts data is used for. It is not mandatory, but we would very much appreciate it if you <a href="mailto:contact@openfoodfacts.org">tell us about your re-uses</a> so that we can share them
with the Open Food Facts community.</p>

<h2>Open Food Facts data exports</h2>

<p>Database dumps and exports are generated nightly.</p>

<p>Information on the different fields for the MongoDB dump and CSV exports is available at <a href="https://static.openfoodfacts.org/data/data-fields.txt">https://world.openfoodfacts.org/data/data-fields.txt</a></p>


<h3>MongoDB dump</h3>

<p>Data for all products is available in a MongoDB database dump.</p>

<dl>
 <dt>Link</dt>
 <dd><a href="https://static.openfoodfacts.org/data/openfoodfacts-mongodbdump.tar.gz">https://static.openfoodfacts.org/data/openfoodfacts-mongodbdump.tar.gz</a></dd>
 <dt>sha256sum</dt>
 <dd><a href="https://static.openfoodfacts.org/data/sha256sum">https://static.openfoodfacts.org/data/sha256sum</a></dd>
 <dt>md5sum</dt>
 <dd><a href="https://static.openfoodfacts.org/data/md5sum">https://static.openfoodfacts.org/data/md5sum</a></dd>
</dl>

<h4>Delta Export</h4>

<p>Daily delta exports are provided for the previous 14 days. The list of currently available delta files can be found at
 <a href="https://static.openfoodfacts.org/data/delta/index.txt">https://static.openfoodfacts.org/data/delta/index.txt</a>.
 Each line represents a file that is available at <code>https://static.openfoodfacts.org/data/delta/{filename}</code>.
 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 <code>mongoimport</code> in alphabetical order.</p>
<p>Please note that due to the nature of <code>mongoexport</code>, 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.</p>

<h3>CSV Data Export</h3>

<p>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 <a href="https://world.openfoodfacts.org/cgi/search.pl">advanced search form</a>.</p>

<dl>
 <dt>Link</dt>
 <dd><a href="https://static.openfoodfacts.org/data/en.openfoodfacts.org.products.csv">https://static.openfoodfacts.org/data/en.openfoodfacts.org.products.csv</a></dd>
</dl>

<p>The file encoding is Unicode UTF-8. The character that separates fields is &lt;tab&gt; (tabulation).</p>



<h3>RDF Data Export</h3>

<p>The database is also available in the RDF format. <a href="https://fr.blog.openfoodfacts.org/news/des-donnees-libres-et-liees-export-rdf-des-donnees">announcement in French</a>.</p>

<dl>
 <dt>Link</dt>
 <dd><a href="https://world.openfoodfacts.org/data/en.openfoodfacts.org.products.rdf">https://world.openfoodfacts.org/data/en.openfoodfacts.org.products.rdf</a></dd>
</dl>

<h2>Live JSON API</h2>

<p>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 for iPhone and Android.</p>

<p>We change the API over-time but we are careful to keep backwards compatibility. Please tell us if you use it, so that we can tell you about potential changes.</p>

<p>URL to read data for a product: https://world.openfoodfacts.org/api/v0/product/<em>[barcode]</em>.json</p>

<p>Example: <a href="https://world.openfoodfacts.org/api/v0/product/737628064502.json">https://world.openfoodfacts.org/api/v0/product/737628064502.json</a></p>

Further documentation is <a href="https://wiki.openfoodfacts.org/API">available on the Wiki</a>. (Important note: the page is divided into subpages for READ and WRITE).
A better documentation is being developped, with uses cases for displaying a product, and letting your users add the data required to get the Nutri-Score, NOVA groups and additives.
<a href="https://documenter.getpostman.com/view/8470508/SVtN3Wzy?version=latest#intro">You can access it here</a>.
<p>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.</p>
<p>Also, sending an HTTP header with your API call is a good way we can get in touch, should any issue arise.</p>
<p>If you are unsure about anything, or have any question (there is no silly question), feel free to ask it on Slack :-)</p>

<h2>Android and iPhone mobile app</h2>

<p>The code for the Open Food Facts mobile app is available on GitHub (<a href="https://github.com/openfoodfacts/openfoodfacts-androidapp">Android</a> and <a href="https://github.com/openfoodfacts/openfoodfacts-ios">iOS</a>).
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.</p>

<p>The app for iOS is developed in Swift.</p>
<p>The app for Android is developed in Java.</p>
<p>You are welcome to reuse the code (it's open source) and help us improve it, for everyone, on all the planet.

<h2>Wrappers and SDKs</h2>
<p>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.</p>
<p>They will let you consume data, as well as let your users contribute new data</p>
<ul>
<li>Cordova: <a href="https://github.com/openfoodfacts/openfoodfacts-cordova-app">GitHub (old Open Food Facts official app)</a></li>
<li>DART: <a href="https://github.com/openfoodfacts/openfoodfacts-dart">GitHub</a></li>
<li>Elixir: <a href="https://github.com/openfoodfacts/openfoodfacts-elixir">GitHub</a></li>
<li>Go: <a href="https://github.com/openfoodfacts/openfoodfacts-go">GitHub</a></li>
<li>NodeJS: <a href="https://github.com/openfoodfacts/openfoodfacts-nodejs">GitHub</a></li>
<li>PHP: <a href="https://github.com/openfoodfacts/openfoodfacts-php">GitHub</a></li>
<li>PHP (Lararel): <a href="https://github.com/openfoodfacts/openfoodfacts-laravel">GitHub</a></li>
<li>Python: <a href="https://github.com/openfoodfacts/openfoodfacts-python">GitHub</a></li>
<li>React Native: <a href="https://github.com/openfoodfacts/openfoodfacts-react-native">GitHub</a></li>
<li>Ruby: <a href="https://github.com/openfoodfacts/openfoodfacts-ruby">GitHub</a></li>
</ul>

<h2>Discussing data, API and exports</h2>
<p>You can <a href="https://slack.openfoodfacts.org">join the Open Food Facts Slack chatroom which is the preferred way to ask questions and discuss the API</a>.</p>

<p>You can also join the mailing list to discuss the API and exports, tell us about your re-uses, and be notified when improvements or changes are made to the API. Send an empty e-mail to
<a href="mailto:api-subscribe@openfoodfacts.org">api-subscribe@openfoodfacts.org</a> to subscribe.</p>


<h2>Contact</h2>

<p>For any question regarding the data, you can contact us at <a href="mailto:contact@openfoodfacts.org">contact@openfoodfacts.org</a>
