Line 1: |
Line 1: |
| [[Category:Developer]] [[Category:API]] | | [[Category:Developer]] [[Category:API]] |
| + | The API (Application Programming Interface) is the way an application can enter in dialogue with Open Food Facts application server. |
| + | |
| + | It can be used to retrieve data (search), read or write information (see disclaimer, in production, this should correspond to a user scan). |
| + | |
| + | ⚠ '''Disclaimer''': |
| + | |
| + | If you are not in a production scenario, think about using the pre-production instance at https://world.openfoodfacts.net. |
| + | |
| + | If you want to use data from open food facts for research, for heavy duty, or to get performance insurance, you may duplicate the database: see https://world.openfoodfacts.org/data |
| + | |
| + | == Search API v2 == |
| + | A new search api (work in progress) is available, which is easier to use. See [[Open Food Facts Search API Version 2]] |
| | | |
| = NEW version of the documentation = | | = NEW version of the documentation = |
Line 64: |
Line 76: |
| * fields that end with a language 2 letter code (e.g. fr for French) is the set of tags in that language | | * fields that end with a language 2 letter code (e.g. fr for French) is the set of tags in that language |
| * fields that end with _100g correspond to the amount of a nutriment (in g) for 100 g or 100 ml of product | | * fields that end with _100g correspond to the amount of a nutriment (in g) for 100 g or 100 ml of product |
| + | * keys must match BSON syntax, and may not contain `.` or `$`. |
| | | |
| === Ready made code you can use in your app === | | === Ready made code you can use in your app === |
Line 82: |
Line 95: |
| * Kotlin (official app) - https://github.com/openfoodfacts/openfoodfacts-androidapp - The official app has recently been Kotlinized. (Help to turn it into a reusable library would be welcome) | | * Kotlin (official app) - https://github.com/openfoodfacts/openfoodfacts-androidapp - The official app has recently been Kotlinized. (Help to turn it into a reusable library would be welcome) |
| * Laravel package - https://github.com/openfoodfacts/openfoodfacts-laravel | | * Laravel package - https://github.com/openfoodfacts/openfoodfacts-laravel |
− | * [[API/Javascript/NodeJS|NodeJS SDK]] | + | * [[API/Javascript/NodeJS|NodeJS SDK]] - https://github.com/openfoodfacts/openfoodfacts-nodejs |
| * [[API/PHP|PHP SDK]] - https://github.com/openfoodfacts/openfoodfacts-php | | * [[API/PHP|PHP SDK]] - https://github.com/openfoodfacts/openfoodfacts-php |
| * [[API/Python|Python SDK]] - https://github.com/openfoodfacts/openfoodfacts-python (LIVE API) - https://github.com/openfoodfacts/OpenFoodFacts-APIRestPython (Local Dump) | | * [[API/Python|Python SDK]] - https://github.com/openfoodfacts/openfoodfacts-python (LIVE API) - https://github.com/openfoodfacts/OpenFoodFacts-APIRestPython (Local Dump) |