USDA FoodData Central API — Foods

USDA FoodData Central API — Foods. 5 operations. Lead operation: Get Food by FDC ID. Self-contained Naftiko capability covering one Usda Agricultural Research Service Ars business surface.

Run with Naftiko Usda Agricultural Research Service ArsFoods

What You Can Do

GET
Getfood — Get Food by FDC ID
/v1/food/{fdcid}
GET
Getfoodsget — Get Multiple Foods by FDC IDs
/v1/foods
POST
Getfoodspost — Get Multiple Foods by FDC IDs (POST)
/v1/foods
GET
Getfoodslistget — List Foods (Paginated Abridged Format)
/v1/foods/list
POST
Getfoodslistpost — List Foods (POST)
/v1/foods/list

MCP Tools

get-food-fdc-id

Get Food by FDC ID

read-only idempotent
get-multiple-foods-fdc-ids

Get Multiple Foods by FDC IDs

read-only idempotent
get-multiple-foods-fdc-ids-2

Get Multiple Foods by FDC IDs (POST)

read-only
list-foods-paginated-abridged-format

List Foods (Paginated Abridged Format)

read-only idempotent
list-foods-post

List Foods (POST)

read-only

Capability Spec

usda-ars-fooddata-central-foods.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: USDA FoodData Central API — Foods
  description: 'USDA FoodData Central API — Foods. 5 operations. Lead operation: Get Food by FDC ID. Self-contained Naftiko
    capability covering one Usda Agricultural Research Service Ars business surface.'
  tags:
  - Usda Agricultural Research Service Ars
  - Foods
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    USDA_AGRICULTURAL_RESEARCH_SERVICE_ARS_API_KEY: USDA_AGRICULTURAL_RESEARCH_SERVICE_ARS_API_KEY
capability:
  consumes:
  - type: http
    namespace: usda-ars-fooddata-central-foods
    baseUri: https://api.nal.usda.gov/fdc/v1
    description: USDA FoodData Central API — Foods business capability. Self-contained, no shared references.
    resources:
    - name: food-fdcId
      path: /food/{fdcId}
      operations:
      - name: getfood
        method: GET
        description: Get Food by FDC ID
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: fdcId
          in: path
          type: integer
          description: The unique FoodData Central ID
          required: true
        - name: format
          in: query
          type: string
          description: Optional format. Default is abridged; 'full' returns all nutrient data for the food.
        - name: nutrients
          in: query
          type: array
          description: Optional list of nutrient numbers to return
        - name: api_key
          in: query
          type: string
          description: Your data.gov API key (can also be passed as X-Api-Key header)
    - name: foods
      path: /foods
      operations:
      - name: getfoodsget
        method: GET
        description: Get Multiple Foods by FDC IDs
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: fdcIds
          in: query
          type: array
          description: List of FDC IDs (comma-separated, max 20)
          required: true
        - name: format
          in: query
          type: string
        - name: nutrients
          in: query
          type: array
        - name: api_key
          in: query
          type: string
      - name: getfoodspost
        method: POST
        description: Get Multiple Foods by FDC IDs (POST)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: foods-list
      path: /foods/list
      operations:
      - name: getfoodslistget
        method: GET
        description: List Foods (Paginated Abridged Format)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: dataType
          in: query
          type: array
          description: Filter by data type
        - name: pageSize
          in: query
          type: integer
          description: Number of results per page (max 200)
        - name: pageNumber
          in: query
          type: integer
          description: Page number for pagination
        - name: sortBy
          in: query
          type: string
          description: Sort field
        - name: sortOrder
          in: query
          type: string
        - name: api_key
          in: query
          type: string
      - name: getfoodslistpost
        method: POST
        description: List Foods (POST)
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    authentication:
      type: apikey
      key: api_key
      value: '{{env.USDA_AGRICULTURAL_RESEARCH_SERVICE_ARS_API_KEY}}'
      placement: query
  exposes:
  - type: rest
    namespace: usda-ars-fooddata-central-foods-rest
    port: 8080
    description: REST adapter for USDA FoodData Central API — Foods. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/food/{fdcid}
      name: food-fdcid
      description: REST surface for food-fdcId.
      operations:
      - method: GET
        name: getfood
        description: Get Food by FDC ID
        call: usda-ars-fooddata-central-foods.getfood
        with:
          fdcId: rest.fdcId
          format: rest.format
          nutrients: rest.nutrients
          api_key: rest.api_key
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/foods
      name: foods
      description: REST surface for foods.
      operations:
      - method: GET
        name: getfoodsget
        description: Get Multiple Foods by FDC IDs
        call: usda-ars-fooddata-central-foods.getfoodsget
        with:
          fdcIds: rest.fdcIds
          format: rest.format
          nutrients: rest.nutrients
          api_key: rest.api_key
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: getfoodspost
        description: Get Multiple Foods by FDC IDs (POST)
        call: usda-ars-fooddata-central-foods.getfoodspost
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/foods/list
      name: foods-list
      description: REST surface for foods-list.
      operations:
      - method: GET
        name: getfoodslistget
        description: List Foods (Paginated Abridged Format)
        call: usda-ars-fooddata-central-foods.getfoodslistget
        with:
          dataType: rest.dataType
          pageSize: rest.pageSize
          pageNumber: rest.pageNumber
          sortBy: rest.sortBy
          sortOrder: rest.sortOrder
          api_key: rest.api_key
        outputParameters:
        - type: object
          mapping: $.
      - method: POST
        name: getfoodslistpost
        description: List Foods (POST)
        call: usda-ars-fooddata-central-foods.getfoodslistpost
        with:
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: usda-ars-fooddata-central-foods-mcp
    port: 9090
    transport: http
    description: MCP adapter for USDA FoodData Central API — Foods. One tool per consumed operation, routed inline through
      this capability's consumes block.
    tools:
    - name: get-food-fdc-id
      description: Get Food by FDC ID
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: usda-ars-fooddata-central-foods.getfood
      with:
        fdcId: tools.fdcId
        format: tools.format
        nutrients: tools.nutrients
        api_key: tools.api_key
      outputParameters:
      - type: object
        mapping: $.
    - name: get-multiple-foods-fdc-ids
      description: Get Multiple Foods by FDC IDs
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: usda-ars-fooddata-central-foods.getfoodsget
      with:
        fdcIds: tools.fdcIds
        format: tools.format
        nutrients: tools.nutrients
        api_key: tools.api_key
      outputParameters:
      - type: object
        mapping: $.
    - name: get-multiple-foods-fdc-ids-2
      description: Get Multiple Foods by FDC IDs (POST)
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: usda-ars-fooddata-central-foods.getfoodspost
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: list-foods-paginated-abridged-format
      description: List Foods (Paginated Abridged Format)
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: usda-ars-fooddata-central-foods.getfoodslistget
      with:
        dataType: tools.dataType
        pageSize: tools.pageSize
        pageNumber: tools.pageNumber
        sortBy: tools.sortBy
        sortOrder: tools.sortOrder
        api_key: tools.api_key
      outputParameters:
      - type: object
        mapping: $.
    - name: list-foods-post
      description: List Foods (POST)
      hints:
        readOnly: true
        destructive: false
        idempotent: false
      call: usda-ars-fooddata-central-foods.getfoodslistpost
      with:
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.