Difference between revisions of "API/Python"

From Open Food Facts wiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
== Online API==
 
== Online API==
=== Source code ===
+
https://github.com/openfoodfacts/openfoodfacts-python
=== How to install ===
+
This has recently been enriched using code from Robotoff.
=== How to use ===
+
== Offline API (proxy)==
== Offline API==
 
 
=== Source code ===
 
=== Source code ===
 
https://github.com/openfoodfacts/OpenFoodFacts-APIRestPython
 
https://github.com/openfoodfacts/OpenFoodFacts-APIRestPython
=== How to install ===
 
* Install python 3
 
* Install mongodb
 
* Install pip
 
* Install requirements : $ pip install -r requirements.txt
 
* Download the database from : http://world.openfoodfacts.org/data/openfoodfacts-mongodbdump.tar.gz
 
* Import to local mongodb : $ mongorestore -d off -c products /foldertobsonfile/products.bson
 
* Launch api : $ python3 runApiRESTServer.py
 
* That's all !
 
 
=== How to use ===
 
=== How to use ===
 
[[Category:API]]
 
[[Category:API]]

Latest revision as of 14:35, 5 September 2023

Documentation of the Python bindings

Online API

https://github.com/openfoodfacts/openfoodfacts-python This has recently been enriched using code from Robotoff.

Offline API (proxy)

Source code

https://github.com/openfoodfacts/OpenFoodFacts-APIRestPython

How to use