# USDA FoodData Central API

Category: [Food and drink](https://free-web-services.com/web-services/other/food/)  
Page: https://free-web-services.com/web-services/other/food/usda-fooddata-central-api.html  
Documentation: https://fdc.nal.usda.gov/api-guide/

The FoodData Central API from the US Department of Agriculture gives nutrient data for basic foods, survey foods and branded products, for example to count the calories in a recipe or look up a packaged food. Search foods by keyword or fetch them by FDC ID and get JSON. Free with a free data.gov API key, with a default limit of 1,000 requests per hour per IP address. The data is public domain (CC0 1.0), and the USDA asks to be named as the source.

- API key: Needed, free
- Pricing: Free with a free data.gov API key, with a default limit of 1,000 requests per hour per IP address.
- Commercial use: Allowed on the free plan
- From the browser: Yes (CORS)
- Formats: JSON
- Interface: REST, HTTP-GET
- Provider: fdc.nal.usda.gov

Example request:

```sh
curl 'https://api.nal.usda.gov/fdc/v1/foods/search?query=apple&pageSize=1&api_key=YOUR_API_KEY'
```

Replace YOUR_API_KEY with your own key. The JavaScript works in a web page as well as in Node.js 18 or newer.

