api-documentation icon indicating copy to clipboard operation
api-documentation copied to clipboard

Question about search & fields parameters

Open kevinmarrec opened this issue 1 year ago • 0 comments

Hi, I'm trying to do 2 things which I'm not sure if it's already implemented :) :

  • If we need to find a product by name/term, is there a way to use /api/v2 ? The only way I found is using this one : https://fr.openfoodfacts.org/cgi/search.pl?search_terms=milk&json=1&fields=code,product_name

  • Can we select subfields ? https://fr.openfoodfacts.org/api/v2/product/80135463&fields=nutriments (Will return only nutriments) https://fr.openfoodfacts.org/api/v2/product/80135463&fields=nutriments.carbohydrates (Could we implement this or does something already exist to achieve this ? It would only keep carbohydrates within nutriments object in the JSON)

kevinmarrec avatar Jul 13 '22 16:07 kevinmarrec