canonical: https://jentic.com/apis/nal.usda.gov/nal-usda

# Nal Usda Gov Food Data Central API

The FoodData Central API provides REST access to the U.S. Department of Agriculture's FoodData Central nutrient database. It searches foods by keyword, returns the full nutrient profile for a single food by its FDC ID or for many foods in one request, and pages through an abridged food list for bulk indexing. Results span reference and branded food records, so an application can attach calories, macronutrients, vitamins, and minerals to the ingredients and products it tracks.

## For AI agents

Search the USDA FoodData Central database for foods and retrieve their nutrient profiles by FDC ID. Returns calories, macronutrients, vitamins, and minerals for reference and branded foods.

## Scope

Does not handle recipe management, meal logging, or barcode scanning. Use for USDA food and nutrient data lookup only.

## Capabilities

- Search the FoodData Central database for foods matching keywords such as 'greek yogurt' or 'brown rice'
- Retrieve the full nutrient profile for a single food item by its FDC ID
- Look up nutrient data for several foods in one request by passing a list of FDC IDs
- Page through the abridged food list to build a local nutrient index for an application
- Narrow food searches by brand owner and data type to isolate branded or reference records
- Sort search results by published date or FDC ID to surface the newest entries

## Use cases

### AI Nutrition Agent

An AI agent connected through Jentic answers nutrition questions by searching FoodData Central and reading the returned nutrient values, so a user asking for the protein in a serving of lentils gets a sourced figure without the developer wiring the USDA endpoints by hand. The agent runs a keyword search, selects the matching food, and retrieves its nutrient profile in two calls.

Example prompt: Search FoodData Central for 'cooked lentils', select the best match, and return its protein, fiber, and calorie values per 100 grams

### Recipe Nutrition Calculator

A recipe or meal-planning app totals the nutrients of a dish by looking up each ingredient in FoodData Central and summing the returned values. The multi-food lookup accepts a list of FDC IDs in a single request, so a ten-ingredient recipe resolves without ten round trips, and reference data covers whole foods while branded data covers packaged products.

Example prompt: Look up the FDC IDs for flour, sugar, butter, and eggs, then sum their calories and fat to estimate a recipe's totals

### Branded Product Lookup

A grocery or diet-tracking product matches a catalogue item to its FoodData Central record by searching the food name and narrowing by brand owner, then displays the official USDA nutrient panel. Searches can be filtered by data type and paged for large product inventories, keeping lookups fast at scale.

Example prompt: Search for a branded cereal filtered by brand owner and return the serving-size nutrient values from the matching record

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/v1/food/{fdcId}` | Fetch one food item by FDC ID |
| GET | `/v1/foods` | Fetch several food items by their FDC IDs |
| GET | `/v1/foods/list` | Return a paged, abridged list of foods |
| GET | `/v1/foods/search` | Search foods by keyword |

## Key resources

- **Foods** — Retrieve a single food by FDC ID or several foods at once, each with its full nutrient profile
- **Food Search** — Keyword search across reference and branded foods with brand-owner and data-type filtering and sorting
- **Food List** — Paged, abridged listing of foods for bulk indexing
- **Specification** — Returns the API's own documentation in JSON or YAML form

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 49 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 93 / 100
  - Developer Experience & Jentic Compatibility: 76 / 100
  - AI-Readiness & Agent Experience: 46 / 100
  - Agent Usability: 94 / 100
  - Security: 15 / 100
  - AI Discoverability: 90 / 100
- **View full report:** https://jentic.com/apis/nal.usda.gov/nal-usda/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the FoodData Central API by hand means getting a USDA key, learning the api_key query parameter, and handling its paging and FDC ID lookups yourself. Through Jentic you install once, import FoodData Central from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** FoodData Central is read-only, so a rule can keep your agent to just the food search and lookup operations. You choose which operations it may call, and none of them write back to the USDA database.
- **Credential handling:** Your USDA API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'find the protein in a food' or 'look up a food by its FDC ID', and Jentic returns the matching FoodData Central operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Nutritionix API** — Natural-language nutrition database with a large branded and restaurant food dataset.
- **Edamam API** — Food and nutrition database with recipe analysis and diet labelling.
- **Spoonacular API** — Recipe, meal-planning, and ingredient API that pairs with USDA nutrient data.
- **Open Food Facts API** — Open database of packaged products keyed by barcode.

## FAQ

### What authentication does the FoodData Central API use?

The FoodData Central API authenticates with an API key passed as the api_key query parameter, per its OpenAPI spec. You can request a free key from the USDA. Through Jentic the key is stored encrypted by your own Jentic One instance and injected when the agent calls, so it never sits in the agent's prompt or logs.

### Can I search for branded foods with the FoodData Central API?

Yes. The food search operation takes a keyword query and can be narrowed by brand owner and data type, so you can isolate branded products or reference foods and page through the matches. Each result carries its FDC ID, which you pass to the detail lookup for the full nutrient profile.

### What are the rate limits for the FoodData Central API?

The OpenAPI spec does not define rate limits for the FoodData Central API. The USDA applies per-key quotas to its data.gov keys, so check https://fdc.nal.usda.gov for the current figures before running large batch jobs.

### Can I limit what my agent is allowed to do with the FoodData Central API?

Yes. Write a rule that allows only the food search and food lookup operations, so the agent reads nutrient data and nothing else. The API is read-only, so there is no write path to expose, and every call the agent makes is logged.

### How do I look up a food's nutrients with the FoodData Central API through Jentic?

Search by intent in Jentic with a query like 'search FoodData Central for a food', add the FoodData Central API from the Jentic API Directory, and your agent runs the keyword search then the FDC ID lookup to return the nutrient profile. To run it on your own infrastructure, install Jentic One from its GitHub repo.
