Agricultural Research Service
United States Department of Agriculture

National Nutrient Database for Standard Reference Release 27

NDB API


Overview

Our API provides REST access to the National Nutrient Database for Standard Reference (NDB) . It is intended primarily to assist application developers wishing to incorporate nutrient data into their applications or websites.

To take full advantage of the API, developers should familiarize themselves with the database by reading the database documentation available via links on the NDB home page. This documentation provides the detailed definitions and descriptions you need for understanding the data elements referenced in the API documentation. Additionally, you should have some idea of how the NDB online web application works as the API is based on this application. Check here for more information about that.


What's Available

The API provides two kinds of nutrient reports: Food reports which list nutrient values for a specified food or nutrient reports which provide lists of foods and their nutrient values for a specified set of nutrients. An example of a food report from the web application is this one for chedder cheese while an example of a nutrient report is this one for protein.

To assist you in discovering and retrieving the unique id's which are assigned to each food, nutrient and food group in the database and which are required to formulate and request either report, two other types of requests allow you to retrieve lists of nutrients, foods or foods groups and to perform free-text searches for foods.


Gaining Access

Anyone may access and use the API. However, a data.gov API key is required. If you do not have a key, please obtain one by registering at https://api.data.gov/signup. You will need to incorporate your key into each API request.


Further Details

Select the links below for more detailed information on how to formulate API requests and understand responses.