Line 3: |
Line 3: |
| == Introduction == | | == Introduction == |
| === Notice for API users === | | === Notice for API users === |
− | <span style="color:#d33">'''If you need all the database, download it directly from the data page, do ''NOT'' scrape the API'''</span> | + | # <span style="color:#d33">'''If you need all the database, download it directly from the data page, do ''NOT'' scrape the API'''</span> |
| + | # Please tell us (contact@openfoodfacts.org or in the #API channel) what you build with the API, it's always great to see new reuses come to life :-) |
| | | |
| === Before using the API === | | === Before using the API === |
Line 10: |
Line 11: |
| * When doing averages, computations… filter incomplete products to avoid issues | | * When doing averages, computations… filter incomplete products to avoid issues |
| * Assume the data is not reliable until the product is marked as complete. | | * Assume the data is not reliable until the product is marked as complete. |
− | * '''In general, ensure the user exercises maintains caution (for allergens…) and be upfront about possible risks.''' | + | * '''In general, ensure the user exercises caution (for allergens…) and be upfront about possible risks.''' |
| * <span style="color:#d33">'''By using any part of the API you have read and understood the [[#License|license]].'''</span> | | * <span style="color:#d33">'''By using any part of the API you have read and understood the [[#License|license]].'''</span> |
| | | |
Line 26: |
Line 27: |
| | | |
| == READ operations == | | == READ operations == |
− | For more details please look at [[API/Read]] | + | For more information, see [[API/Read]] |
| | | |
| === Technical details === | | === Technical details === |
− | * You can do READ operations using production server. | + | * You can do READ operations using the production server. |
| * You should use the SSL version of the API. <code>https://world.openfoodfacts.org</code> | | * You should use the SSL version of the API. <code>https://world.openfoodfacts.org</code> |
− | * '''Please send a UserAgent HTTP Header''' with the name of the app/service querying, the version, system and an URL if you have one, so that you are not blocked by mistake (e.g. <code>UserAgent: CoolFoodApp - Android - Version 1.0 - https://coolfoodapp.com</code>) | + | * '''Please send a UserAgent HTTP Header''' with the name of the app/service querying, the version, system and a URL if you have one, so that you are not blocked by mistake (e.g. <code>UserAgent: CoolFoodApp - Android - Version 1.0 - https://coolfoodapp.com</code>) |
| | | |
| == WRITE operations == | | == WRITE operations == |
− | Please look at [[API/Write]]
| + | For more information, see [[API/Write]] |
| | | |
| === Use cases === | | === Use cases === |
− | * You can add photos and informations to Open Food Facts using the API. | + | * You can add photos and information to Open Food Facts using the API. |
| ** Letting your users add new products by uploading photos is the most common use case. | | ** Letting your users add new products by uploading photos is the most common use case. |
| ** Several apps already enable more advanced editing. Gamification would be welcome. | | ** Several apps already enable more advanced editing. Gamification would be welcome. |
Line 54: |
Line 55: |
| * 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 |
| + | |
| + | === Ready made code you can use in your app === |
| + | React Native: https://github.com/openfoodfacts/openfoodfacts-react-native |
| | | |
| == SDKs == | | == SDKs == |
Line 67: |
Line 71: |
| * [[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) |
| * [[API/R|R SDK]] | | * [[API/R|R SDK]] |
| + | * [[API/React Native|React Native SDK]] https://github.com/openfoodfacts/openfoodfacts-react-native |
| * [[API/Ruby|Ruby SDK]] - https://github.com/openfoodfacts/openfoodfacts-ruby OR gem install openfoodfacts - https://github.com/openfoodfacts/openbeautyfacts-ruby OR gem install openbeautyfacts | | * [[API/Ruby|Ruby SDK]] - https://github.com/openfoodfacts/openfoodfacts-ruby OR gem install openfoodfacts - https://github.com/openfoodfacts/openbeautyfacts-ruby OR gem install openbeautyfacts |
| * [[API/Scala|Scala SDK]] | | * [[API/Scala|Scala SDK]] |
Line 86: |
Line 91: |
| Do not hesitate to file a bug if you find an issue in the API, or need an improvement! | | Do not hesitate to file a bug if you find an issue in the API, or need an improvement! |
| | | |
− | You can fill in the issue report[https://github.com/openfoodfacts/openfoodfacts-server/issues/new here on GitHub] | + | You can fill in the issue report [https://github.com/openfoodfacts/openfoodfacts-server/issues/new here on GitHub] |
| + | |
| === Known bugs === | | === Known bugs === |
| * General bugs: https://github.com/openfoodfacts/openfoodfacts-server/issues | | * General bugs: https://github.com/openfoodfacts/openfoodfacts-server/issues |