{
  "openapi": "3.0.1",
  "info": {
    "title": "CFTC COT Scraper: Positions and Extremes",
    "description": "Scrape the weekly CFTC Commitments of Traders report for every futures market. Get long, short and net positions of each trader group with weekly changes, percentile, COT index, z-score and concentration. Screen markets at extremes, with history. Export to CSV or Excel.",
    "version": "1.0",
    "x-build-id": "XPOknPreUkmrsZu4b"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parselab~cftc-commitments-of-traders-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parselab-cftc-commitments-of-traders-scraper",
        "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/parselab~cftc-commitments-of-traders-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parselab-cftc-commitments-of-traders-scraper",
        "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/parselab~cftc-commitments-of-traders-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parselab-cftc-commitments-of-traders-scraper",
        "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": {
          "maxItems": {
            "title": "Max Items",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000."
          },
          "mode": {
            "title": "What to collect",
            "enum": [
              "positions",
              "extremes",
              "markets"
            ],
            "type": "string",
            "description": "Positions returns the weekly positions of every trader group per market. Extremes returns only the markets where a speculator group sits at an extreme compared with its own history. Markets returns the list of markets with codes and report dates.",
            "default": "positions"
          },
          "reportType": {
            "title": "Report type",
            "enum": [
              "disaggregated",
              "financial",
              "legacy"
            ],
            "type": "string",
            "description": "Disaggregated splits traders into producers, swap dealers, managed money and others and fits commodities. Financial splits them into dealers, asset managers and leveraged funds and fits currencies, rates and stock indexes. Legacy has commercial and non-commercial traders for every market.",
            "default": "disaggregated"
          },
          "futuresAndOptionsCombined": {
            "title": "Include options",
            "type": "boolean",
            "description": "Off uses futures only, which is the classic report. On adds the futures equivalent of options positions.",
            "default": false
          },
          "markets": {
            "title": "Markets",
            "type": "array",
            "description": "Part of a market name such as GOLD, CRUDE OIL, EURO FX, BITCOIN or S&P 500, or the CFTC contract code such as 088691. Leave empty for all markets.",
            "items": {
              "type": "string"
            }
          },
          "commodityGroups": {
            "title": "Commodity groups",
            "type": "array",
            "description": "Part of a group or subgroup name such as AGRICULTURE, NATURAL RESOURCES, FINANCIAL INSTRUMENTS, METALS, ENERGY or GRAINS.",
            "items": {
              "type": "string"
            }
          },
          "exchanges": {
            "title": "Exchanges",
            "type": "array",
            "description": "Part of an exchange name or its code, for example CME, CHICAGO BOARD OF TRADE, NEW YORK MERCANTILE EXCHANGE or ICE.",
            "items": {
              "type": "string"
            }
          },
          "weeksBack": {
            "title": "Weeks of history",
            "minimum": 1,
            "maximum": 1500,
            "type": "integer",
            "description": "Positions mode. How many weekly reports to return per market. 1 returns only the latest report. For example 52 returns one year.",
            "default": 1
          },
          "dateFrom": {
            "title": "Reports from",
            "type": "string",
            "description": "Positions mode. First report date, in the form 2025-01-07. It replaces the weeks of history."
          },
          "dateTo": {
            "title": "Reports until",
            "type": "string",
            "description": "Last report date. Leave empty for the latest report."
          },
          "lookbackWeeks": {
            "title": "Weeks for percentile and COT index",
            "minimum": 8,
            "maximum": 520,
            "type": "integer",
            "description": "Each trader group gets a percentile, a COT index and a score compared with this many weeks before the report. 156 weeks is three years, 260 is five years.",
            "default": 156
          },
          "extremeThreshold": {
            "title": "Extreme percentile",
            "minimum": 51,
            "maximum": 99,
            "type": "integer",
            "description": "Extremes mode. A speculator group is an extreme when its net position is at or above this percentile (net long) or at or below 100 minus it (net short). Default 90.",
            "default": 90
          },
          "minOpenInterest": {
            "title": "Minimum open interest",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets and weeks with fewer open contracts than this, which hides thin markets. For example 20000."
          },
          "sortBy": {
            "title": "Sort rows by",
            "enum": [
              "openInterest",
              "name",
              "extremeness"
            ],
            "type": "string",
            "description": "For latest reports and extremes. Extremeness is only used in extremes mode.",
            "default": "openInterest"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}