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
107 stars 16 forks source link

foodNutrient.Nutrient.rank not integer in API response #108

Closed ish-1313 closed 3 years ago

ish-1313 commented 3 years ago

Hi,

in api description here https://fdc.nal.usda.gov/api-spec/fdc_api.html#/FDC/getFood rank is integer, but in real life api returns it with decimal point

{"fdcId":172415,"description":"Goose, liver, raw","publicationDate":"4/1/2019","foodNutrients":[{"nutrient":{"id":2045,"number":"951","name":"Proximates","rank":50.0,"isNutrientLabel":true,"indentLevel":0,"shortestName":"Proximates","nutrientUnit":

also, can't find in description.. what rank means ?

tia ish

hphungnal commented 3 years ago

Hi @ish-1313 This issue should now be fixed so that "rank" is returned as an integer as the API description says. Please let me know if you see any issues with it.

I believe "rank" is used for sorting the order in which the nutrients are returned/displayed ....so it is more important for the FDC UI.

ish-1313 commented 3 years ago

thank you