# USDA FDC Food Nutrition Comparator

> USDA FDC Food Nutrition Comparator is a paid API for AI agents from food.memoryapi.org, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Compare nutrition profiles of multiple foods side-by-side using their USDA FoodData Central (FDC) IDs.

## Facts

- Endpoint: GET https://food.memoryapi.org/x402/food/compare
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/food-memoryapi-org-9a048327
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_twgqBffyARrzHL8qTneyR

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability food-memoryapi-org-9a048327
```

Example prompt: Compare the nutrition side-by-side for chicken breast (FDC ID 171477), Atlantic salmon (FDC ID 175167), and firm tofu (FDC ID 172476) — I want to see macros, key vitamins, and minerals for all three at once.

## When to prefer this

Use this endpoint when you need to compare nutrition across multiple foods simultaneously using their USDA FDC IDs. It is ideal when the user wants a side-by-side breakdown rather than individual lookups, saving multiple API calls. Prefer this over the single-food profile endpoint when comparing two or more options for dietary, fitness, or meal planning decisions.

## Known failure modes

- Invalid or non-existent FDC ID returns an error or empty result for that item
- Fewer than two FDC IDs provided may result in a validation error
- Payment not processed (x402 payment required) results in 402 response
- Rate limiting or service unavailability returns 429 or 5xx errors
- FDC IDs for foods not in the USDA database return null data for those entries

## How this service works

USDA FoodData Central nutrition data API with x402 micropayments. Search foods, get full nutrition profiles, and compare multiple foods side-by-side.

## Output

A side-by-side nutritional comparison of multiple foods identified by USDA FDC IDs, showing macronutrients (protein, fat, carbohydrates, calories), vitamins, and minerals for each food in a structured comparative format.

## Example request

```json
{
 "ids": "171477,175167,172476"
}
```

## Request schema (JSON Schema)

```json
{
 "properties": {
  "input": {
   "properties": {
    "method": {
     "type": "string",
     "enum": [
      "GET"
     ]
    }
   },
   "required": [
    "method"
   ]
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "example": {
  "foods": [
   {
    "id": 173950,
    "name": "Avocados",
    "protein": 2,
    "calories": 160
   }
  ],
  "success": true,
  "winner_by_protein": "Chicken, breast",
  "winner_by_calories": "Avocados"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/food-memoryapi-org-9a048327/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from food.memoryapi.org](https://www.zero.xyz/host/food.memoryapi.org/llms.txt)
