USDA / USDA-APIs

Do you have feedback, ideas, or questions for USDA APIs? Use this repository's Issue Tracker to join the discussion.
www.usda.gov/developer
110 stars 16 forks source link

looking up a food using fdcID and passing in the nutrientIDs wanted doesn't return the information for the nutrients #128

Closed csstreiser closed 7 months ago

csstreiser commented 7 months ago

https://api.nal.usda.gov/fdc/v1/food/172327?format=full&nutrients=1003&nutrients=1004&nutrients=1005&nutrients=1258&nutrients=1292&nutrients=1293&api_key= I want to get the Proteins, Carbohydrates and Fats for a single food. API definition states you pass in the nutrient ids as a comma delimited list, however the webpage(https://app.swaggerhub.com/apis/fdcnal/food-data_central_api/1.0.1#/FDC/getFoods) when I put in my fdcId #, returns information doesn't have the nutrient information requested for the food. when I just use the fdcId, the nutrientIds that I've listed are in the list, so they should return, correct ?

How is this done ?

csstreiser commented 7 months ago

Figured it out... I was using the wrong number for ID, I was using the value for "id" and it needs to be "number"