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 = |
| | | |
| The new version of the documentation is available here: | | The new version of the documentation is available here: |
− | * [https://world.openfoodfacts.org/files/api-documentation.html Documentation as HTML on Open Food Facts' servers] | + | * [https://openfoodfacts.github.io/api-documentation Latest version of the documentation] |
− | * [https://documenter.getpostman.com/view/8470508/SVtN3Wzy Documentation on Postman] (might be slow)
| |
| | | |
| We have many SDKs at the bottom of the page, and we also have official implementations for Android, iPhone (and Flutter) that you can draw inspiration from. | | We have many SDKs at the bottom of the page, and we also have official implementations for Android, iPhone (and Flutter) that you can draw inspiration from. |
Line 65: |
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 77: |
Line 89: |
| * C# SDK - https://github.com/Albert-Le5/openfoodfacts-csharp ; https://github.com/aberteau/OpenFoodFacts4Net | | * C# SDK - https://github.com/Albert-Le5/openfoodfacts-csharp ; https://github.com/aberteau/OpenFoodFacts4Net |
| * [[API/Go|Go SDK]] - https://github.com/openfoodfacts/openfoodfacts-go | | * [[API/Go|Go SDK]] - https://github.com/openfoodfacts/openfoodfacts-go |
− | * [[API/Java|Java SDK]] - The official app used to be coded in Java. Extraction into a Java library would be welcome. | + | * [[API/Java|Java SDK]] - https://github.com/openfoodfacts/openfoodfacts-java |
| * [[API/Javascript|JavaScript SDK]] - We don't have a vanilla Javascript SDK right now | | * [[API/Javascript|JavaScript SDK]] - We don't have a vanilla Javascript SDK right now |
| * Dart - https://github.com/openfoodfacts/openfoodfacts-dart | | * Dart - https://github.com/openfoodfacts/openfoodfacts-dart |
Line 83: |
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) |
Line 123: |
Line 135: |
| * API bugs: https://github.com/openfoodfacts/openfoodfacts-server/labels/api | | * API bugs: https://github.com/openfoodfacts/openfoodfacts-server/labels/api |
| * API milestone: https://github.com/openfoodfacts/openfoodfacts-server/milestone/8 | | * API milestone: https://github.com/openfoodfacts/openfoodfacts-server/milestone/8 |
| + | |
| + | === Yet-Undocumented APIs === |
| + | * https://github.com/openfoodfacts/api-documentation |
| | | |
| == Sister projects == | | == Sister projects == |