Sign in | Sign up

Retrieve full nutrition values

Tagged:

Currently contains 2 posts

Avatar

December 31, 2017 02:19

Sanderhelleso

Hello, I just started using the API and I see that the only nutrient value I can access using the simple search is total fat? Is there a way to access carbohydrate and protein aswell?

Avatar

February 05, 2018 19:48

jawaka72

From what I’ve seen, you need to specify each field you want in the url. for example:
https://api.nutritionix.com/v1_1/search/cookies?resulsts=0:20&fields=item_name,brand_name,item_id,nf_calories,nf_protein,nf_sugars,nf_saturated_fat&appId=MYAPPID&appKey=MYAPPKEY

Calling this url will return a search for cookies with the specified fields. So, it will show, for example, protein and sugars because of the nf_protein,nf_sugars parameters added, but not calcium because it isn’t specified. Here is a list of all the available fields https://docs.google.com/spreadsheets/d/1jZSa039OfpQOiRzaS980nPKCvVe2TRKRPZk7ZbaH7kE/edit#gid=0

As far as I know, you need to specify each one in the url. Hope this helps.

Reply to thread