USDA FoodData Central
api.nal.usda.gov
Nutrient composition for hundreds of thousands of foods, from the US Department of Agriculture.
GET /v1/data/usda-food/barcode1Request
The digits of a UPC-A or EAN/GTIN barcode, no spaces or dashes, and keep any leading zero - FDC stores them zero-padded. Only US retail products carried by the Branded dataset are present; a miss returns totalHits 0, not a 404.
curl "https://api.fastcrw.com/v1/data/usda-food/barcode?gtinUpc=094395000172" \ -H "Authorization: Bearer $FASTCRW_API_KEY"
2Response example
A sample shape. Press Run to see live data from USDA FoodData Central.
| fdcId | description | dataType | gtinUpc | publishedDate | brandOwner | brandName | ingredients |
|---|---|---|---|---|---|---|---|
| 2057648 | CHEDDAR CHEESE | Branded | 094395000172 | 2021-10-28 | Grafton Village Cheese Co, LLC | GRAFTON VILLAGE | UNPASTEURIZED MILK, SALT, TRUFFLES (TRUFFLE, WATER, SALT, AROMAS), TRUFFLE OIL (OLIVE OIL, TRUFFLE FLAVOR), CULTURES, ENZYMES. |
18 more columns in JSON.
Attribution: Source: USDA FoodData Central
Licence: Work of the United States federal government, not subject to copyright in the US (17 U.S.C. 105). Free to use, including commercially, with the agency named as the source.
Ask with this source
A prompt for your agent that names this source and how to call it through the crw MCP.
Food by barcode (GTIN/UPC)
Use USDA FoodData Central (usda-food) from fastCRW Pergamon, capability "Food by barcode (GTIN/UPC)" (barcode). You scanned or were given a product barcode and want the nutrition facts for that exact package. Example options: gtinUpc=094395000172. Use the crw MCP tools: crw_find_data to confirm the source and its options, then crw_get_data with provider "usda-food" and capability "barcode". Tell me the credits used and cite the licence from the response. If the crw MCP tools are missing, install them with: npx -y crw-mcp install --api-key <your fastCRW API key>
Food detail by FDC ID
Use USDA FoodData Central (usda-food) from fastCRW Pergamon, capability "Food detail by FDC ID" (food). You already hold an FDC ID and want that one food's full nutrient profile. Example options: fdcId=1750340, format=abridged, nutrients=203,204,205. Use the crw MCP tools: crw_find_data to confirm the source and its options, then crw_get_data with provider "usda-food" and capability "food". Tell me the credits used and cite the licence from the response. If the crw MCP tools are missing, install them with: npx -y crw-mcp install --api-key <your fastCRW API key>
Foods by ID batch
Use USDA FoodData Central (usda-food) from fastCRW Pergamon, capability "Foods by ID batch" (foods). You are holding a list of FDC IDs from an earlier search and want them all without one request per food. Example options: fdcIds=1750340,747447, format=abridged, nutrients=203,204,205. Use the crw MCP tools: crw_find_data to confirm the source and its options, then crw_get_data with provider "usda-food" and capability "foods". Tell me the credits used and cite the licence from the response. If the crw MCP tools are missing, install them with: npx -y crw-mcp install --api-key <your fastCRW API key>
Browse the food catalogue
Use USDA FoodData Central (usda-food) from fastCRW Pergamon, capability "Browse the food catalogue" (list). You want to enumerate or sample a whole FDC dataset rather than look up one named food. Example options: dataType=Foundation, pageSize=5, pageNumber=1. Use the crw MCP tools: crw_find_data to confirm the source and its options, then crw_get_data with provider "usda-food" and capability "list". Tell me the credits used and cite the licence from the response. If the crw MCP tools are missing, install them with: npx -y crw-mcp install --api-key <your fastCRW API key>
