# COT Index API
> The normalised Commitments-of-Traders positioning signal traders actually act on, computed live from the US CFTC public reporting API — no key. A raw COT net-position number means little on its own: "large speculators are +176,020 contracts net long gold" tells you nothing until you know whether that is high or low versus history. The COT Index fixes that by normalising each trader group's current net futures position to a 0-100 percentile over a lookback window (the classic Larry Williams 156-week / three-year COT Index): 100 = the most net-long that group has been in the window, 0 = the most net-short. Above 80 marks a crowded long extreme (contrarian bearish), below 20 a crowded short extreme (contrarian bullish). The index endpoint returns one market's COT Index for both the large speculators (non-commercials) and the commercial hedgers, with the current net, the window min/max, the week-over-week change and an extreme flag. The screener endpoint computes the index across a curated set of 17 FX, stock-index, metal, energy and grain futures and ranks them, surfacing which markets sit at a positioning extreme right now. This is the normalised positioning-signal cut — distinct from the raw COT-report feed (which serves the weekly long/short contract counts), and from the price, open-interest and options-positioning APIs. It turns the report into the signal.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/cotindex-api/..."
```

## Pricing
- **Free** (Free) — 750 calls/Mo, 2 req/s
- **Starter** ($13/Mo) — 15,500 calls/Mo, 6 req/s
- **Pro** ($38/Mo) — 84,000 calls/Mo, 16 req/s
- **Mega** ($85/Mo) — 470,000 calls/Mo, 40 req/s

## Endpoints

### Index

#### `GET /v1/index` — COT Index for one market (both trader groups)

**Parameters:**
- `market` (query, required, string) — Market key (gold, eur, sp500, wti, corn, ...) Example: `gold`
- `weeks` (query, optional, string) — Lookback weeks (26-156) Example: `156`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cotindex-api/v1/index?market=gold&weeks=156"
```

**Response:**
```json
{
    "data": {
        "comm": {
            "extreme": "neutral",
            "cot_index": 53.5,
            "weeks_used": 156,
            "net_position": -206345,
            "window_max_net": -90428,
            "window_min_net": -339706,
            "net_change_week": -20579,
            "cot_index_change": -8.3,
            "cot_index_prev_week": 61.8
        },
        "name": "Gold",
        "note": "COT Index normalises each group's net futures position to 0-100 over the last window_weeks (Larry Williams style). 100 = most net long in the window, 0 = most net short. Above 80 = crowded long (contrarian bearish); below 20 = crowded short (contrarian bullish). noncomm = large speculators, comm = commercial hedgers (often the opposite side). Source CFTC, updated weekly.",
        "class": "metal",
        "market": "gold",
        "source": "CFTC Commitments of Traders (legacy futures-only)",
        "noncomm": {
            "extreme": "neutral",
            "cot_index": 42.9,
            "weeks_used": 156,
            "net_position": 176020,
            "window_max_net": 315390,
            "window_min_net": 71433,
            "net_change_week": 21760,
            "cot_index_change": 8.9,
            "cot_index_prev_week": 34
        },
        "traders": 258,
        "report_date": "2026-06-02",
        "window_weeks": 156,
        "open_interest": 326052
    },
    "meta": {
        "timestamp": "2026-06-12T10:34:55.611Z",
        "request_id": "07ee73df-9933-4fa9-80
…(truncated, see openapi.json for full schema)
```

### Screener

#### `GET /v1/screener` — Rank markets by COT Index, flag crowded extremes

**Parameters:**
- `group` (query, optional, string) — noncomm (large speculators) or comm (commercials) Example: `noncomm`
- `class` (query, optional, string) — fx, index, metal, energy, grain or all Example: `all`
- `weeks` (query, optional, string) — Lookback weeks (26-156) Example: `156`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cotindex-api/v1/screener?group=noncomm&class=all&weeks=156"
```

**Response:**
```json
{
    "data": {
        "note": "Markets ranked by the large speculators (non-commercials) COT Index (0-100) over window_weeks. High = that group is near its most net-long of the window (crowded long, contrarian bearish); low = most net-short (crowded short, contrarian bullish). Source CFTC, updated weekly.",
        "class": "all",
        "count": 17,
        "group": "noncomm",
        "source": "CFTC Commitments of Traders (legacy futures-only)",
        "results": [
            {
                "name": "Copper",
                "rank": 1,
                "class": "metal",
                "market": "copper",
                "extreme": "bullish-extreme (net long crowded — contrarian bearish)",
                "available": true,
                "cot_index": 100,
                "report_date": "2026-06-02",
                "net_position": 78833,
                "net_change_week": 5793,
                "cot_index_change": 5.2
            },
            {
                "name": "Soybeans",
                "rank": 2,
                "class": "grain",
                "market": "soybeans",
                "extreme": "bullish-extreme (net long crowded — contrarian bearish)",
                "available": true,
                "cot_index": 85.3,
                "report_date": "2026-06-02",
                "net_position": 187784,
                "net_change_week": -16891,
                "cot_index_change": -3.7
            },
            {
                "name": "Australian D
…(truncated, see openapi.json for full schema)
```

### Markets

#### `GET /v1/markets` — Supported futures markets and CFTC codes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cotindex-api/v1/markets"
```

**Response:**
```json
{
    "data": {
        "note": "The futures markets the COT Index covers. Pass market= to /v1/index or class= to /v1/screener.",
        "count": 17,
        "groups": {
            "comm": "commercial hedgers",
            "noncomm": "large speculators (non-commercials)"
        },
        "source": "CFTC Commitments of Traders",
        "classes": [
            "fx",
            "index",
            "metal",
            "energy",
            "grain"
        ],
        "markets": [
            {
                "name": "Euro FX",
                "class": "fx",
                "market": "eur",
                "cftc_code": "099741"
            },
            {
                "name": "Japanese Yen",
                "class": "fx",
                "market": "jpy",
                "cftc_code": "097741"
            },
            {
                "name": "British Pound",
                "class": "fx",
                "market": "gbp",
                "cftc_code": "096742"
            },
            {
                "name": "Swiss Franc",
                "class": "fx",
                "market": "chf",
                "cftc_code": "092741"
            },
            {
                "name": "Canadian Dollar",
                "class": "fx",
                "market": "cad",
                "cftc_code": "090741"
            },
            {
                "name": "Australian Dollar",
                "class": "fx",
                "market": "aud",
                "cftc_code": "23274
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/cotindex-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "market is one of /v1/markets keys (gold, eur, sp500, ...). group is noncomm (large speculators, default) or comm (commercial hedgers). weeks is the lookback (26-156, default 156). class filters the screener to fx/index/metal/energy/grain (default all). COT updates Fridays; a 30-minute protective cache fronts the shared CFTC upstream.",
        "groups": [
            "noncomm",
            "comm"
        ],
        "source": "CFTC Commitments of Traders, legacy futures-only combined report (Socrata), live",
        "classes": [
            "fx",
            "index",
            "metal",
            "energy",
            "grain"
        ],
        "markets": 17,
        "service": "cotindex-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/index": "COT Index for one market, both trader groups, with extreme flag (market=gold, weeks=156).",
            "GET /v1/markets": "The supported futures markets and their CFTC codes.",
            "GET /v1/screener": "Rank markets by COT Index, flagging crowded extremes (group=noncomm, class=all, weeks=156)."
        },
        "description": "COT Index — the normalised Commitments-of-Traders positioning signal, computed live from the CFTC public reporting API (no key). It normalises each trader group's net futures position to a 0-100 percentile over a lookback window (classic 156-week COT Index): above 80 = crowded long (contrarian bearish), below 20 = crowde
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/cotindex-api
OpenAPI spec: https://www.oanor.com/api/cotindex-api/openapi.json
