[Integrations](https://spiral.ai/integrations) › [VS Code](https://spiral.ai/integrations/vscode) › [USDA food categories](https://spiral.ai/integrations/vscode/usda-food-categories)

# How to Use USDA food categories in VS Code

Returns FoodData Central’s food category reference lists. Use it to interpret category codes and organize comparisons while keeping USDA’s different classification systems separate.

|  |  |
| --- | --- |
| Model | USDA food categories |
| Available through | Alexandria |
| Category | Maps & Reviews |
| Price | $0.00873 per call. |
| Returns | json |
| Runs | In the background |
| Setup | About 2 minutes, no API key |

## Prompts to try with USDA food categories in VS Code

- Use USDA food categories to retrieve the category references and build a reference view that keeps the classification systems separate.
- Use USDA food categories to look this up and give me the result as a table. Save the result in ./assets.
- Pull the latest numbers from USDA food categories and tell me what changed since last week.
- Check USDA food categories and summarize what you find in three bullet points.
- Pull the newest data from USDA food categories and give me the result as a table.

## How to set up USDA food categories in VS Code

Pick the way that suits you. Each takes about two minutes.

### Use Spiral's MCP server

1. **Add the hosted server**: Use Add to VS Code on the console's Agents & MCP page, or run:

```bash
code --add-mcp '{"name":"spiral","type":"http","url":"https://api.spiral.ai/mcp"}'
```

2. **Sign in**: VS Code asks you to sign in when it first starts the server: sign in to Spiral and click Authorize. No API key. Run MCP: List Servers from the Command Palette to check that Spiral is running.

### Use the Spiral skill

1. **Send VS Code this message**: Your agent reads Spiral's skill and sets itself up.

```
set up https://spiral.ai/SKILL.md
```

2. **Sign in or paste a key**: Approve Spiral in the browser, or give the agent a key from the console.

### Use the Spiral CLI

1. **Install and sign in**: Installs the Spiral CLI, signs you in and adds its skill to your coding agents.

```bash
npx -y spiral-cli@latest init
```

### Call the Spiral API

1. **Create an API key**: In the console, under API keys.

2. **Run USDA food categories**: One request; the result comes back by polling or a webhook.

```bash
curl https://api.spiral.ai/v1/runs \
  -H "Authorization: Bearer $SPIRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "provider": "alexandria",
    "model": "fdc-nal-usda-gov/foods/list_food_categories",
    "input": {
      "data_type": "Foundation"
    }
  }'
```

Then paste one of the prompts above: VS Code finds USDA food categories on Spiral, shows the price and runs it.

Setup guide in the docs: https://spiral.ai/docs/quickstarts/vscode

## USDA food categories tools and prices

- [USDA FoodData Central (fdc.nal.usda.gov) · List food categories](https://spiral.ai/tools/alexandria/fdc-nal-usda-gov/foods/list_food_categories) (Alexandria): $0.00873 per call.

## What can you do with USDA food categories in VS Code?

Build a food comparison feature with USDA records, nutrient definitions, categories, and nutrient rankings. A coding agent can turn those responses into labeled tables and searchable views in your project.

### Cafeteria ingredient substitution research

Find candidate foods by sodium content, match their descriptions, and inspect complete records. Use nutrient definitions and food categories to organize a comparison of substitutes within the same type of food.

### Plant protein ingredient comparison

Discover foods ranked by reported protein, locate lentil, bean, tofu, and grain records, and compare their nutrient details. Resolve nutrient units and category labels before preparing a purchasing research table.

### Fortified staple food research

Build a reference comparison of enriched and unenriched flour or rice. Resolve the iron definition, discover candidate foods by iron content, verify descriptions, and organize detailed records by USDA category.

### Food comparison teaching tool

Build a classroom explorer with food search, category navigation, nutrient definitions, nutrient rankings, and individual food records. Let students investigate how the chosen food and nutrient change a comparison.

### Food category documentation

Document the category references used in a nutrition research project. Keep each USDA classification system identifiable when describing how foods were organized.

## Overview

- [Alexandria](https://spiral.ai/providers/alexandria)
- [All VS Code guides](https://spiral.ai/integrations/vscode)

## USDA food categories in other agents

- [Amp](https://spiral.ai/integrations/amp/usda-food-categories)
- [ChatGPT](https://spiral.ai/integrations/chatgpt/usda-food-categories)
- [Claude](https://spiral.ai/integrations/claude-desktop/usda-food-categories)
- [Claude Code](https://spiral.ai/integrations/claude-code/usda-food-categories)
- [Cline](https://spiral.ai/integrations/cline/usda-food-categories)
- [Codex](https://spiral.ai/integrations/codex/usda-food-categories)
- [Cursor](https://spiral.ai/integrations/cursor/usda-food-categories)
- [Devin](https://spiral.ai/integrations/devin/usda-food-categories)
- [dots](https://spiral.ai/integrations/dots/usda-food-categories)
- [Factory Droid](https://spiral.ai/integrations/factory-droid/usda-food-categories)
- [Gemini](https://spiral.ai/integrations/gemini/usda-food-categories)
- [Gemini CLI](https://spiral.ai/integrations/gemini-cli/usda-food-categories)
- [Google Antigravity](https://spiral.ai/integrations/antigravity/usda-food-categories)
- [goose](https://spiral.ai/integrations/goose/usda-food-categories)
- [Grok](https://spiral.ai/integrations/grok/usda-food-categories)
- [Grok Build](https://spiral.ai/integrations/grok-build/usda-food-categories)
- [Hermes](https://spiral.ai/integrations/hermes/usda-food-categories)
- [Instinct](https://spiral.ai/integrations/instinct/usda-food-categories)
- [Manus](https://spiral.ai/integrations/manus/usda-food-categories)
- [Muse](https://spiral.ai/integrations/muse/usda-food-categories)
- [Muse Code](https://spiral.ai/integrations/muse-code/usda-food-categories)
- [n8n](https://spiral.ai/integrations/n8n/usda-food-categories)
- [Notion](https://spiral.ai/integrations/notion/usda-food-categories)
- [OpenClaw](https://spiral.ai/integrations/openclaw/usda-food-categories)
- [opencode](https://spiral.ai/integrations/opencode/usda-food-categories)
- [Perplexity](https://spiral.ai/integrations/perplexity/usda-food-categories)
- [Raycast](https://spiral.ai/integrations/raycast/usda-food-categories)
- [Windsurf](https://spiral.ai/integrations/windsurf/usda-food-categories)
- [Zapier](https://spiral.ai/integrations/zapier/usda-food-categories)

## More VS Code guides

- [USCG PSIX vessel search](https://spiral.ai/integrations/vscode/uscg-psix-vessel-search)
- [USDA food nutrition details](https://spiral.ai/integrations/vscode/usda-food-nutrition-details)
- [USCG PSIX vessel register](https://spiral.ai/integrations/vscode/uscg-psix-vessel-register)
- [USDA food search](https://spiral.ai/integrations/vscode/usda-food-search)
- [USCG PSIX vessel details](https://spiral.ai/integrations/vscode/uscg-psix-vessel-details)
- [USDA foods ranked by nutrient](https://spiral.ai/integrations/vscode/usda-foods-ranked-by-nutrient)

## Questions about USDA food categories in VS Code

**Can VS Code use USDA food categories?**

Yes. Add Spiral to VS Code as an MCP server, and VS Code can find and run USDA food categories like any built-in tool.

**How much does USDA food categories cost in VS Code?**

$0.00873 per call. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your VS Code plan is separate.

**Do I need an Alexandria account to use USDA food categories in VS Code?**

No. Spiral runs USDA food categories on its own Alexandria account. You sign in to Spiral once and never paste a key.

**How long does it take to set up USDA food categories in VS Code?**

About two minutes: add the hosted server, then sign in.

**Does VS Code wait while USDA food categories runs?**

USDA food categories runs in the background. VS Code starts the run, checks on it and gives you the json when it's ready.

**How often does USDA update FoodData Central?**

Branded Foods data updates monthly through the API. SR Legacy is a fixed historical reference whose final release was April 2018.

**What does Foundation Foods cover?**

Foundation Foods covers commodity and minimally processed food samples. Its metadata helps explain variation between analyzed samples.

**Does USDA use one category system for every food?**

No. Each FoodData Central data type uses a categorization system developed for its own purpose, so category labels should be interpreted within that data type.

**Can I find a packaged food by its barcode?**

FoodData Central supports searching by GTIN as well as food name. It also supports NDB numbers and FNDDS food codes for the relevant data types.

**What information can I inspect behind a nutrient value?**

A food record can include data points, minimum, maximum, median, derivation details, and portions. Which details are available depends on the selected record.

