# USDA FoodData Central Food Search

> USDA FoodData Central Food Search is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Search for foods by name in the USDA FoodData Central database, returning ranked matches with nutrition macros per 100g

## Facts

- Endpoint: GET https://api.agentstools.dev/nutrition/search
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/usda-fooddata-central-food-search-2571035a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JjZUlojNUCuRTexwVmoCW

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-food-search-2571035a
```

Example prompt: Search the USDA FoodData Central database for 'avocado' and show me the top 5 ranked matches including their fdc_id, description, brand, and key macros per 100g — filter to Foundation foods only.

## When to prefer this

Use this endpoint when you need to search for foods by name and retrieve structured nutritional macro data from the authoritative US government food database. Ideal for dietary tracking apps, meal planners, ingredient analyzers, or any workflow needing standardized fdc_id identifiers or GTIN barcodes for foods. Prefer this over generic nutrition APIs when USDA provenance, public-domain data, or filtering by USDA data type (Foundation, Branded, SR Legacy, etc.) is important.

## Known failure modes

- No matches found for obscure or misspelled food names
- Query parameter missing returns validation error
- Limit exceeds maximum of 25 returns error
- Invalid dataType enum value returns error
- Upstream USDA FoodData Central API unavailability causes 503

## How this service works

Search foods by name in USDA FoodData Central (public domain). Returns ranked matches with fdc_id, description, brand, GTIN and key macros per 100g.

## Output

A ranked list of food matches from USDA FoodData Central, each containing fdc_id, food description, brand name, GTIN barcode, and key macronutrients (calories, protein, fat, carbohydrates) per 100g, ordered by relevance to the search query.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "description": "Food name to search for"
      },
      "limit": {
       "type": "integer",
       "maximum": 25,
       "minimum": 1,
       "description": "Max ranked matches (default 10)"
      },
      "dataType": {
       "enum": [
        "Foundation",
        "SR Legacy",
        "Branded",
        "Survey (FNDDS)",
        "Experimental"
       ],
       "type": "string",
       "description": "Optional USDA data-type filter"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/usda-fooddata-central-food-search-2571035a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
