Jump to content

Open Food Facts Search API Version 2: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 26: Line 26:
V1 of the search API is a hack on the web site search form and is accessed by adding &json=1 to the /cgi/search.pl web form.
V1 of the search API is a hack on the web site search form and is accessed by adding &json=1 to the /cgi/search.pl web form.


The new search API introduces 2 new endpoints that mimick the product page endpoints (/product/[barcode] for the Web, and /api/v0/product/[barcode] for the API with JSON results):
The new search API introduces 2 new endpoints that mimics the product page endpoints (/product/[barcode] for the Web, and /api/v0/product/[barcode] for the API with JSON results):


* /search will replace /cgi/search.pl as the url of search results
* /search will replace /cgi/search.pl as the url of search results