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 24: |
Line 25: |
| === Getting help with the API === | | === Getting help with the API === |
| You can ask for help on using the API in the [https://openfoodfacts.slack.com/messages/api/ #api channel on Slack]. Join us to discuss your use case and get help/code from other devs. | | You can ask for help on using the API in the [https://openfoodfacts.slack.com/messages/api/ #api channel on Slack]. Join us to discuss your use case and get help/code from other devs. |
− |
| |
| | | |
| == 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 57: |
Line 56: |
| * 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 64: |
Line 65: |
| * [[API/Go|Go SDK]] - https://github.com/openfoodfacts/openfoodfacts-go | | * [[API/Go|Go SDK]] - https://github.com/openfoodfacts/openfoodfacts-go |
| * [[API/Java|Java SDK]] | | * [[API/Java|Java SDK]] |
− | * [[API/Javascript|JS SDK]] | + | * [[API/Javascript|JavaScript SDK]] |
| * [[API/Javascript/NodeJS|NodeJS SDK]] | | * [[API/Javascript/NodeJS|NodeJS SDK]] |
| * [[API/Perl|Perl SDK]] | | * [[API/Perl|Perl SDK]] |
Line 70: |
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]] |
| * [[API/Swift|Swift SDK]] | | * [[API/Swift|Swift SDK]] |
| Please help us bring Open Food Facts to your favorite language by contributing to SDK! | | Please help us bring Open Food Facts to your favorite language by contributing to SDK! |
− |
| |
| | | |
| == Licence == | | == Licence == |
Line 82: |
Line 83: |
| * Share any additions under the OdBL, back to the community. | | * Share any additions under the OdBL, back to the community. |
| Please join us on the Slack channel to discuss the legal and technical side of things :-) (https://slack.openfoodfacts.org) | | Please join us on the Slack channel to discuss the legal and technical side of things :-) (https://slack.openfoodfacts.org) |
− |
| |
| | | |
| == Roadmap == | | == Roadmap == |
| [[API/Roadmap]] | | [[API/Roadmap]] |
− |
| |
| | | |
| == Bugs == | | == Bugs == |
Line 92: |
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 |
| * 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 |
− |
| |
| | | |
| == Sister projects == | | == Sister projects == |