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

Draft Food Data Central Endpoints #80

Open littlebunch opened 4 years ago

littlebunch commented 4 years ago

Here's a working draft of new endpoints for the Food Data Central API. You can review it by unzipping and importing into your favorite Openapi 3.0 editor, e.g. https://editor.swagger.io. Your comments are welcome!

fdc-openapi.yaml.zip

BashfulBandit commented 4 years ago

@littlebunch Is there a more up to date OpenApi 3.0 file you have available for the Food Data Central Endpoints? It appears the one posted here is out of date.

littlebunch commented 4 years ago

@BashfulBandit Here is the most recent proposed fdc_oapi_20200206.yaml.zip

spec from which the developers are working. The spec is not yet implemented so the "Try it out" buttons will not work.

BashfulBandit commented 4 years ago

I guess I am a little confused. Forgive me for my ignorance. I stumbled across this API while working on a personal project for a website, which required gathering nutritional data. I have been reading through the API Guide found here. This guide documents two API endpoints, https://api.nal.usda.gov/fdc/v1/search?api_key=<API_KEY> and https://api.nal.usda.gov/fdc/v1/<FDC_ID>?api_key=<API_KEY>. These endpoints are very different from the endpoints documented in the yml file you shared. Are you saying these endpoints documented in the API Guide are going to be changing in the near future?

littlebunch commented 4 years ago

@BashfulBandit The FDC API replaces the NDB API which people have been using for a good number of years. FDC has more and better data. Unfortunately, the FDC API introduces some serious breakage for NDB API users mostly because of the data.

The 2 endpoints currently available will remain pretty much as they are now except with the addition of a couple of parameters, e.g. format. The new endpoints will attempt to provide some of the functionality, such as the ability to return multiple foods in one call and the ability to browse lists of foods, that was available in the NDB API.

If you are anyone else would like to see additional features then now is a good time to bring it up. HTH.