> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# USDA FoodData Central

> USDA nutrient composition data for foods: Foundation, SR Legacy, FNDDS survey foods and Branded Foods, searchable and by FDC ID.

![](https://mintcdn.com/webrouter/Wx0iBZkUGX_VAFTN/logo/data-apis/_default.svg?fit=max\&auto=format\&n=Wx0iBZkUGX_VAFTN\&q=85\&s=951f11a0968af0d8747e234a1ec1f32c)

[Web Catalog · Health](https://docs.webrouter.net/data-apis.md?category=health)

Needs&#x20;

`USDA_FDC_API_KEY`

Endpoints

4

Auth

Key in query

[Vendor docs](https://fdc.nal.usda.gov/api-guide/)

## Setup

| Variable | | What it is |
| - | - | - |
| `USDA_FDC_API_KEY` | required | A free data.gov API key (fdc.nal.usda.gov > Get an API Key). Sent as the api\_key query parameter. DEMO\_KEY works for trying it out, at 30 requests an hour and 50 a day per IP. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Rate limit: 1,000 requests per hour per IP by default; exceeding it blocks the key for an hour (429). X-RateLimit-Limit and X-RateLimit-Remaining headers show usage.
* Data is public domain (CC0); USDA asks for citation of FoodData Central.

## Endpoints

POST

Search foods

Foods matching keywords, with their nutrients, optionally limited to data types or a brand owner.

[Open](#usda-fdc-foods-search)

GET

Get a food

Full or abridged details and nutrients of one food by FDC ID.

[Open](#usda-fdc-food-get)

GET

Get several foods

Details of up to 20 foods by FDC ID in one call.

[Open](#usda-fdc-foods-get)

POST

List foods

A paged list of foods in abridged format, by data type.

[Open](#usda-fdc-foods-list)

### Search foods

POST

`/v1/foods/search`

`usda-fdc.foods.search`

Foods matching keywords, with their nutrients, optionally limited to data types or a brand owner.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`query` required</td><td>string</td><td>body</td><td>Search terms; FDC search operators allowed. Example `Cheddar cheese`</td></tr>
    <tr><td>`dataType`</td><td>array</td><td>body</td><td>Data types to include: Branded, Foundation, Survey (FNDDS), SR Legacy. Example `["Foundation", "SR Legacy"]`</td></tr>

    <tr>
      <td>
        `brandOwner`
      </td>

      <td>
        string
      </td>

      <td>
        body
      </td>

      <td>
        Brand owner filter; Branded Foods only.
      </td>
    </tr>

    <tr>
      <td>
        `pageSize`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Results per page, 1-200; default 50.
      </td>
    </tr>

    <tr>
      <td>
        `pageNumber`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Page number; offset is pageNumber \* pageSize.
      </td>
    </tr>

    <tr><td>`sortBy`</td><td>string</td><td>body</td><td>Sort field. One of `dataType.keyword`, `lowercaseDescription.keyword`, `fdcId`, `publishedDate`</td></tr>
    <tr><td>`sortOrder`</td><td>string</td><td>body</td><td>Sort direction; only with sortBy. One of `asc`, `desc`</td></tr>
  </tbody>
</table>

[Vendor docs](https://fdc.nal.usda.gov/api-spec/fdc_api.html) · Same job: [Canadian Nutrient File (Health Canada)](https://docs.webrouter.net/data-apis/health-canada-cnf.md#health-canada-cnf-foods-get)

```python Python theme={null}
router.call_data_api("usda-fdc.foods.search", {'query': 'Cheddar cheese', 'dataType': ['Foundation', 'SR Legacy']})
```

```text MCP theme={null}
call_data_api(endpoint="usda-fdc.foods.search", params={"query": "Cheddar cheese", "dataType": ["Foundation", "SR Legacy"]})
```

> [!NOTE]
>
> * A read over POST (a GET form with query parameters also exists); dataType must be an array.

### Get a food

GET

`/v1/food/{fdcId}`

`usda-fdc.food.get`

Full or abridged details and nutrients of one food by FDC ID.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`fdcId` required</td><td>string</td><td>path</td><td>FDC ID of the food. Example `534358`</td></tr>
    <tr><td>`format`</td><td>string</td><td>query</td><td>abridged or full (default). One of `abridged`, `full`</td></tr>
    <tr><td>`nutrients`</td><td>string</td><td>query</td><td>Up to 25 nutrient numbers, comma-separated, to return only those. Example `203,204,205`</td></tr>
  </tbody>
</table>

[Vendor docs](https://fdc.nal.usda.gov/api-spec/fdc_api.html) · Same job: [Canadian Nutrient File (Health Canada)](https://docs.webrouter.net/data-apis/health-canada-cnf.md#health-canada-cnf-nutrients-amounts)

```python Python theme={null}
router.call_data_api("usda-fdc.food.get", {'fdcId': '534358', 'nutrients': '203,204,205'})
```

```text MCP theme={null}
call_data_api(endpoint="usda-fdc.food.get", params={"fdcId": "534358", "nutrients": "203,204,205"})
```

### Get several foods

GET

`/v1/foods`

`usda-fdc.foods.get`

Details of up to 20 foods by FDC ID in one call.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`fdcIds` required</td><td>string</td><td>query</td><td>FDC IDs, comma-separated (up to 20). Example `534358,373052`</td></tr>
    <tr><td>`format`</td><td>string</td><td>query</td><td>abridged or full (default). One of `abridged`, `full`</td></tr>

    <tr>
      <td>
        `nutrients`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Up to 25 nutrient numbers, comma-separated.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://fdc.nal.usda.gov/api-spec/fdc_api.html) · Same job: [Canadian Nutrient File (Health Canada)](https://docs.webrouter.net/data-apis/health-canada-cnf.md#health-canada-cnf-nutrients-amounts)

```python Python theme={null}
router.call_data_api("usda-fdc.foods.get", {'fdcIds': '534358,373052'})
```

```text MCP theme={null}
call_data_api(endpoint="usda-fdc.foods.get", params={"fdcIds": "534358,373052"})
```

> [!NOTE]
>
> * Unknown IDs are dropped silently; no matches is an empty list.

### List foods

POST

`/v1/foods/list`

`usda-fdc.foods.list`

A paged list of foods in abridged format, by data type.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`dataType`</td><td>array</td><td>body</td><td>Data types to include: Branded, Foundation, Survey (FNDDS), SR Legacy. Example `["Foundation"]`</td></tr>

    <tr>
      <td>
        `pageSize`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Results per page, 1-200; default 50.
      </td>
    </tr>

    <tr>
      <td>
        `pageNumber`
      </td>

      <td>
        integer
      </td>

      <td>
        body
      </td>

      <td>
        Page number; offset is pageNumber \* pageSize.
      </td>
    </tr>

    <tr><td>`sortBy`</td><td>string</td><td>body</td><td>Sort field. One of `dataType.keyword`, `lowercaseDescription.keyword`, `fdcId`, `publishedDate`</td></tr>
    <tr><td>`sortOrder`</td><td>string</td><td>body</td><td>Sort direction; only with sortBy. One of `asc`, `desc`</td></tr>
  </tbody>
</table>

[Vendor docs](https://fdc.nal.usda.gov/api-spec/fdc_api.html) · Same job: [Canadian Nutrient File (Health Canada)](https://docs.webrouter.net/data-apis/health-canada-cnf.md#health-canada-cnf-foods-get)

```python Python theme={null}
router.call_data_api("usda-fdc.foods.list", {'dataType': ['Foundation']})
```

```text MCP theme={null}
call_data_api(endpoint="usda-fdc.foods.list", params={"dataType": ["Foundation"]})
```

> [!NOTE]
>
> * A read over POST.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.