# USDA FoodData Central Nutrition Lookup

> USDA FoodData Central Nutrition Lookup is a paid API for AI agents from 2s.io, paid per call via x402, $0.0012/call, status unknown (last checked 2026-09-13).

Search USDA FoodData Central by food name or retrieve full nutrient profile by FDC ID, covering ~400k foods with lab-analyzed nutrition data.

## Facts

- Endpoint: GET https://2s.io/api/nutrition/food
- Price: $0.0012/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/usda-fooddata-central-nutrition-lookup-d0a290cd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_CE4NCb7iUMuod3BB1iBlc

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 usda-fooddata-central-nutrition-lookup-d0a290cd
```

Example prompt: What's the full nutrient breakdown for raw spinach — calories, protein, fats, carbs, vitamins, and minerals — using USDA Foundation data? Search for 'raw spinach' and then pull the detailed nutrient profile from the FDC ID.

## When to prefer this

Use this endpoint when you need authoritative, lab-analyzed USDA nutrition data rather than model-estimated values. Ideal for dietary tracking apps, nutrition analysis, food labeling verification, or any use case requiring precise nutrient values across ~400k foods including both generic (Foundation/SR Legacy) and branded packaged foods.

## Known failure modes

- No foods found matching the query — returns empty results list
- Invalid or non-existent fdcId — returns 404 or error response
- Both query and fdcId provided simultaneously — violates XOR constraint
- Neither query nor fdcId provided — missing required parameter
- dataType filter returns no results for that category
- Rate limit or payment failure — returns 402 payment required

## How this service works

USDA FoodData Central nutrition lookup. Two modes: search (query=cheddar cheese) returns matching foods with fdcId, description, data type, category, and brand; detail (fdcId=328637) returns the full analyzed nutrient profile — energy, protein, fats, carbohydrates, vitamins, minerals — with USDA nutrient numbers, amounts, and units (per 100 g/ml unless serving fields indicate otherwise), plus ingredients for branded foods. Filter search by dataType: Foundation and SR Legacy are lab-analyzed generic foods, Branded is the packaged-food label corpus, Survey (FNDDS) is as-consumed dishes. Authoritative USDA data covering ~400k foods — use real analyzed values instead of model-estimated nutrition facts.

## Output

In search mode: a ranked list of matching foods each with fdcId, description, data type, category, and brand. In detail mode: a comprehensive nutrient profile including energy, protein, fats, carbohydrates, vitamins, and minerals with USDA nutrient numbers, amounts, and units (per 100g/ml), plus ingredients for branded foods.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "page": 1,
   "limit": 10,
   "query": "apple",
   "dataType": "Foundation"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "properties": {
      "page": {
       "type": "integer",
       "default": 1,
       "minimum": 1
      },
      "fdcId": {
       "type": "integer",
       "description": "FDC food id for full nutrient detail (XOR with query)."
      },
      "limit": {
       "type": "integer",
       "default": 10,
       "maximum": 50,
       "minimum": 1
      },
      "query": {
       "type": "string",
       "description": "Food name to search (XOR with fdcId)."
      },
      "dataType": {
       "enum": [
        "Foundation",
        "SR Legacy",
        "Survey (FNDDS)",
        "Branded"
       ],
       "type": "string",
       "description": "Restrict search to one FDC data type."
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/usda-fooddata-central-nutrition-lookup-d0a290cd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
