Closed teolemon closed 6 years ago
Also, being able to disable the debug fields in the full view would be nice. Kind of a verbose option.
Seems very dependent on the usage scenario, what you put in such a json. Otherwise seems a good idea. Is there already a demand?
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
@aleene the demand is for the Quick View mode of the official app. We put basic useful info (nutriscore, product name and brand, small image) as well as info useful to trigger contribution (missing images)
This would also be useful for my website https://www.tacoshell.io
How about this: we add a new optional fields parameter to the read product API, and if specified, we only return fields specified. That way apps can select what they want and only what they want. Trying to find a common compact subset of fields is always going to be too much or too little for some apps.
e.g.
We can do the same for the search API:
I like the idea and can be used for other things as well. Reading on jsons however I got the imprssion that it is a bad habit of leaving fields out. Probably will require additional code for the api user to check if fields are there.
We need a compact version of the product JSON to ensure the mobile app works in poor network conditions and in intensive scanning scenario. Same output as https://github.com/openfoodfacts/openfoodfacts-server/issues/554 (name, brand, weight, very small image resolution url) but as a plus, would it be possible to add the nutriscore to the output. We have a new
Quick view
mode that lets you lookup many products very quickly in a row, showing the Nutriscores, and the result should be instant.