fdc.nal.usda.gov APIfdc.nal.usda.gov ↗
Access USDA FoodData Central via 6 endpoints. Search foods, retrieve full nutrient profiles, serving sizes, and more across Foundation, Branded, and SR Legacy datasets.
curl -X GET 'https://api.parse.bot/scraper/f47af225-4ebf-4150-8fd9-c2db987ee74e/search_foods?query=chicken' \ -H 'X-API-Key: $PARSE_API_KEY'
Search for foods by keyword/query with filtering by data type, brand owner, sorting, and pagination. Returns paginated results from FoodData Central.
| Param | Type | Description |
|---|---|---|
| page | integer | Page number to retrieve |
| queryrequired | string | Search keyword (e.g. 'apple', 'chicken breast') |
| sort_by | string | Field to sort by: 'description', 'fdcId', 'publishedDate' |
| data_types | string | Comma-separated list of data types to include: Foundation, SR Legacy, Survey (FNDDS), Branded, Experimental. Omitting returns all types. |
| sort_order | string | Sort order: 'asc' or 'desc' |
| brand_owner | string | Filter by exact brand owner name (e.g. 'TREECRISP 2 GO') |
{
"type": "object",
"fields": {
"foods": "array of food summary objects with fdcId, description, dataType, foodNutrients, and other metadata",
"totalHits": "integer total number of matching foods",
"totalPages": "integer total number of pages",
"currentPage": "integer current page number"
},
"sample": {
"data": {
"foods": [
{
"fdcId": 2117388,
"dataType": "Branded",
"brandOwner": "Associated Wholesale Grocers, Inc.",
"description": "APPLE",
"servingSize": 240,
"foodNutrients": [
{
"value": 0,
"unitName": "G",
"nutrientName": "Protein"
}
],
"servingSizeUnit": "ml"
}
],
"totalHits": 26803,
"totalPages": 537,
"currentPage": 1
},
"status": "success"
}
}About the fdc.nal.usda.gov API
The USDA FoodData Central API provides access to the full FDC database across 6 endpoints, covering Foundation, Branded, SR Legacy, Survey (FNDDS), and Experimental food datasets. Use search_foods to find items by keyword with filtering by data type and brand owner, get_food_nutrients to retrieve pre-categorized macronutrients, vitamins, minerals, and lipids by FDC ID, or get_food_details for the complete nutrient and measurement record for any single food item.
Searching and Browsing Foods
The search_foods endpoint accepts a query string and optional filters including data_types (comma-separated values such as Foundation, Branded, SR Legacy), brand_owner for exact brand matching, and sort_by fields like description, fdcId, or publishedDate. Results are paginated and each food summary object in the foods array includes fdcId, description, dataType, and a foodNutrients snapshot. Use list_foods with just a data_types filter to browse all available foods alphabetically without a keyword query.
Retrieving Nutritional Details
get_food_details returns the full record for a single food item identified by fdc_id, including a foodNutrients array with nested nutrient details and analysis data, a foodMeasures array, and the foodType field indicating which FDC dataset the item belongs to. For bulk lookups, get_multiple_foods accepts a comma-separated list of FDC IDs and returns an array of the same full detail objects in one request, which reduces round-trips when building nutrition comparison tools or populating ingredient lists.
Pre-Categorized Nutrient Breakdown
get_food_nutrients returns nutrient values already grouped into five named categories — macronutrients, vitamins, minerals, lipids, and other — each as an object mapping nutrient names to {amount, unit, name}. This is useful when you want a structured nutrient panel without having to classify raw nutrient IDs yourself. get_food_serving_sizes complements this by returning servingSize, servingSizeUnit, householdServingFullText, packageWeight, and a foodMeasures array for a given FDC ID, giving you the context needed to express nutrient amounts per serving rather than per 100g.
- Build a nutrition label generator using
get_food_nutrientsmacronutrients, vitamins, and minerals for any FDC ID - Compare nutrient profiles across multiple foods simultaneously with
get_multiple_foods - Filter branded product search results by
brand_ownerto populate a brand-specific food database - Display household serving descriptions and package weights from
get_food_serving_sizesin a recipe app - Paginate through all Foundation or SR Legacy foods via
list_foodsto seed a local nutrition database - Sort food search results by
publishedDatedescending to surface recently added FDC entries - Cross-reference Survey (FNDDS) foods with dietary intake studies by filtering
data_typesinsearch_foods
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 250 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does USDA FoodData Central have an official developer API?+
What does `get_food_nutrients` return that `get_food_details` does not?+
get_food_details returns the raw foodNutrients array as it appears in the FDC record, with nested objects containing nutrient metadata and analysis data. get_food_nutrients post-processes that array and groups values into five named buckets — macronutrients, vitamins, minerals, lipids, and other — each mapping nutrient names directly to {amount, unit, name}. This saves you the step of classifying nutrient IDs by hand.Does the API return ingredient lists or allergen information for branded foods?+
description and dataType, but ingredient text and allergen statements are not exposed as dedicated response fields. You can fork this API on Parse and revise it to add an endpoint that extracts those fields from the FDC branded food records.How does pagination work across the search and list endpoints?+
search_foods and list_foods both return totalHits, totalPages, and currentPage alongside the foods array. Pass the page integer parameter to move through result sets. There is no cursor-based pagination — page number is the only navigation mechanism, and results per page follow FDC defaults.Is daily value percentage (% DV) data available from the nutrient endpoints?+
get_food_nutrients returns amount and unit for each nutrient but does not include percent daily value calculations. get_food_details exposes raw nutrient data from FDC without DV percentages. You can fork this API on Parse and revise it to compute % DV values from the returned amounts using standard reference intakes.