Closed teolemon closed 6 years ago
I think the API should take care about the Accept
request header ( for example application/json
instead of using query parameter like json=1
).
Rationale: 10X improvement in performance for the Android Search URL: http://world.openfoodfacts.org/cgi/search.pl?search_terms=nutella&search_simple=1&action=process&jqm=1
Do you have a quick overview on how the output should be formatted and in how far it would be different from ?json=1
?
I think the API should take care about the Accept request header ( for example application/json instead of using query parameter like json=1).
That would be cool, but some other APIs like OpenSearch do depend on different formats being available at different URLs. In general, I do like the "magic" behind content-negotiation, though. :)
The same data as ?jqm=1
but in a json format.
For simple implementation, it could be a ?simple_json=1
parameter
Could the Android app also use the OpenSearch standard (see #605) or is that not enough information?
@hangy do you have any sample of the json output of this api ? don't find any example in #605
There's no JSON, just RSS 2.0 with OpenSearch 1.1, pretty much the same as in the example in the specs.
Ok, so no match our JSON format requirement for the android app
@hangy Here's what the new search looks like (kudos to @herau )
@stephanegigandet @hangy
To sum up:
https://world.openfoodfacts.org/cgi/search.pl?search_terms=nutella&search_simple=1&action=process&jqm=1
product name, brand, quantity, very small front image url
?simple_json=1
It will dramatically speed up search in the new Android version for Open Food Facts and Open Beauty Facts.
barcode, product name, brand, quantity, nutriscore, small front image url
selected_image_status_ingredients, selected_image_status_nutrition, selected_image_status_front
?simple_product_json=1
Maybe we could just add a fields parameters. e.g. &fields=product_name,brands,quantity
More modular. Better. +1 :-)
Added fields parameter, as in the product read API bug #623 :
Rationale: 10X improvement in performance for the Android Search URL: http://world.openfoodfacts.org/cgi/search.pl?search_terms=nutella&search_simple=1&action=process&jqm=1