{
  "openapi": "3.0.1",
  "info": {
    "title": "CFTC COT Report – Commitments of Traders & COT Index",
    "description": "Official CFTC Commitments of Traders data (legacy, disaggregated, TFF) for gold, oil, FX, indices, rates, crypto and more: net positions, weekly changes, COT index (26/52/156 weeks) and positioning alerts. Pay per row.",
    "version": "0.1",
    "x-build-id": "dWPyiSOHo09XXt4b6"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~cftc-cot-report/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-cftc-cot-report",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/gazidev~cftc-cot-report/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-cftc-cot-report",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/gazidev~cftc-cot-report/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-cftc-cot-report",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "report": {
            "title": "Report type",
            "enum": [
              "legacy",
              "disaggregated",
              "tff"
            ],
            "type": "string",
            "description": "Legacy = Commercial / Non-commercial / Non-reportable (all markets). Disaggregated = Producer-Merchant / Swap Dealer / Managed Money / Other (commodities only). TFF (Traders in Financial Futures) = Dealer / Asset Manager / Leveraged Funds / Other (FX, indices, rates, crypto).",
            "default": "legacy"
          },
          "futuresOnly": {
            "title": "Futures only",
            "type": "boolean",
            "description": "On = futures-only report. Off = futures and options combined report.",
            "default": true
          },
          "markets": {
            "title": "Markets (name contains or CFTC code)",
            "type": "array",
            "description": "Market name fragments as CFTC writes them (e.g. 'GOLD - COMMODITY EXCHANGE', 'WTI-PHYSICAL', 'EURO FX', 'E-MINI S&P 500') or 6-character CFTC contract codes (e.g. 088691 gold, 067651 WTI, 099741 euro). Leave empty together with presets to get every market.",
            "items": {
              "type": "string"
            }
          },
          "presets": {
            "title": "Market groups",
            "type": "array",
            "description": "Ready-made groups of flagship contracts. FX, equity indices, rates and crypto are in the legacy and TFF reports; metals, energy, grains, softs and livestock in legacy and disaggregated.",
            "items": {
              "type": "string",
              "enum": [
                "major-fx",
                "metals",
                "energy",
                "equity-indices",
                "rates",
                "crypto",
                "grains",
                "softs",
                "livestock"
              ],
              "enumTitles": [
                "Major FX + USD index",
                "Metals (gold, silver, copper, platinum, palladium)",
                "Energy (WTI, Brent, nat gas, RBOB, ULSD)",
                "Equity indices (S&P, Nasdaq, Dow, Russell, Nikkei, VIX)",
                "Rates (Treasuries, SOFR, Fed funds)",
                "Crypto (CME bitcoin, ether)",
                "Grains & oilseeds",
                "Softs (sugar, coffee, cocoa, cotton, OJ)",
                "Livestock"
              ]
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "latest",
              "history",
              "alerts"
            ],
            "type": "string",
            "description": "latest = newest report only (one row per market). history = every week in the range. alerts = only market-weeks that trigger an alert (extreme COT index, net position flip, big weekly net change).",
            "default": "latest"
          },
          "weeks": {
            "title": "Weeks back",
            "minimum": 1,
            "maximum": 1100,
            "type": "integer",
            "description": "Number of most recent weekly reports to return in history/alerts mode (1 = newest only; use 1 for a weekly alert flow). Ignored when Date from is set.",
            "default": 4
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Optional first report date (YYYY-MM-DD). Data goes back to 1986 (legacy) / 2006 (disaggregated, TFF)."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Optional last report date (YYYY-MM-DD). Default: newest report."
          },
          "cotIndexWeeks": {
            "title": "COT index lookback (weeks)",
            "minimum": 4,
            "maximum": 520,
            "type": "integer",
            "description": "COT index = (net - min net) / (max net - min net) x 100 over this many weeks, per trader class. Common: 26, 52, 156 (3 years).",
            "default": 52
          },
          "alertCotIndexHigh": {
            "title": "Alert: COT index at or above",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Alert when the speculator or hedger COT index is at or above this value.",
            "default": 90
          },
          "alertCotIndexLow": {
            "title": "Alert: COT index at or below",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Alert when the speculator or hedger COT index is at or below this value.",
            "default": 10
          },
          "alertNetChangePctOI": {
            "title": "Alert: weekly speculator net change (% of open interest)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Alert when the speculator net position moved by at least this % of open interest in one week. 0 = off.",
            "default": 5
          },
          "alertOnNetFlip": {
            "title": "Alert when speculators flip net long/short",
            "type": "boolean",
            "description": "Alert when the speculator net position crosses zero.",
            "default": true
          },
          "minOpenInterest": {
            "title": "Minimum open interest",
            "minimum": 0,
            "type": "integer",
            "description": "Skip small/illiquid markets below this open interest (contracts). Useful for all-market alert scans, e.g. 20000.",
            "default": 0
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum rows saved (and charged). 0 = no limit.",
            "default": 200
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}