Commodity Futures Trading Commission Legacy API

Legacy COT report format

OpenAPI Specification

commodity-futures-trading-commission-legacy-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: CFTC Commitments of Traders () SODA COT Legacy API
  description: OpenAPI description of the public Socrata Open Data API (SODA) endpoints that the U.S. Commodity Futures Trading Commission exposes through its Public Reporting Environment at publicreporting.cftc.gov. These datasets publish weekly Commitments of Traders (COT) positions for futures and futures plus options, in Legacy, Disaggregated, and Traders in Financial Futures (TFF) report formats.
  version: 1.0.0
  contact:
    name: CFTC Public Reporting
    url: https://publicreporting.cftc.gov/
servers:
- url: https://publicreporting.cftc.gov/resource
  description: CFTC Public Reporting Environment SODA endpoint
tags:
- name: Legacy
  description: Legacy COT report format
paths:
  /6dca-aqww.json:
    get:
      operationId: getLegacyFuturesOnly
      summary: Legacy Commitments of Traders (Futures Only)
      description: Weekly Legacy COT report covering futures-only positions for reportable contracts.
      tags:
      - Legacy
      parameters:
      - $ref: '#/components/parameters/SocrataLimit'
      - $ref: '#/components/parameters/SocrataOffset'
      - $ref: '#/components/parameters/SocrataSelect'
      - $ref: '#/components/parameters/SocrataWhere'
      - $ref: '#/components/parameters/SocrataOrder'
      responses:
        '200':
          description: An array of Legacy futures-only COT records
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CotLegacyRow'
  /jun7-fc8e.json:
    get:
      operationId: getLegacyCombined
      summary: Legacy Commitments of Traders (Combined)
      description: Weekly Legacy COT report covering combined futures and options positions.
      tags:
      - Legacy
      parameters:
      - $ref: '#/components/parameters/SocrataLimit'
      - $ref: '#/components/parameters/SocrataOffset'
      - $ref: '#/components/parameters/SocrataSelect'
      - $ref: '#/components/parameters/SocrataWhere'
      - $ref: '#/components/parameters/SocrataOrder'
      responses:
        '200':
          description: An array of Legacy combined COT records
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CotLegacyRow'
components:
  parameters:
    SocrataOffset:
      name: $offset
      in: query
      description: Number of rows to skip for paging
      schema:
        type: integer
        minimum: 0
    SocrataSelect:
      name: $select
      in: query
      description: SoQL select clause specifying which columns to return
      schema:
        type: string
    SocrataWhere:
      name: $where
      in: query
      description: SoQL where clause for filtering rows
      schema:
        type: string
    SocrataLimit:
      name: $limit
      in: query
      description: Maximum number of rows to return (Socrata default 1000, max 50000)
      schema:
        type: integer
        minimum: 1
        maximum: 50000
        default: 1000
    SocrataOrder:
      name: $order
      in: query
      description: SoQL order by clause
      schema:
        type: string
  schemas:
    CotLegacyRow:
      type: object
      properties:
        market_and_exchange_names:
          type: string
        report_date_as_yyyy_mm_dd:
          type: string
          format: date
        cftc_contract_market_code:
          type: string
        cftc_market_code:
          type: string
        cftc_region_code:
          type: string
        cftc_commodity_code:
          type: string
        open_interest_all:
          type: string
        noncomm_positions_long_all:
          type: string
        noncomm_positions_short_all:
          type: string
        comm_positions_long_all:
          type: string
        comm_positions_short_all:
          type: string
        nonrept_positions_long_all:
          type: string
        nonrept_positions_short_all:
          type: string