6

I am using an API that provides a load of nutritional information for food, for example calories, protein, etc. However what it does not provide is any sort of categorization of that food. Can anyone recommend a database or API, free or paid, that would allow me to match food names to general categories (like meat, fruit, vegetable, etc)? I am thinking if this is not in the food-database related space perhaps it's in some kind of text processing or NLP library I might not be familiar with?

Thanks for any suggestions!

6
  • I assume you're familiar with ndb.nal.usda.gov ?
    – user3856
    Feb 11, 2016 at 20:53
  • @BarryCarter Yes I am. I don't see a food category in the info provided by that API. Am I missing something?
    – helloB
    Feb 11, 2016 at 20:58
  • Page 35 of ars.usda.gov/sp2UserFiles/Place/80400525/Data/SR/SR28/… notes that the "FdGrp_Cd" field should have this value. It also shows up when you do simple web searches. Not sure about their API, but you can download the entire database if desired. directionsforme.org/categories may also help, though you'll have to tweak it some.
    – user3856
    Feb 11, 2016 at 21:05
  • @BarryCarter Wow thanks. I will check the API more carefully. Unfortunately downloading the full database is not an option as this is for a mobile application.
    – helloB
    Feb 11, 2016 at 22:35
  • The db is tiny (I think), fewer than 9000 foods, and you don't need all the tables. github.com/spbriggs/USDA-SR26/tree/master/sr26 may help.
    – user3856
    Feb 11, 2016 at 23:05

1 Answer 1

1

All the information in this answer was provided in the comments section by Barry Carter. I'm just putting it an answer because comments can be arbitrarily deleted and the information lost.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.