Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

National Agricultural Library FDC API

endpoints to retrieve nutrient data

National Agricultural Library FDC API is published by National Agricultural Library on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include FDC. The published artifact set on APIs.io includes an OpenAPI specification and API documentation.

This API exposes 9 operations across 6 paths, and defines 29 schemas. It is described by OpenAPI 3.0.0, at version 1.0.1.

Requests are made against a single base URL, https://api.nal.usda.gov/fdc.

9 operations 6 paths 29 schemas 6 GET3 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.0.0
API Version
1.0.1
Base URL
https://api.nal.usda.gov/fdc/v1
Authentication
API Key
Resource Areas
1

Authentication & Security 1

National Agricultural Library FDC API declares 1 security scheme for authenticating requests. An API key is passed in the query as api_key (ApiKeyAuth). By default, every request must be authenticated.

Paths & Operations 9

Across 6 paths, the API surfaces 9 operations — 6 GET, 3 POST. Each is listed below with its method, path, parameters, and response codes.

FDC 9

endpoints to retrieve nutrient data

GET
/v1/food/{fdcId}
Fetches details for one food item by FDC ID
getFood 3 params → 200400404
GET
/v1/foods
Fetches details for multiple food items using input FDC IDs
getFoods 3 params → 200400
POST
/v1/foods
Fetches details for multiple food items using input FDC IDs
postFoods body → 200400
GET
/v1/foods/list
Returns a paged list of foods, in the 'abridged' format
getFoodsList 5 params → 200400
POST
/v1/foods/list
Returns a paged list of foods, in the 'abridged' format
postFoodsList body → 200400
GET
/v1/foods/search
Returns a list of foods that matched search (query) keywords
getFoodsSearch 7 params → 200400
POST
/v1/foods/search
Returns a list of foods that matched search (query) keywords
postFoodsSearch body → 200400
GET
/v1/json-spec
Returns this documentation in JSON format
getJsonSpec → default
GET
/v1/yaml-spec
Returns this documentation in JSON format
getYamlSpec → default

Schemas 29

The contract defines 29 schemas that model the data the API accepts and returns. The most detailed are BrandedFoodItem (21 properties), FoodUpdateLog (17 properties), FoundationFoodItem (15 properties), SearchResultFood (14 properties). Each schema is shown below with its type and property counts.

FoodsCriteria
object
JSON for request body of 'foods' POST request. Retrieves a list of food items by a list of up to 20 FDC IDs. Optional format and nutrients can be specified. In…
3 properties
FoodNutrientSource
object
3 properties
InputFoodSurvey
object
applies to Survey (FNDDS). Not all inputFoods will have all fields.
13 properties
Nutrient
object
a food nutrient
5 properties
FoodNutrientDerivation
object
4 properties
NutrientAcquisitionDetails
object
4 properties
AbridgedFoodItem
object
9 properties 3 required
InputFoodFoundation
object
applies to Foundation foods. Not all inputFoods will have all fields.
3 properties
WweiaFoodCategory
object
2 properties
FoodSearchCriteria
object
A copy of the criteria that were used in the search.
10 properties
SearchResult
object
5 properties
SurveyFoodItem
object
12 properties 3 required
FoodUpdateLog
object
17 properties
FoodPortion
object
9 properties
FoodListCriteria
object
JSON for request body of 'list' POST request
5 properties
FoodAttribute
object
4 properties
RetentionFactor
object
3 properties
SampleFoodItem
object
6 properties 3 required
AbridgedFoodNutrient
object
6 properties 3 required
FoodCategory
object
3 properties
SearchResultFood
object
14 properties 2 required
FoundationFoodItem
object
15 properties 3 required
SRLegacyFoodItem
object
11 properties 3 required
NutrientAnalysisDetails
object
8 properties
MeasureUnit
object
3 properties
NutrientConversionFactors
object
2 properties
FoodComponent
object
7 properties
FoodNutrient
object
10 properties 3 required
BrandedFoodItem
object
21 properties 3 required

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

national-agricultural-library-fdc-api-openapi.yml Raw ↑