United States Department of Agriculture Foods API

Food search and retrieval operations

Operations 3

GET /foods/search Search Foods #
GET /food/{fdcId} Get Food By FDC ID #
GET /foods Get Multiple Foods By FDC IDs #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/united-states-department-of-agriculture-foods-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

united-states-department-of-agriculture-foods-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: USDA FoodData Central Foods API
  description: The FoodData Central API provides REST access to FoodData Central (FDC), the USDA's integrated data system providing expanded nutrient profile data linked to agricultural and experimental research. Covers Foundation Foods, SR Legacy, FNDDS, Branded Foods, and Experimental Foods. An API key from api.data.gov is required.
  version: 1.0.0
  contact:
    name: USDA FoodData Central
    url: https://fdc.nal.usda.gov/
    email: FSISWebmaster@usda.gov
  license:
    name: Public Domain
    url: https://www.usa.gov/government-works
servers:
- url: https://api.nal.usda.gov/fdc/v1
  description: USDA FoodData Central API
tags:
- name: Foods
  description: Food search and retrieval operations
paths:
  /foods/search:
    get:
      operationId: searchFoods
      summary: Search Foods
      description: Search for foods using keywords and filters. Returns paginated food items matching the query across all food data types.
      tags:
      - Foods
      parameters:
      - name: api_key
        in: query
        description: API key from api.data.gov
        required: true
        schema:
          type: string
        example: DEMO_KEY
      - name: query
        in: query
        description: Search terms to find foods
        required: true
        schema:
          type: string
        example: cheddar cheese
      - name: dataType
        in: query
        description: Filter by food data type
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - Foundation
            - SR Legacy
            - Branded
            - Survey (FNDDS)
            - Experimental
        style: form
        explode: false
      - name: pageSize
        in: query
        description: Number of results per page (max 200)
        required: false
        schema:
          type: integer
          default: 50
          maximum: 200
      - name: pageNumber
        in: query
        description: Page number for paginated results
        required: false
        schema:
          type: integer
          default: 1
      - name: sortBy
        in: query
        description: Field to sort results by
        required: false
        schema:
          type: string
          enum:
          - dataType.keyword
          - lowercaseDescription.keyword
          - fdcId
          - publishedDate
      - name: sortOrder
        in: query
        description: Sort direction
        required: false
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Successful food search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResult'
        '400':
          description: Invalid parameters
        '403':
          description: Invalid or missing API key
  /food/{fdcId}:
    get:
      operationId: getFoodById
      summary: Get Food By FDC ID
      description: Retrieve detailed nutrient data and food information for a specific food item identified by its FDC ID.
      tags:
      - Foods
      parameters:
      - name: fdcId
        in: path
        description: FoodData Central unique food identifier
        required: true
        schema:
          type: integer
        example: 454004
      - name: api_key
        in: query
        description: API key from api.data.gov
        required: true
        schema:
          type: string
        example: DEMO_KEY
      - name: format
        in: query
        description: Nutrient data format to return
        required: false
        schema:
          type: string
          enum:
          - abridged
          - full
      - name: nutrients
        in: query
        description: Filter to specific nutrient IDs (up to 25)
        required: false
        schema:
          type: array
          items:
            type: integer
        style: form
        explode: true
      responses:
        '200':
          description: Food item with nutrient data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FoodItem'
        '404':
          description: Food not found
  /foods:
    get:
      operationId: getFoodsByIds
      summary: Get Multiple Foods By FDC IDs
      description: Retrieve nutrient data for multiple food items by providing a list of FDC IDs.
      tags:
      - Foods
      parameters:
      - name: api_key
        in: query
        description: API key from api.data.gov
        required: true
        schema:
          type: string
        example: DEMO_KEY
      - name: fdcIds
        in: query
        description: Comma-separated list of FDC IDs (max 20)
        required: true
        schema:
          type: array
          items:
            type: integer
        style: form
        explode: false
        example:
        - 454004
        - 534358
      - name: format
        in: query
        description: Nutrient data format to return
        required: false
        schema:
          type: string
          enum:
          - abridged
          - full
      - name: nutrients
        in: query
        description: Filter to specific nutrient IDs
        required: false
        schema:
          type: array
          items:
            type: integer
        style: form
        explode: true
      responses:
        '200':
          description: List of food items with nutrient data
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FoodItem'
components:
  schemas:
    SearchResult:
      type: object
      description: Paginated food search results
      properties:
        totalHits:
          type: integer
          description: Total number of matching foods
        currentPage:
          type: integer
          description: Current page number
        totalPages:
          type: integer
          description: Total number of pages
        pageList:
          type: array
          items:
            type: integer
          description: List of page numbers
        foods:
          type: array
          items:
            $ref: '#/components/schemas/SearchResultFood'
    SearchResultFood:
      type: object
      description: Food item from search results
      properties:
        fdcId:
          type: integer
          description: FoodData Central unique identifier
        description:
          type: string
          description: Food item description
        dataType:
          type: string
          description: Type of food data source
        brandOwner:
          type: string
          description: Brand owner (for branded foods)
        gtinUpc:
          type: string
          description: GTIN or UPC barcode
        publishedDate:
          type: string
          format: date
          description: Date food was published in FDC
        score:
          type: number
          description: Search relevance score
    FoodItem:
      type: object
      description: Detailed food item with nutrient data
      properties:
        fdcId:
          type: integer
          description: FoodData Central unique identifier
        description:
          type: string
          description: Food item description
        dataType:
          type: string
          description: Type of food data source
        publicationDate:
          type: string
          format: date
          description: Publication date
        foodClass:
          type: string
          description: Food classification
        foodNutrients:
          type: array
          items:
            $ref: '#/components/schemas/FoodNutrient'
        foodAttributes:
          type: array
          items:
            type: object
        inputFoods:
          type: array
          items:
            type: object
        labelNutrients:
          type: object
          description: Nutrition facts label data (branded foods)
    FoodNutrient:
      type: object
      description: Nutrient value for a food item
      properties:
        nutrientId:
          type: integer
          description: Nutrient identifier
        nutrientName:
          type: string
          description: Name of the nutrient
        nutrientNumber:
          type: string
          description: USDA nutrient number
        unitName:
          type: string
          description: Unit of measure (g, mg, kcal, etc.)
        value:
          type: number
          description: Amount of nutrient per 100g of food
        derivationCode:
          type: string
          description: Method used to derive the nutrient value
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: api_key
      description: API key from https://api.data.gov/signup/