# USDA FoodData Central API

> USDA FoodData Central provides food search results and nutrition facts by amount as a workflow and API.

USDA FoodData Central (FDC) finds USDA foods and branded products from a food or brand name, with optional food type and result count. Get nutrition facts returns nutrients per 100 grams and for a chosen amount; provide a food name and optionally an amount.

- Page: https://fous.com/tools/usda-fooddata-central
- Handle: `@usda-fooddata-central`
- Category: [Health](https://fous.com/tools/category/health)
- Source website: https://fdc.nal.usda.gov
- Last verified: Sep 29, 2026

## Methods

### Get nutrition facts

Operation `get_nutrition_facts`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Get USDA nutrition facts per 100 g and for a chosen amount of a food. Household amounts require a matching listed portion; unavailable nutrients are null.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `food` | string | yes | `"cooked brown rice"` | Food in plain words, for example banana or cooked brown rice. |
| `amount` | string | no | `"1 cup"` | Amount to calculate, for example 1 cup, 150 g, or 2 large. Defaults to 100 g. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "food"
  ],
  "properties": {
    "food": {
      "type": "string",
      "description": "Food in plain words, for example banana or cooked brown rice.",
      "examples": [
        "cooked brown rice",
        "banana"
      ]
    },
    "amount": {
      "type": "string",
      "default": "100 g",
      "description": "Amount to calculate, for example 1 cup, 150 g, or 2 large. Defaults to 100 g.",
      "examples": [
        "1 cup",
        "2 large"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "food": "cooked brown rice",
      "amount": "1 cup"
    },
    {
      "food": "banana",
      "amount": "2 large"
    },
    {
      "food": "banana"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `fdc_id` | integer | `169704` |  |
| `page_link` | string | `"https://fdc.nal.usda.gov/food-details/169704/nutrients"` |  |
| `per_100_g` | object |  |  |
| `per_100_g.fiber_g` | number or null | `1.6` | Fiber in grams |
| `per_100_g.iron_mg` | number or null | `0.56` | Iron in milligrams |
| `per_100_g.sugars_g` | number or null | `0.24` | Sugars in grams |
| `per_100_g.protein_g` | number or null | `2.74` | Protein in grams |
| `per_100_g.sodium_mg` | number or null | `4` | Sodium in milligrams |
| `per_100_g.calcium_mg` | number or null | `3` | Calcium in milligrams |
| `per_100_g.total_fat_g` | number or null | `0.97` | Total fat in grams |
| `per_100_g.potassium_mg` | number or null | `86` | Potassium in milligrams |
| `per_100_g.vitamin_c_mg` | number or null | `0` | Vitamin C in milligrams |
| `per_100_g.vitamin_d_ug` | number or null | `0` | Vitamin D in micrograms |
| `per_100_g.calories_kcal` | number or null | `123` | Calories in kilocalories |
| `per_100_g.cholesterol_mg` | number or null | `0` | Cholesterol in milligrams |
| `per_100_g.carbohydrates_g` | number or null | `25.6` | Carbohydrates in grams |
| `per_100_g.saturated_fat_g` | number or null | `0.26` | Saturated fat in grams |
| `per_amount` | object |  |  |
| `per_amount.fiber_g` | number or null | `3.232` | Fiber in grams |
| `per_amount.iron_mg` | number or null | `1.1312` | Iron in milligrams |
| `per_amount.sugars_g` | number or null | `0.4848` | Sugars in grams |
| `per_amount.protein_g` | number or null | `5.5348` | Protein in grams |
| `per_amount.sodium_mg` | number or null | `8.08` | Sodium in milligrams |
| `per_amount.calcium_mg` | number or null | `6.06` | Calcium in milligrams |
| `per_amount.total_fat_g` | number or null | `1.9594` | Total fat in grams |
| `per_amount.potassium_mg` | number or null | `173.72` | Potassium in milligrams |
| `per_amount.vitamin_c_mg` | number or null | `0` | Vitamin C in milligrams |
| `per_amount.vitamin_d_ug` | number or null | `0` | Vitamin D in micrograms |
| `per_amount.calories_kcal` | number or null | `248.46` | Calories in kilocalories |
| `per_amount.cholesterol_mg` | number or null | `0` | Cholesterol in milligrams |
| `per_amount.carbohydrates_g` | number or null | `51.712` | Carbohydrates in grams |
| `per_amount.saturated_fat_g` | number or null | `0.5252` | Saturated fat in grams |
| `amount_used` | string | `"1 cup"` |  |
| `amount_weight_g` | number | `202` |  |
| `data_source_type` | string | `"SR Legacy"` |  |
| `matched_food_name` | string | `"Rice, brown, long-grain, cooked (Includes foods for USDA's Food Distribution Program)"` |  |

**Example input**

```json
{
  "food": "cooked brown rice",
  "amount": "1 cup"
}
```

**Example output**

```json
{
  "fdc_id": 169704,
  "page_link": "https://fdc.nal.usda.gov/food-details/169704/nutrients",
  "per_100_g": {
    "fiber_g": 1.6,
    "iron_mg": 0.56,
    "sugars_g": 0.24,
    "protein_g": 2.74,
    "sodium_mg": 4,
    "calcium_mg": 3,
    "total_fat_g": 0.97,
    "potassium_mg": 86,
    "vitamin_c_mg": 0,
    "vitamin_d_ug": 0,
    "calories_kcal": 123,
    "cholesterol_mg": 0,
    "carbohydrates_g": 25.6,
    "saturated_fat_g": 0.26
  },
  "per_amount": {
    "fiber_g": 3.232,
    "iron_mg": 1.1312,
    "sugars_g": 0.4848,
    "protein_g": 5.5348,
    "sodium_mg": 8.08,
    "calcium_mg": 6.06,
    "total_fat_g": 1.9594,
    "potassium_mg": 173.72,
    "vitamin_c_mg": 0,
    "vitamin_d_ug": 0,
    "calories_kcal": 248.46,
    "cholesterol_mg": 0,
    "carbohydrates_g": 51.712,
    "saturated_fat_g": 0.5252
  },
  "amount_used": "1 cup",
  "amount_weight_g": 202,
  "data_source_type": "SR Legacy",
  "matched_food_name": "Rice, brown, long-grain, cooked (Includes foods for USDA's Food Distribution Program)"
}
```

### Search foods

Operation `search_foods`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

Search USDA foods and branded products by food or brand name. Results are ranked by relevance; calories and serving sizes are null when not supplied.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `query` | string | yes | `"Cheerios"` | Food or brand name to search, for example greek yogurt or Cheerios. |
| `food_type` | string | no | `"branded"` | Choose any foods, generic foods, or branded products; for example branded. |
| `max_results` | integer | no | `5` | Maximum number of results to return, for example 20. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "description": "Food or brand name to search, for example greek yogurt or Cheerios.",
      "examples": [
        "Cheerios",
        "greek yogurt",
        "zzzxxyyqqqqnotfood"
      ]
    },
    "food_type": {
      "enum": [
        "any",
        "generic",
        "branded"
      ],
      "type": "string",
      "default": "any",
      "description": "Choose any foods, generic foods, or branded products; for example branded.",
      "examples": [
        "branded",
        "generic"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum number of results to return, for example 20.",
      "x-fous-developer": true,
      "examples": [
        5,
        4,
        7
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "query": "Cheerios",
      "food_type": "branded",
      "max_results": 5
    },
    {
      "query": "greek yogurt"
    },
    {
      "query": "zzzxxyyqqqqnotfood",
      "max_results": 4
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `foods` | array |  | Foods in relevance order. |
| `foods[].category` | string or null | `"Processed Cereal Products"` | Food category. |
| `foods[].brand_owner` | string or null | `"General Mills"` | Brand owner, or null for generic foods. |
| `foods[].description` | string | `"Cheerios Cereal"` | Food description. |
| `foods[].serving_size` | string or null | `"3/4 cup (20g) (age 1-3 years)"` | Serving size shown for the food, if available. |
| `foods[].food_page_link` | string | `"https://fdc.nal.usda.gov/food-details/2517161/nutrients"` | FoodData Central food details page. |
| `foods[].data_source_type` | string or null | `"Branded"` | USDA data source type. |
| `foods[].calories_per_100_g` | number or null | `359` | Calories (kcal) per 100 grams, if supplied. |
| `foods[].food_data_central_id` | integer | `2517161` | USDA FoodData Central food ID. |

**Example input**

```json
{
  "query": "Cheerios",
  "food_type": "branded",
  "max_results": 5
}
```

**Example output**

```json
{
  "foods": [
    {
      "category": "Processed Cereal Products",
      "brand_owner": "General Mills",
      "description": "Cheerios Cereal",
      "serving_size": "3/4 cup (20g) (age 1-3 years)",
      "food_page_link": "https://fdc.nal.usda.gov/food-details/2517161/nutrients",
      "data_source_type": "Branded",
      "calories_per_100_g": 359,
      "food_data_central_id": 2517161
    },
    {
      "category": "Processed Cereal Products",
      "brand_owner": "GENERAL MILLS SALES INC.",
      "description": "Cheerios Cereal",
      "serving_size": "1 bowl",
      "food_page_link": "https://fdc.nal.usda.gov/food-details/2777025/nutrients",
      "data_source_type": "Branded",
      "calories_per_100_g": 357,
      "food_data_central_id": 2777025
    },
    {
      "category": "Processed Cereal Products",
      "brand_owner": "GENERAL MILLS SALES INC.",
      "description": "Cheerios Cereal",
      "serving_size": "1 pouch (26g)",
      "food_page_link": "https://fdc.nal.usda.gov/food-details/759418/nutrients",
      "data_source_type": "Branded",
      "calories_per_100_g": 385,
      "food_data_central_id": 759418
    }
  ]
}
```

## Quick start

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@usda-fooddata-central",
  "visibility": "public",
  "operation": "get_nutrition_facts",
  "version": 1,
  "input": {
    "food": "cooked brown rice",
    "amount": "1 cup"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

body = json.loads("{\n  \"api\": \"@usda-fooddata-central\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_nutrition_facts\",\n  \"version\": 1,\n  \"input\": {\n    \"food\": \"cooked brown rice\",\n    \"amount\": \"1 cup\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=180) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_000),
  body: JSON.stringify({
  "api": "@usda-fooddata-central",
  "visibility": "public",
  "operation": "get_nutrition_facts",
  "version": 1,
  "input": {
    "food": "cooked brown rice",
    "amount": "1 cup"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/usda-fooddata-central`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_nutrition_facts`: Get nutrition facts. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `search_foods`: Search foods. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-usda-fooddata-central https://api.fous.com/mcp/tools/usda-fooddata-central --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## Use cases

- Compare calories and nutrients across foods
- Find branded products by name
- Calculate nutrients for a meal portion
- Review food serving sizes and categories

## FAQ

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this USDA FoodData Central tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. With pay as you go, a credit costs 1¢. Monthly plans cost less per credit.

### Do I need a USDA FoodData Central account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from fdc.nal.usda.gov when you run it. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified on Sep 29, 2026.

### How many calories are in a chosen food amount?

Get nutrition facts returns calories per 100 grams and for the chosen amount.

### Can I find a branded food by name?

Search foods finds USDA foods and branded products using a food or brand name.

### What nutrients does a food contain?

Get nutrition facts returns available nutrients, including protein, fiber, carbohydrates, fats, and minerals.

## Related

- [Open Food Facts API](https://fous.com/tools/open-food-facts.md): Open Food Facts provides public packaged-food information, including ingredients, allergens, nutrition, and product classifications; coverage varies, and search results favor popular products.
- [FDA API](https://fous.com/tools/fda.md): FDA provides drug safety data, latest matching drug labels, common reported side effects, and newest-first drug, food, and device recalls; recent drug and device recalls may be missing, and weekly food statuses may lag.
- [McDonald's API](https://fous.com/tools/mcdonalds.md): McDonald’s provides menu-item food information for US, UK and Canadian items, plus nearby US restaurants and listed hours today, which may miss unexpected closures.
- [Aldi API](https://fous.com/tools/aldi.md): Search groceries and prices at ALDI US.
- [Food Network API](https://fous.com/tools/food-network.md): Food Network offers recipes, cooking shows, and food inspiration, with searchable recipes and ingredient, direction, rating, and cooking-time details when available.
- [BBC Good Food API](https://fous.com/tools/bbc-good-food.md): BBC Good Food returns searchable web recipes, excluding app-only recipes, and full recipe ingredients, steps, and per-serving nutrition when available.
- [Alternative Fuels Data Center API](https://fous.com/tools/alternative-fuels-data-center.md): U.S. Department of Energy data on alternative fuel stations and vehicles.
- [Food Standards Agency API](https://fous.com/tools/food-standards-agency.md): Official UK food hygiene ratings for food businesses.
- [All Health tools](https://fous.com/tools/category/health)
