Jump to content

Open Food Facts Search API Version 2: Difference between revisions

→‎Examples: V1 and V2 of the API
(Adding examples of V2 of the API, clarification of the ongoing support for V1)
(→‎Examples: V1 and V2 of the API)
Line 14: Line 14:
Products from the chocolate category, with both the organic label and the fair trade label:
Products from the chocolate category, with both the organic label and the fair trade label:


* V1:  
* V1: https://world.openfoodfacts.org/cgi/search.pl?action=process&tagtype_0=categories&tag_contains_0=contains&tag_0=chocolates&tagtype_1=labels&tag_contains_1=contains&tag_1=organic&tagtype_2=labels&tag_contains_2=contains&tag_2=fair-trade&json=1 (cannot select the fields returned)
* V2: https://world.openfoodfacts.org/api/v2/search?categories_tags_en=chocolates&labels_tags_en=organic,fair%20trade&fields=code,product_name
* V2: https://world.openfoodfacts.org/api/v2/search?categories_tags_en=chocolates&labels_tags_en=organic,fair%20trade&fields=code,product_name (returns only selected fields)


== Features ==
== Features ==