{
  "openapi": "3.0.1",
  "info": {
    "title": "📈 CFTC COT Enhanced — Position Velocity & Percentile Tracker",
    "description": "Weekly CFTC Commitment of Traders with the percentile + velocity overlay every commodity desk builds in Excel: net position, 3-yr percentile, week-over-week velocity for managed money, swap dealers, commercials, non-reportables. Legacy, disaggregated, TFF families. From publicreporting.cftc.gov.",
    "version": "0.0",
    "x-build-id": "BzGaGbmafxc6IyJXC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nexgendata~cftc-cot-position-velocity-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nexgendata-cftc-cot-position-velocity-tracker",
        "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/nexgendata~cftc-cot-position-velocity-tracker/runs": {
      "post": {
        "operationId": "runs-sync-nexgendata-cftc-cot-position-velocity-tracker",
        "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/nexgendata~cftc-cot-position-velocity-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-nexgendata-cftc-cot-position-velocity-tracker",
        "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": {
          "commodity": {
            "title": "Commodity (contract market name or commodity name)",
            "type": "string",
            "description": "Which CFTC futures market to pull positioning history for. Matching is case-insensitive and runs in this order: (1) exact match on `contract_market_name` (e.g. `CRUDE OIL, LIGHT SWEET-WTI`), (2) LIKE %query% on `contract_market_name`, (3) LIKE %query% on `commodity_name` (e.g. `CRUDE OIL`, `GOLD`, `NATURAL GAS`, `SILVER`, `WHEAT`, `CORN`, `SOYBEANS`, `COTTON`, `SUGAR`, `COFFEE`, `LIVE CATTLE`). Default = `WTI CRUDE OIL` (resolves to the NYMEX / ICE Europe WTI futures contract). For a precise single-contract pull, use the exact `contract_market_name` from publicreporting.cftc.gov.",
            "default": "WTI CRUDE OIL"
          },
          "report_type": {
            "title": "COT report family",
            "enum": [
              "legacy",
              "disaggregated",
              "financial"
            ],
            "type": "string",
            "description": "Which CFTC COT report family to query. `legacy` = the classic Commercial / Non-Commercial / Non-Reportable breakdown (every futures contract, all commodity groups). `disaggregated` = the post-2009 breakdown that splits Non-Commercial into Managed Money + Other Reportables and Commercial into Producer/Merchant + Swap Dealers — the standard view for energy, metals, ag commodities. `financial` = the Traders in Financial Futures (TFF) breakdown for financial contracts (rates, equity indices, FX) splitting Asset Manager / Leveraged Funds / Dealer / Other Reportables. Default = `disaggregated`.",
            "default": "disaggregated"
          },
          "weeks_back": {
            "title": "Weeks of history to emit",
            "minimum": 1,
            "maximum": 260,
            "type": "integer",
            "description": "Number of weekly COT reports (most recent first) to emit per (contract × category). Minimum 1, maximum 260 (= 5 years of weekly history). Default = 52 (one year). The actor ALWAYS pulls at least 156 prior weeks BEFORE the emit window for the 3-year percentile rank calculation, regardless of this setting.",
            "default": 52
          },
          "category": {
            "title": "Trader category to emit",
            "enum": [
              "managed_money",
              "swap_dealers",
              "commercials",
              "non_reportable",
              "all"
            ],
            "type": "string",
            "description": "Which trader bucket to emit positions for. `all` = emit one row per category that the chosen report_type exposes (5 categories for disaggregated/financial, 3 for legacy). `managed_money` = the hedge-fund / CTA / commodity-pool bucket (disaggregated + financial only). `swap_dealers` = bank swap-dealer hedge bucket (disaggregated + financial). `commercials` = producer/merchant/processor (disaggregated), commercial hedger (legacy), or asset manager/institutional (financial TFF). `non_reportable` = small speculator residual under the CFTC reporting threshold (all three report families). When the chosen category does not exist for the chosen report_type, the actor falls back to the first valid category and logs a warning.",
            "default": "all"
          },
          "max_records": {
            "title": "Max records emitted",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Hard ceiling on dataset rows emitted across all (contract × category × week) combinations. Default = 100 (good for one commodity × one category × 52 weeks, or one commodity × 5 categories × 20 weeks). Raise this for multi-commodity sweeps or full-history backfills. Maximum 2000.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}