# CFTC COT Report: Positioning + COT Index (`gabriel_cr/cftc-cot-positioning`) Actor

Official CFTC Commitments of Traders data (Legacy, Disaggregated, TFF) as tidy weekly rows: net positions per trader group, weekly changes, % of open interest and 26/52/156-week COT Index.

- **URL**: https://apify.com/gabriel_cr/cftc-cot-positioning.md
- **Developed by:** [Gabriel Clemente](https://apify.com/gabriel_cr) (community)
- **Categories:** Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## CFTC COT Positioning + COT Index

Official CFTC Commitments of Traders data as tidy weekly rows, ready for charts, spreadsheets and trading models. No API key and no login are needed. The data comes straight from the CFTC's public data portal.

### What you get

One row per **market × week × trader group**:

- `long`, `short`, `spread`, `net` (long − short) contracts
- `net_change_wow` (week-over-week change in net), plus the official `long_change_wow` / `short_change_wow`
- `pct_oi_long`, `pct_oi_short`: share of open interest (official CFTC figures)
- `traders_long`, `traders_short`: number of traders (CFTC hides counts below 4 traders, so these are null)
- **COT Index** for 26, 52 and 156 weeks: where this week's net position sits in its range (0 = most bearish in the window, 100 = most bullish). Windows are configurable.
- `open_interest`, `report_date`, `market`, `cftc_code`, `source_url` (the exact API query) and `source_dataset`

### Reports

- **Legacy**: commercials vs non-commercials (large speculators) vs small traders
- **Disaggregated** (commodities): producers/merchants, swap dealers, managed money, other reportables
- **Traders in Financial Futures** (FX, indices, rates, crypto): dealers, asset managers, leveraged funds, other reportables
- Futures-only, or futures and options combined

### Input

- `presets`: `major_fx` (EUR, GBP, JPY, CHF, CAD, AUD, NZD, MXN, DXY), `metals` (gold, silver, copper), `energy` (WTI, natural gas), `us_indices` (S\&P, Nasdaq, Dow, Russell), `crypto` (BTC, ETH), `us_rates` (10Y note, T-bond)
- `markets`: CFTC codes (`088691`) or name searches (`GOLD`)
- `reportType`, `futuresOnly`, `dateFrom`/`dateTo` or `lastNWeeks`, `cotIndexWeeks`

### Good to know

- The COT Index needs a full window of history. The actor fetches the extra weeks automatically, and you aren't charged for them. If a market is younger than the window, the index is null rather than guessed.
- The CFTC publishes every Friday, with positions as of Tuesday.
- Data: U.S. Commodity Futures Trading Commission, public domain. Source: publicreporting.cftc.gov.

### Pricing

Pay per event: `cot-row` per output row.

### Legal note

Data: U.S. Commodity Futures Trading Commission (public domain; CFTC acknowledged as source). This actor is not affiliated with the CFTC. Informational only, not investment advice.

# Actor input Schema

## `presets` (type: `array`):

Quick picks.

## `markets` (type: `array`):

CFTC contract codes (e.g. 088691) or name searches (e.g. GOLD, 'CRUDE OIL'). Name searches match the official market name.

## `reportType` (type: `string`):

Report type.

## `futuresOnly` (type: `boolean`):

Off = futures and options combined.

## `lastNWeeks` (type: `integer`):

Used when dateFrom is empty.

## `dateFrom` (type: `string`):

Date from (YYYY-MM-DD).

## `dateTo` (type: `string`):

Date to (YYYY-MM-DD).

## `cotIndexWeeks` (type: `array`):

Lookback windows in weeks.

## Actor input object example

```json
{
  "presets": [
    "major_fx"
  ],
  "markets": [],
  "reportType": "legacy",
  "futuresOnly": true,
  "lastNWeeks": 12,
  "cotIndexWeeks": [
    26,
    52,
    156
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

Weekly COT positioning rows (one per market, report date and trader group) in the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gabriel_cr/cftc-cot-positioning").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("gabriel_cr/cftc-cot-positioning").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call gabriel_cr/cftc-cot-positioning --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gabriel_cr/cftc-cot-positioning"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/WXr6z6NsKfCUZs2GW/builds/gi0YAujVKderiwIz8/openapi.json
