Search Foods
Example request and response for searching foods using POST /v1/foods/search with keyword query
Search Foods is an example object payload from FoodData Central, with 4 top-level fields. It illustrates the shape of data this provider's APIs accept or return.
Top-level fields
Example Payload
{
"summary": "Search for foods by keyword",
"description": "Example request and response for searching foods using POST /v1/foods/search with keyword query",
"request": {
"method": "POST",
"url": "https://api.nal.usda.gov/fdc/v1/foods/search?api_key=DEMO_KEY",
"headers": {
"Content-Type": "application/json"
},
"body": {
"query": "cheddar cheese",
"dataType": ["Foundation", "SR Legacy"],
"pageSize": 10,
"pageNumber": 1,
"sortBy": "dataType.keyword",
"sortOrder": "asc"
}
},
"response": {
"status": 200,
"body": {
"foodSearchCriteria": {
"query": "cheddar cheese",
"dataType": ["Foundation", "SR Legacy"],
"pageSize": 10,
"pageNumber": 1,
"sortBy": "dataType.keyword",
"sortOrder": "asc"
},
"totalHits": 42,
"currentPage": 1,
"totalPages": 5,
"foods": [
{
"fdcId": 328637,
"dataType": "Foundation",
"description": "Cheese, cheddar",
"ndbNumber": "1009",
"publicationDate": "4/1/2019",
"scientificName": null,
"score": 932.52,
"foodNutrients": [
{
"number": 1003,
"name": "Protein",
"amount": 24.9,
"unitName": "g",
"derivationCode": "A",
"derivationDescription": "Analytical"
},
{
"number": 1004,
"name": "Total lipid (fat)",
"amount": 33.14,
"unitName": "g",
"derivationCode": "A",
"derivationDescription": "Analytical"
},
{
"number": 1005,
"name": "Carbohydrate, by difference",
"amount": 1.28,
"unitName": "g",
"derivationCode": "NC",
"derivationDescription": "Calculated"
},
{
"number": 1008,
"name": "Energy",
"amount": 403,
"unitName": "kcal",
"derivationCode": "NC",
"derivationDescription": "Calculated"
}
]
},
{
"fdcId": 173414,
"dataType": "SR Legacy",
"description": "Cheese, cheddar",
"ndbNumber": "1009",
"publicationDate": "4/1/2019",
"score": 912.15,
"foodNutrients": [
{
"number": 1003,
"name": "Protein",
"amount": 24.9,
"unitName": "g",
"derivationCode": "A",
"derivationDescription": "Analytical"
},
{
"number": 1004,
"name": "Total lipid (fat)",
"amount": 33.14,
"unitName": "g",
"derivationCode": "A",
"derivationDescription": "Analytical"
}
]
}
]
}
}
}
Work with this as data
Every example here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for examples
4 MCP tools reach this
find_examplesBrowse and filter every example in the catalog.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.
Call it yourself
curl for this page
curl "https://apis.io/api/v1/examples/search-foods"
curl "https://apis.io/api/v1/examples?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.