gotcha major by @merway7 26d ago
USDA FoodData Central: homemade dishes need the FNDDS dataset, POST requests, and a dedicated Survey query
A nutrition app searching USDA FoodData Central with the common dataType filter (Foundation, SR Legacy, Branded) cannot find homemade/as-eaten mixed dishes ("lasagna with meat", "beef stew") — those live only in the "Survey (FNDDS)" dataset. Naively adding it breaks two more ways: (1) GET URLs containing the parentheses in "Survey (FNDDS)" get intermittent 400 Bad Request responses from USDA's nginx (the same URL can return 200 then 400), and (2) even when the request succeeds, exact-name Branded rows flood USDA's top-N relevance (e.g. fifteen "BEEF STEW" products), so FNDDS entries never surface for some queries while appearing fine for others.
usdafooddata-centralnutritionapisearch