> ## Documentation Index
> Fetch the complete documentation index at: https://docs.darvas.app/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs cover the Darvas financial data API, its MCP server, data API and Darvas Pro+ webhooks, and Pine Script custom indicators for Darvas charts.
> https://docs.darvas.app/llms.txt lists every indexed page with a summary, and https://docs.darvas.app/llms-full.txt holds them in one file. Add .md to any page URL to read that page as Markdown. The lookup lists of tickers, types and series are named at https://docs.darvas.app/ai-agents.
> The docs MCP server https://docs.darvas.app/mcp searches and reads these docs. It needs no key.
> Call the REST API at https://api.darvas.app/v1. Send the API key, which starts with dvk_, in the X-API-KEY header or as Authorization: Bearer. The OpenAPI 3.1 spec of all 168 operations is https://docs.darvas.app/openapi.yaml.
> Name a company by ticker or cik. A share class takes a dot or a dash, so BRK.B and BRK-B name the same shares. Dates are YYYY-MM-DD.
> A list answer holds one page. Request its next_page_url as it is until the answer has none. limit counts rows across all pages.
> Errors are JSON with a stable error code and a message: 400 VALIDATION_ERROR, 401 UNAUTHORIZED, 403 PLAN_REQUIRED, 404 NOT_FOUND, 429 RATE_LIMITED or QUOTA_EXCEEDED, 500 INTERNAL_ERROR and 503 UNAVAILABLE. On a 429, wait the seconds in Retry-After. 1 credit = 1 successful call: a 2xx answer with data costs one credit however many rows it holds (at most 1,000 a page), and empty answers, errors and FINRA /short-volume cost 0 credits.
> The Financial Data MCP server is https://api.darvas.app/mcp (Streamable HTTP, protocol 2025-11-25, the same API key in X-API-KEY or as a Bearer token). tools/list answers 8 flagship tools plus search_data_tools and call_data_tool by default; ?mode=full lists all 164 tools and ?toolsets=sec,crypto,macro lists domains. Every tool is callable by name, takes response_format (json, compact or tsv) and fields, and a list answer's cursor value goes in the cursor argument. The darvas://catalog/* resources cost 0 credits. Setup for each client is at https://docs.darvas.app/mcp-server.
> The data API covers SEC filers and their filings, statements, XBRL facts, debt maturities, ownership and earnings, US stock prices, technicals and FINRA short volume, macro series and a global economic calendar.
> Its crypto data covers prices, indices, order books, order flow, volume profiles, derivatives, options, liquidations, spot ETF flows and a screener across 9 exchanges. It also covers DeFi protocols, stablecoins, yields and DEX pairs, and Polymarket, Kalshi and OKX prediction markets. https://docs.darvas.app/market-coverage gives the history and update time of each dataset.
> https://docs.darvas.app/ai-agents names the endpoint and the MCP tool that answer each kind of question about these datasets.
> Custom indicators for Darvas charts are Pine Script v5 or v6 indicator() or strategy() scripts. Darvas rewrites Pine v1 to v4 to v5 and runs no other indicator language. Start at https://docs.darvas.app/pine-script/introduction.
> https://docs.darvas.app/pine-script/support lists the Pine Script that Darvas runs. https://docs.darvas.app/pine-script/request-security covers request.security() and request.financial(), and https://docs.darvas.app/pine-script/limits lists the run limits.
> Darvas Pro+ webhooks send a signed POST for alarm fires and pauses, scheduled answers, economic calendar alerts, ETF flow updates, ended connections and the data API events. https://docs.darvas.app/pro/webhooks lists every event, its object and how to verify the Darvas-Signature header.

# COT Index & Positioning Extremes API

> Compute the 52 and 156-week COT Index, net position z-scores, crowding and hedger versus speculator divergence per market, or screen every market.

## Overview

This endpoint analyses CFTC Commitments of Traders positioning. With `market_code` or `symbol`, such as ES, GC, CL or BTC, it returns that market's rolling analytics: the 52-week and 156-week COT Index from 0 to 100, percentiles and z-scores of net positions, the share of the largest four and eight traders, and flags for crowded and diverging groups.

Without a market it screens every market for extremes, filtered by asset class, COT Index range, open interest, extremes or divergences only, and ranked by open interest, COT Index, z-score, weekly change or concentration.

| Coverage | Details |
| - | - |
| Reports | `legacy`, `disaggregated` (commodities) or `tff` (financials and crypto) |
| Single market | 1 to 156 trailing weeks; 26 by default |
| Screener | Up to 500 markets, `52w` or `156w` lookback |
| MCP tool | `get_cot_analytics` on the [data API MCP server](https://docs.darvas.app/mcp-server.md) |

## Example

```python theme={null}
import os
import requests

headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]}
answer = requests.get(
    "https://api.darvas.app/v1/cot/analytics",
    headers=headers,
    params={
        "symbol": "GC",
        "weeks": 52,
    },
).json()
print(answer["mode"], answer["market_code"], answer["as_of"])
print(answer["latest"])
```

```bash theme={null}
curl -H "X-API-KEY: $DARVAS_API_KEY" \
  "https://api.darvas.app/v1/cot/analytics?symbol=GC&weeks=52"
```


## OpenAPI

````yaml openapi.yaml GET /cot/analytics
openapi: 3.1.1
info:
  title: Darvas Data API
  version: 0.9.0
  summary: >-
    Company, filing, insider, institutional, market and macro data for every SEC
    filer, US stocks, UK and French companies and crypto markets.
  description: >-
    Every value names its source. Field names follow the common financial data
    API shapes, so an existing client reads these answers unchanged; extra
    fields come after them. Send the API key in the X-API-KEY header or as a
    Bearer token. Dates are ISO 8601 and times are RFC 3339 in UTC. Billing: 1
    credit = 1 successful call. A page holds at most 1,000 rows and costs one
    credit however many it holds; an empty answer, a refusal, an error and every
    FINRA /short-volume call cost 0 credits.
  termsOfService: https://darvas.app/terms
  contact:
    name: Darvas data
    url: https://darvas.app
    email: support@darvas.app
  license:
    name: Proprietary
    identifier: LicenseRef-Darvas-Proprietary
servers:
  - url: https://api.darvas.app/v1
    description: Production.
  - url: https://darvas.app/api/data/v1
    description: Production, on the darvas.app host.
security:
  - apiKey: []
  - bearerKey: []
tags:
  - name: company
    description: Company profiles from SEC submissions.
  - name: crypto
    description: >-
      Candles, trades, order books, order flow, derivatives, options, screens
      and market structure of crypto instruments from Darvas's own market data.
  - name: defi
    description: >-
      Multi-chain DeFi protocol TVL, stablecoin supply, yield pools, and
      on-chain DEX liquidity.
  - name: earnings
    description: >-
      Each filing that reports a period, the 8-K earnings release, then the 10-Q
      or 10-K, and the KPIs, guidance and non-GAAP metrics of the releases.
  - name: filings
    description: >-
      SEC filing lists, the items of 10-K, 10-Q and 8-K filings, and search over
      them.
  - name: financials
    description: >-
      Standardized income statements, balance sheets and cash flow statements
      from XBRL filings.
  - name: funds
    description: Holdings of registered funds and ETFs from Form N-PORT.
  - name: insiders
    description: >-
      Insider trades and holdings from Forms 3, 4 and 5, and sale notices from
      Form 144.
  - name: institutions
    description: Positions of investment managers from Form 13F reports.
  - name: ipos
    description: Registration statements and prospectuses of companies going public.
  - name: macro
    description: >-
      Policy rates, the Treasury yield curve, inflation, jobs and GDP from their
      publishers.
  - name: markets
    description: >-
      Market structure data: the shares that failed to settle each day, from
      SEC, and futures positions by trader group, from the CFTC.
  - name: news
    description: >-
      Company 8-K filings and the press releases of the Federal Reserve, the
      SEC, the BEA and the BLS.
  - name: ownership
    description: Owners of more than 5% from Schedules 13D and 13G.
  - name: prediction-markets
    description: >-
      Binary event contract odds and series across Polymarket, Kalshi and OKX
      plus cross-venue arbitrage spreads.
  - name: tokenized-stocks
    description: >-
      Coinbase stock tokens on Base, priced by their USDC pools, and the stock
      instruments of OKX and Bybit.
  - name: webhooks
    description: >-
      Destinations that receive a signed event when new filings, statements,
      insider forms or macro releases arrive.
externalDocs:
  description: Market coverage
  url: https://docs.darvas.app/market-coverage
paths:
  /cot/analytics:
    get:
      tags:
        - markets
      summary: Compute COT positioning index, Z-scores, and extreme screener
      description: >-
        Single-market rolling COT analytics (when market_code or symbol is
        supplied) or cross-market extreme positioning screener (when omitted).
        Computes 52-week and 156-week COT Index (0 to 100), empirical
        percentiles, sample Z-scores, top-4/top-8 crowding flags, and
        hedger-vs-speculator extreme divergence flags.
      operationId: getCotAnalytics
      parameters:
        - $ref: '#/components/parameters/CotAnalyticsMarketCode'
        - $ref: '#/components/parameters/CotSymbol'
        - $ref: '#/components/parameters/CotReport'
        - $ref: '#/components/parameters/CotAnalyticsWeeks'
        - $ref: '#/components/parameters/CotAnalyticsGroup'
        - $ref: '#/components/parameters/CotAnalyticsLookback'
        - $ref: '#/components/parameters/CotAssetClass'
        - $ref: '#/components/parameters/CotSearch'
        - $ref: '#/components/parameters/CotMinIndex'
        - $ref: '#/components/parameters/CotMaxIndex'
        - $ref: '#/components/parameters/CotMinOpenInterest'
        - $ref: '#/components/parameters/CotExtremesOnly'
        - $ref: '#/components/parameters/CotDivergencesOnly'
        - $ref: '#/components/parameters/CotActiveOnly'
        - $ref: '#/components/parameters/CotAnalyticsSort'
        - $ref: '#/components/parameters/CotAnalyticsOrder'
        - $ref: '#/components/parameters/CotAnalyticsLimit'
      responses:
        '200':
          description: >-
            Compute COT positioning index, Z-scores, and extreme screener: one
            page.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            X-Quota-Unit:
              $ref: '#/components/headers/QuotaUnit'
            X-Credits-Used:
              $ref: '#/components/headers/CreditsUsed'
            X-Quota-Limit:
              $ref: '#/components/headers/QuotaLimit'
            X-Quota-Remaining:
              $ref: '#/components/headers/QuotaRemaining'
            X-Quota-Reset:
              $ref: '#/components/headers/QuotaReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CotAnalyticsResponse'
              example:
                mode: market
                report: tff
                market_code: '133741'
                latest:
                  report: tff
                  market_code: '133741'
                  market: BITCOIN
                  exchange: CHICAGO MERCANTILE EXCHANGE
                  commodity: BITCOIN
                  asset_class: crypto
                  report_date: '2026-11-17'
                  open_interest_contracts: 19257
                  change_open_interest_contracts: -300
                  traders_total_count: 112
                  traders_reportable_long_count: 58
                  traders_reportable_short_count: 78
                  concentration:
                    top_4_gross_long_pct: 57.3
                    top_4_gross_short_pct: 33.8
                    top_8_gross_long_pct: 70.7
                    top_8_gross_short_pct: 49.6
                    top_4_net_long_pct: 54.7
                    top_4_net_short_pct: 30.9
                    top_8_net_long_pct: 64.3
                    top_8_net_short_pct: 43.4
                    max_top_4_net_pct: 54.7
                    crowding_flag: true
                  divergence:
                    hedger_group: asset_manager
                    speculator_group: leveraged_funds
                    hedger_state: extreme_long
                    speculator_state: extreme_short
                    extreme_divergence: true
                    divergence_direction: hedger_bullish_speculator_bearish
                    divergence_z_spread: 3.15
                  groups:
                    leveraged_funds:
                      long_contracts: 6264
                      short_contracts: 9875
                      spread_contracts: 412
                      net_contracts: -3611
                      change_long_contracts: 120
                      change_short_contracts: -85
                      change_spread_contracts: 10
                      change_net_contracts: 205
                      long_pct_of_oi: 32.5
                      short_pct_of_oi: 51.3
                      spread_pct_of_oi: 2.1
                      net_pct_of_oi: -18.75
                      traders_long_count: 31
                      traders_short_count: 36
                      traders_spread_count: 15
                      cot_index_52w: 18.4
                      cot_index_156w: 22.1
                      percentile_52w_pct: 15.38
                      percentile_156w_pct: 19.23
                      z_score_52w: -1.62
                      z_score_156w: -1.34
                      positioning_state: extreme_short
                  history_weeks_available: 156
                history:
                  - report: tff
                    market_code: '133741'
                    market: BITCOIN
                    exchange: CHICAGO MERCANTILE EXCHANGE
                    commodity: BITCOIN
                    asset_class: crypto
                    report_date: '2026-11-17'
                    open_interest_contracts: 19257
                    change_open_interest_contracts: -300
                    traders_total_count: 112
                    traders_reportable_long_count: 58
                    traders_reportable_short_count: 78
                    concentration:
                      top_4_gross_long_pct: 57.3
                      top_4_gross_short_pct: 33.8
                      top_8_gross_long_pct: 70.7
                      top_8_gross_short_pct: 49.6
                      top_4_net_long_pct: 54.7
                      top_4_net_short_pct: 30.9
                      top_8_net_long_pct: 64.3
                      top_8_net_short_pct: 43.4
                      max_top_4_net_pct: 54.7
                      crowding_flag: true
                    divergence:
                      hedger_group: asset_manager
                      speculator_group: leveraged_funds
                      hedger_state: extreme_long
                      speculator_state: extreme_short
                      extreme_divergence: true
                      divergence_direction: hedger_bullish_speculator_bearish
                      divergence_z_spread: 3.15
                    groups:
                      leveraged_funds:
                        long_contracts: 6264
                        short_contracts: 9875
                        spread_contracts: 412
                        net_contracts: -3611
                        change_long_contracts: 120
                        change_short_contracts: -85
                        change_spread_contracts: 10
                        change_net_contracts: 205
                        long_pct_of_oi: 32.5
                        short_pct_of_oi: 51.3
                        spread_pct_of_oi: 2.1
                        net_pct_of_oi: -18.75
                        traders_long_count: 31
                        traders_short_count: 36
                        traders_spread_count: 15
                        cot_index_52w: 18.4
                        cot_index_156w: 22.1
                        percentile_52w_pct: 15.38
                        percentile_156w_pct: 19.23
                        z_score_52w: -1.62
                        z_score_156w: -1.34
                        positioning_state: extreme_short
                    history_weeks_available: 156
                count: 1
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/PlanRequired'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  parameters:
    CotAnalyticsMarketCode:
      name: market_code
      in: query
      required: false
      description: >-
        Optional CFTC six-character code or futures alias (ES, GC, CL, BTC, 6E).
        Omit for the all-markets screener.
      schema:
        type: string
        pattern: ^[A-Za-z0-9+_ .&-]{1,40}$
        maxLength: 40
      example: ES
    CotSymbol:
      name: symbol
      in: query
      required: false
      description: >-
        Alias for market_code accepting futures roots and names (ES, NQ, GC, CL,
        BTC, 6E, ZN).
      schema:
        type: string
        pattern: ^[A-Za-z0-9+_ .&-]{1,40}$
        maxLength: 40
      example: ES
    CotReport:
      name: report
      in: query
      required: false
      description: >-
        The CFTC report: legacy (default), disaggregated (commodities), or tff
        (financials and crypto).
      schema:
        type: string
        enum:
          - legacy
          - disaggregated
          - tff
        default: legacy
      example: tff
    CotAnalyticsWeeks:
      name: weeks
      in: query
      required: false
      description: >-
        Trailing weeks to return in single-market analytics mode (1 to 156;
        default 26).
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 156
        default: 26
      example: 26
    CotAnalyticsGroup:
      name: group
      in: query
      required: false
      description: >-
        Trader group used for screener filtering and ranking (defaults to the
        report's speculator group).
      schema:
        type: string
        pattern: ^[a-z_]{3,32}$
        maxLength: 32
      example: noncommercial
    CotAnalyticsLookback:
      name: lookback
      in: query
      required: false
      description: >-
        Lookback window for screener COT Index and Z-score filters: 52w
        (default) or 156w.
      schema:
        type: string
        enum:
          - 52w
          - 156w
        default: 52w
      example: 52w
    CotAssetClass:
      name: asset_class
      in: query
      required: false
      description: Filter markets by macro asset class.
      schema:
        type: string
        enum:
          - crypto
          - currencies
          - equity_indices
          - rates
          - energy
          - metals
          - grains
          - softs
          - livestock
          - other
      example: crypto
    CotSearch:
      name: search
      in: query
      required: false
      description: >-
        Case-insensitive filter matching market name, commodity, exchange, code,
        or futures symbol aliases.
      schema:
        type: string
        pattern: ^[^\x00-\x1f]*$
        maxLength: 100
      example: bitcoin
    CotMinIndex:
      name: min_cot_index
      in: query
      required: false
      description: Minimum 0 to 100 COT Index threshold in screener mode.
      schema:
        type: number
        format: double
        minimum: 0
        maximum: 100
      example: 80
    CotMaxIndex:
      name: max_cot_index
      in: query
      required: false
      description: Maximum 0 to 100 COT Index threshold in screener mode.
      schema:
        type: number
        format: double
        minimum: 0
        maximum: 100
      example: 20
    CotMinOpenInterest:
      name: min_open_interest
      in: query
      required: false
      description: Minimum open interest in contracts in screener mode.
      schema:
        type: number
        format: double
        minimum: 0
        maximum: 1000000000
      example: 50000
    CotExtremesOnly:
      name: extremes_only
      in: query
      required: false
      description: >-
        When true, keeps only markets in extreme_long, extreme_short, or
        extreme_divergence states.
      schema:
        type: string
        enum:
          - 'true'
          - 'false'
        default: 'false'
      example: 'true'
    CotDivergencesOnly:
      name: divergences_only
      in: query
      required: false
      description: >-
        When true, keeps only markets with opposing hedger and speculator
        positioning extremes.
      schema:
        type: string
        enum:
          - 'true'
          - 'false'
        default: 'false'
      example: 'true'
    CotActiveOnly:
      name: active_only
      in: query
      required: false
      description: When true (default), hides delisted/stale markets with no recent report.
      schema:
        type: string
        enum:
          - 'true'
          - 'false'
        default: 'true'
      example: 'true'
    CotAnalyticsSort:
      name: sort
      in: query
      required: false
      description: Ranking metric in screener mode.
      schema:
        type: string
        enum:
          - open_interest
          - cot_index_52w
          - cot_index_156w
          - z_score_52w
          - z_score_156w
          - abs_z_score
          - weekly_change
          - divergence_z_spread
          - concentration_top4
        default: open_interest
      example: cot_index_52w
    CotAnalyticsOrder:
      name: order
      in: query
      required: false
      description: 'Sort direction in screener mode: desc (default) or asc.'
      schema:
        type: string
        enum:
          - desc
          - asc
        default: desc
      example: desc
    CotAnalyticsLimit:
      name: limit
      in: query
      required: false
      description: Maximum markets to return in screener mode (1 to 500; default 50).
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 500
        default: 50
      example: 50
  headers:
    RateLimitLimit:
      description: Requests per minute the key may send; on a 401 the limit a new key gets.
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 6000
      example: 60
    QuotaUnit:
      description: >-
        What the quota counts: credits. One credit is one successful call that
        returns data.
      schema:
        type: string
        enum:
          - credits
        maxLength: 7
      example: credits
    CreditsUsed:
      description: >-
        Credits this answer cost: one for a 2xx answer with data, however many
        rows it holds. An empty answer, a refusal, an error and a FINRA
        /short-volume answer cost 0.
      schema:
        type: integer
        format: int64
        minimum: 0
        maximum: 9007199254740991
      example: 1
    QuotaLimit:
      description: >-
        The plan's credits for its period plus the account's pay-as-you-go
        credit balance, as the request found them.
      schema:
        type: integer
        format: int64
        minimum: 0
        maximum: 9007199254740991
      example: 2500000
    QuotaRemaining:
      description: >-
        Credits left after this answer: the plan's own first, then the credit
        balance.
      schema:
        type: integer
        format: int64
        minimum: 0
        maximum: 9007199254740991
      example: 2499999
    QuotaReset:
      description: >-
        When the plan's credits start again, or the trial ends, in seconds since
        1970 (UTC). Pay-as-you-go answers leave it out: their credits never
        expire.
      schema:
        type: integer
        format: int64
        minimum: 0
        maximum: 4102444800
      example: 1767225600
    RetryAfter:
      description: Seconds to wait before the next request.
      schema:
        type: integer
        format: int32
        minimum: 1
        maximum: 60
      example: 1
  schemas:
    CotAnalyticsResponse:
      type: object
      description: >-
        The answer of GET /cot/analytics in either single-market or all-markets
        screener mode.
      additionalProperties: false
      required:
        - mode
        - report
        - count
      properties:
        mode:
          type: string
          enum:
            - market
            - snapshot
          description: >-
            market when market_code/symbol was supplied, snapshot for
            cross-market screen.
          examples:
            - market
        report:
          type: string
          enum:
            - legacy
            - disaggregated
            - tff
          description: CFTC report analyzed.
          examples:
            - tff
        market_code:
          type: string
          pattern: ^[0-9A-Z+]{6}$
          description: Resolved CFTC code in market mode.
          examples:
            - '133741'
        resolved_from:
          type: string
          pattern: ^[^\x00-\x08\x0b\x0c\x0e-\x1f]*$
          maxLength: 40
          description: Original futures alias when resolved.
          examples:
            - BTC
        as_of:
          type:
            - string
            - 'null'
          format: date
          description: Latest report date across analyzed markets in snapshot mode.
          examples:
            - '2026-11-17'
        report_lag_note:
          type: string
          pattern: ^[^\x00-\x08\x0b\x0c\x0e-\x1f]*$
          maxLength: 300
          description: CFTC publication lag notice.
          examples:
            - >-
              CFTC positions are captured Tuesday and published Friday at 15:30
              ET.
        next_expected_release_day:
          type: string
          pattern: ^[^\x00-\x08\x0b\x0c\x0e-\x1f]*$
          maxLength: 40
          description: Standard weekly CFTC release day.
          examples:
            - Friday 15:30 ET
        selected_group:
          type: string
          pattern: ^[^\x00-\x08\x0b\x0c\x0e-\x1f]*$
          maxLength: 32
          description: Trader group used for screener filtering in snapshot mode.
          examples:
            - leveraged_funds
        lookback:
          type: string
          enum:
            - 52w
            - 156w
          description: Lookback window in snapshot mode.
          examples:
            - 52w
        total_markets_analyzed:
          type: integer
          format: int32
          minimum: 0
          maximum: 5000
          description: Active markets analyzed in snapshot mode.
          examples:
            - 378
        extreme_divergence_count:
          type: integer
          format: int32
          minimum: 0
          maximum: 5000
          description: >-
            Active markets currently flagging extreme hedger-vs-speculator
            divergence.
          examples:
            - 14
        latest:
          $ref: '#/components/schemas/CotAnalyticsWeek'
        history:
          type: array
          maxItems: 156
          description: Trailing weekly analytics in market mode, newest first.
          items:
            $ref: '#/components/schemas/CotAnalyticsWeek'
        markets:
          type: array
          maxItems: 500
          description: Screened markets in snapshot mode.
          items:
            $ref: '#/components/schemas/CotAnalyticsWeek'
        count:
          type: integer
          format: int32
          minimum: 0
          maximum: 500
          description: Number of weeks (market mode) or markets (snapshot mode) returned.
          examples:
            - 26
        methodology:
          type: string
          pattern: ^[^\x00-\x08\x0b\x0c\x0e-\x1f]*$
          maxLength: 1500
          description: COT Index, percentile, Z-score, and divergence definitions.
          examples:
            - COT Index scales net positioning from 0 to 100 over 52w or 156w.
      examples:
        - mode: market
          report: tff
          market_code: '133741'
          latest:
            report: tff
            market_code: '133741'
            market: BITCOIN
            exchange: CHICAGO MERCANTILE EXCHANGE
            commodity: BITCOIN
            asset_class: crypto
            report_date: '2026-11-17'
            open_interest_contracts: 19257
            change_open_interest_contracts: -300
            traders_total_count: 112
            traders_reportable_long_count: 58
            traders_reportable_short_count: 78
            concentration:
              top_4_gross_long_pct: 57.3
              top_4_gross_short_pct: 33.8
              top_8_gross_long_pct: 70.7
              top_8_gross_short_pct: 49.6
              top_4_net_long_pct: 54.7
              top_4_net_short_pct: 30.9
              top_8_net_long_pct: 64.3
              top_8_net_short_pct: 43.4
              max_top_4_net_pct: 54.7
              crowding_flag: true
            divergence:
              hedger_group: asset_manager
              speculator_group: leveraged_funds
              hedger_state: extreme_long
              speculator_state: extreme_short
              extreme_divergence: true
              divergence_direction: hedger_bullish_speculator_bearish
              divergence_z_spread: 3.15
            groups:
              leveraged_funds:
                long_contracts: 6264
                short_contracts: 9875
                spread_contracts: 412
                net_contracts: -3611
                change_long_contracts: 120
                change_short_contracts: -85
                change_spread_contracts: 10
                change_net_contracts: 205
                long_pct_of_oi: 32.5
                short_pct_of_oi: 51.3
                spread_pct_of_oi: 2.1
                net_pct_of_oi: -18.75
                traders_long_count: 31
                traders_short_count: 36
                traders_spread_count: 15
                cot_index_52w: 18.4
                cot_index_156w: 22.1
                percentile_52w_pct: 15.38
                percentile_156w_pct: 19.23
                z_score_52w: -1.62
                z_score_156w: -1.34
                positioning_state: extreme_short
            history_weeks_available: 156
          history:
            - report: tff
              market_code: '133741'
              market: BITCOIN
              exchange: CHICAGO MERCANTILE EXCHANGE
              commodity: BITCOIN
              asset_class: crypto
              report_date: '2026-11-17'
              open_interest_contracts: 19257
              change_open_interest_contracts: -300
              traders_total_count: 112
              traders_reportable_long_count: 58
              traders_reportable_short_count: 78
              concentration:
                top_4_gross_long_pct: 57.3
                top_4_gross_short_pct: 33.8
                top_8_gross_long_pct: 70.7
                top_8_gross_short_pct: 49.6
                top_4_net_long_pct: 54.7
                top_4_net_short_pct: 30.9
                top_8_net_long_pct: 64.3
                top_8_net_short_pct: 43.4
                max_top_4_net_pct: 54.7
                crowding_flag: true
              divergence:
                hedger_group: asset_manager
                speculator_group: leveraged_funds
                hedger_state: extreme_long
                speculator_state: extreme_short
                extreme_divergence: true
                divergence_direction: hedger_bullish_speculator_bearish
                divergence_z_spread: 3.15
              groups:
                leveraged_funds:
                  long_contracts: 6264
                  short_contracts: 9875
                  spread_contracts: 412
                  net_contracts: -3611
                  change_long_contracts: 120
                  change_short_contracts: -85
                  change_spread_contracts: 10
                  change_net_contracts: 205
                  long_pct_of_oi: 32.5
                  short_pct_of_oi: 51.3
                  spread_pct_of_oi: 2.1
                  net_pct_of_oi: -18.75
                  traders_long_count: 31
                  traders_short_count: 36
                  traders_spread_count: 15
                  cot_index_52w: 18.4
                  cot_index_156w: 22.1
                  percentile_52w_pct: 15.38
                  percentile_156w_pct: 19.23
                  z_score_52w: -1.62
                  z_score_156w: -1.34
                  positioning_state: extreme_short
              history_weeks_available: 156
          count: 1
    CotAnalyticsWeek:
      type: object
      description: One weekly COT analytics record for a futures market.
      additionalProperties: false
      required:
        - report
        - market_code
        - market
        - asset_class
        - report_date
        - open_interest_contracts
        - concentration
        - divergence
        - groups
        - history_weeks_available
      properties:
        report:
          type: string
          enum:
            - legacy
            - disaggregated
            - tff
          description: CFTC report type.
          examples:
            - tff
        market_code:
          type: string
          pattern: ^[0-9A-Z+]{6}$
          description: Six-character CFTC market code.
          examples:
            - '133741'
        market: 7ce7809e-d764-4029-ab7f-c540007fa092
        exchange: 71ed5e57-ba89-4fed-8ed1-aec56650163d
        commodity: 9902b4e1-eef4-4317-8909-22f751ee551f
        asset_class: 7c1c727b-7ee1-4d0f-aeeb-4eb400a89d51
        report_date:
          type: string
          format: date
          description: Tuesday report date.
          examples:
            - '2026-11-17'
        open_interest_contracts:
          type:
            - number
            - 'null'
          format: double
          description: Total open interest in contracts.
          examples:
            - 19257
        change_open_interest_contracts:
          type:
            - number
            - 'null'
          format: double
          description: Weekly change in open interest.
          examples:
            - -300
        traders_total_count:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
          maximum: 1000000
          description: Total reportable traders.
          examples:
            - 112
        traders_reportable_long_count:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
          maximum: 1000000
          description: Reportable long traders.
          examples:
            - 58
        traders_reportable_short_count:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
          maximum: 1000000
          description: Reportable short traders.
          examples:
            - 78
        concentration:
          $ref: '#/components/schemas/CotConcentration'
        divergence:
          $ref: '#/components/schemas/CotDivergenceFlags'
        groups:
          type: object
          description: Analytics by canonical trader group name.
          additionalProperties: false
          properties:
            noncommercial:
              $ref: '#/components/schemas/CotGroupAnalytics'
            commercial:
              $ref: '#/components/schemas/CotGroupAnalytics'
            producer_merchant:
              $ref: '#/components/schemas/CotGroupAnalytics'
            swap_dealers:
              $ref: '#/components/schemas/CotGroupAnalytics'
            managed_money:
              $ref: '#/components/schemas/CotGroupAnalytics'
            dealer:
              $ref: '#/components/schemas/CotGroupAnalytics'
            asset_manager:
              $ref: '#/components/schemas/CotGroupAnalytics'
            leveraged_funds:
              $ref: '#/components/schemas/CotGroupAnalytics'
            other_reportables:
              $ref: '#/components/schemas/CotGroupAnalytics'
            non_reportables:
              $ref: '#/components/schemas/CotGroupAnalytics'
          examples:
            - leveraged_funds:
                long_contracts: 6264
                short_contracts: 9875
                spread_contracts: 412
                net_contracts: -3611
                change_long_contracts: 120
                change_short_contracts: -85
                change_spread_contracts: 10
                change_net_contracts: 205
                long_pct_of_oi: 32.5
                short_pct_of_oi: 51.3
                spread_pct_of_oi: 2.1
                net_pct_of_oi: -18.75
                traders_long_count: 31
                traders_short_count: 36
                traders_spread_count: 15
                cot_index_52w: 18.4
                cot_index_156w: 22.1
                percentile_52w_pct: 15.38
                percentile_156w_pct: 19.23
                z_score_52w: -1.62
                z_score_156w: -1.34
                positioning_state: extreme_short
        history_weeks_available:
          type: integer
          format: int32
          minimum: 0
          maximum: 5000
          description: Historical weeks used to compute trailing statistics.
          examples:
            - 156
      examples:
        - report: tff
          market_code: '133741'
          market: BITCOIN
          exchange: CHICAGO MERCANTILE EXCHANGE
          commodity: BITCOIN
          asset_class: crypto
          report_date: '2026-11-17'
          open_interest_contracts: 19257
          change_open_interest_contracts: -300
          traders_total_count: 112
          traders_reportable_long_count: 58
          traders_reportable_short_count: 78
          concentration:
            top_4_gross_long_pct: 57.3
            top_4_gross_short_pct: 33.8
            top_8_gross_long_pct: 70.7
            top_8_gross_short_pct: 49.6
            top_4_net_long_pct: 54.7
            top_4_net_short_pct: 30.9
            top_8_net_long_pct: 64.3
            top_8_net_short_pct: 43.4
            max_top_4_net_pct: 54.7
            crowding_flag: true
          divergence:
            hedger_group: asset_manager
            speculator_group: leveraged_funds
            hedger_state: extreme_long
            speculator_state: extreme_short
            extreme_divergence: true
            divergence_direction: hedger_bullish_speculator_bearish
            divergence_z_spread: 3.15
          groups:
            leveraged_funds:
              long_contracts: 6264
              short_contracts: 9875
              spread_contracts: 412
              net_contracts: -3611
              change_long_contracts: 120
              change_short_contracts: -85
              change_spread_contracts: 10
              change_net_contracts: 205
              long_pct_of_oi: 32.5
              short_pct_of_oi: 51.3
              spread_pct_of_oi: 2.1
              net_pct_of_oi: -18.75
              traders_long_count: 31
              traders_short_count: 36
              traders_spread_count: 15
              cot_index_52w: 18.4
              cot_index_156w: 22.1
              percentile_52w_pct: 15.38
              percentile_156w_pct: 19.23
              z_score_52w: -1.62
              z_score_156w: -1.34
              positioning_state: extreme_short
          history_weeks_available: 156
    Error:
      type: object
      description: A refusal or failure.
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: string
          pattern: ^[A-Z_]{1,64}$
          description: A stable code.
          examples:
            - NOT_FOUND
        message:
          type: string
          pattern: ^[^\x00-\x08\x0b\x0c\x0e-\x1f]*$
          maxLength: 500
          description: What went wrong, in English.
          examples:
            - No company has this ticker or CIK
      examples:
        - error: NOT_FOUND
          message: No company has this ticker or CIK
    CotConcentration:
      type: object
      description: >-
        Top-4 and top-8 gross and net trader concentration ratios (% of open
        interest).
      additionalProperties: false
      required:
        - crowding_flag
      properties:
        top_4_gross_long_pct:
          type:
            - number
            - 'null'
          format: double
          description: Top-4 gross long share of open interest (%).
          examples:
            - 57.3
        top_4_gross_short_pct:
          type:
            - number
            - 'null'
          format: double
          description: Top-4 gross short share of open interest (%).
          examples:
            - 33.8
        top_8_gross_long_pct:
          type:
            - number
            - 'null'
          format: double
          description: Top-8 gross long share of open interest (%).
          examples:
            - 70.7
        top_8_gross_short_pct:
          type:
            - number
            - 'null'
          format: double
          description: Top-8 gross short share of open interest (%).
          examples:
            - 49.6
        top_4_net_long_pct:
          type:
            - number
            - 'null'
          format: double
          description: Top-4 net long share of open interest (%).
          examples:
            - 54.7
        top_4_net_short_pct:
          type:
            - number
            - 'null'
          format: double
          description: Top-4 net short share of open interest (%).
          examples:
            - 30.9
        top_8_net_long_pct:
          type:
            - number
            - 'null'
          format: double
          description: Top-8 net long share of open interest (%).
          examples:
            - 64.3
        top_8_net_short_pct:
          type:
            - number
            - 'null'
          format: double
          description: Top-8 net short share of open interest (%).
          examples:
            - 43.4
        max_top_4_net_pct:
          type:
            - number
            - 'null'
          format: double
          description: Maximum of top-4 net long and net short shares (%).
          examples:
            - 54.7
        crowding_flag:
          type: boolean
          description: True when max_top_4_net_pct is at least 40%.
          examples:
            - true
      examples:
        - top_4_gross_long_pct: 57.3
          top_4_gross_short_pct: 33.8
          top_8_gross_long_pct: 70.7
          top_8_gross_short_pct: 49.6
          top_4_net_long_pct: 54.7
          top_4_net_short_pct: 30.9
          top_8_net_long_pct: 64.3
          top_8_net_short_pct: 43.4
          max_top_4_net_pct: 54.7
          crowding_flag: true
    CotDivergenceFlags:
      type: object
      description: Hedger vs speculator extreme positioning divergence summary.
      additionalProperties: false
      required:
        - hedger_group
        - speculator_group
        - hedger_state
        - speculator_state
        - extreme_divergence
        - divergence_direction
      properties:
        hedger_group:
          type: string
          pattern: ^[^\x00-\x08\x0b\x0c\x0e-\x1f]*$
          maxLength: 32
          description: Hedger group name for this report.
          examples:
            - asset_manager
        speculator_group:
          type: string
          pattern: ^[^\x00-\x08\x0b\x0c\x0e-\x1f]*$
          maxLength: 32
          description: Speculator group name for this report.
          examples:
            - leveraged_funds
        hedger_state:
          type: string
          enum:
            - extreme_long
            - extreme_short
            - neutral
          description: Hedger positioning state.
          examples:
            - extreme_long
        speculator_state:
          type: string
          enum:
            - extreme_long
            - extreme_short
            - neutral
          description: Speculator positioning state.
          examples:
            - extreme_short
        extreme_divergence:
          type: boolean
          description: True when hedgers and speculators are at opposite extremes.
          examples:
            - true
        divergence_direction:
          type: string
          enum:
            - hedger_bullish_speculator_bearish
            - hedger_bearish_speculator_bullish
            - none
          description: Directional summary of hedger vs speculator divergence.
          examples:
            - hedger_bullish_speculator_bearish
        divergence_z_spread:
          type:
            - number
            - 'null'
          format: double
          description: Hedger 52w Z-score minus speculator 52w Z-score.
          examples:
            - 3.15
      examples:
        - hedger_group: asset_manager
          speculator_group: leveraged_funds
          hedger_state: extreme_long
          speculator_state: extreme_short
          extreme_divergence: true
          divergence_direction: hedger_bullish_speculator_bearish
          divergence_z_spread: 3.15
    CotGroupAnalytics:
      type: object
      description: Rolling COT positioning analytics for one trader group.
      additionalProperties: false
      required:
        - positioning_state
      properties:
        long_contracts:
          type:
            - number
            - 'null'
          format: double
          description: Long contracts held by the group.
          examples:
            - 6264
        short_contracts:
          type:
            - number
            - 'null'
          format: double
          description: Short contracts held by the group.
          examples:
            - 9875
        spread_contracts:
          type:
            - number
            - 'null'
          format: double
          description: Spread contracts held by the group.
          examples:
            - 412
        net_contracts:
          type:
            - number
            - 'null'
          format: double
          description: Net contracts (long minus short).
          examples:
            - -3611
        change_long_contracts: 5cf660d7-4059-4c7f-9806-8a91dedcf05a
        change_short_contracts: 872d8ca3-9221-4f08-893e-abd4e0d7a875
        change_spread_contracts: e802d54a-d441-4728-a06a-8923b7f1ecb0
        change_net_contracts:
          type:
            - number
            - 'null'
          format: double
          description: Weekly change in net contracts.
          examples:
            - 205
        long_pct_of_oi:
          type:
            - number
            - 'null'
          format: double
          description: Long share of open interest (%).
          examples:
            - 32.5
        short_pct_of_oi:
          type:
            - number
            - 'null'
          format: double
          description: Short share of open interest (%).
          examples:
            - 51.3
        spread_pct_of_oi:
          type:
            - number
            - 'null'
          format: double
          description: Spread share of open interest (%).
          examples:
            - 2.1
        net_pct_of_oi:
          type:
            - number
            - 'null'
          format: double
          description: Net share of open interest (%).
          examples:
            - -18.75
        traders_long_count:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
          maximum: 1000000
          description: Count of reportable long traders.
          examples:
            - 31
        traders_short_count:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
          maximum: 1000000
          description: Count of reportable short traders.
          examples:
            - 36
        traders_spread_count:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
          maximum: 1000000
          description: Count of reportable spread traders.
          examples:
            - 15
        cot_index_52w:
          type:
            - number
            - 'null'
          format: double
          description: 52-week min-max COT Index scaled 0 to 100.
          examples:
            - 18.4
        cot_index_156w:
          type:
            - number
            - 'null'
          format: double
          description: 156-week min-max COT Index scaled 0 to 100.
          examples:
            - 22.1
        percentile_52w_pct:
          type:
            - number
            - 'null'
          format: double
          description: 52-week empirical percentile rank (0 to 100).
          examples:
            - 15.38
        percentile_156w_pct:
          type:
            - number
            - 'null'
          format: double
          description: 156-week empirical percentile rank (0 to 100).
          examples:
            - 19.23
        z_score_52w:
          type:
            - number
            - 'null'
          format: double
          description: 52-week sample Z-score of net positioning.
          examples:
            - -1.62
        z_score_156w:
          type:
            - number
            - 'null'
          format: double
          description: 156-week sample Z-score of net positioning.
          examples:
            - -1.34
        positioning_state:
          type: string
          enum:
            - extreme_long
            - extreme_short
            - neutral
          description: Extreme positioning state based on COT Index and 52w Z-score.
          examples:
            - extreme_short
      examples:
        - long_contracts: 6264
          short_contracts: 9875
          spread_contracts: 412
          net_contracts: -3611
          change_long_contracts: 120
          change_short_contracts: -85
          change_spread_contracts: 10
          change_net_contracts: 205
          long_pct_of_oi: 32.5
          short_pct_of_oi: 51.3
          spread_pct_of_oi: 2.1
          net_pct_of_oi: -18.75
          traders_long_count: 31
          traders_short_count: 36
          traders_spread_count: 15
          cot_index_52w: 18.4
          cot_index_156w: 22.1
          percentile_52w_pct: 15.38
          percentile_156w_pct: 19.23
          z_score_52w: -1.62
          z_score_156w: -1.34
          positioning_state: extreme_short
  responses:
    BadRequest:
      description: A parameter is missing or malformed.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-Quota-Unit:
          $ref: '#/components/headers/QuotaUnit'
        X-Credits-Used:
          $ref: '#/components/headers/CreditsUsed'
        X-Quota-Limit:
          $ref: '#/components/headers/QuotaLimit'
        X-Quota-Remaining:
          $ref: '#/components/headers/QuotaRemaining'
        X-Quota-Reset:
          $ref: '#/components/headers/QuotaReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: VALIDATION_ERROR
            message: Send ticker or cik
    Unauthorized:
      description: The API key is missing, unknown or revoked.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-Quota-Unit:
          $ref: '#/components/headers/QuotaUnit'
        X-Credits-Used:
          $ref: '#/components/headers/CreditsUsed'
        X-Quota-Limit:
          $ref: '#/components/headers/QuotaLimit'
        X-Quota-Remaining:
          $ref: '#/components/headers/QuotaRemaining'
        X-Quota-Reset:
          $ref: '#/components/headers/QuotaReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: UNAUTHORIZED
            message: The API key is not valid
    PlanRequired:
      description: The account of the key has no active data API plan.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-Quota-Unit:
          $ref: '#/components/headers/QuotaUnit'
        X-Credits-Used:
          $ref: '#/components/headers/CreditsUsed'
        X-Quota-Limit:
          $ref: '#/components/headers/QuotaLimit'
        X-Quota-Remaining:
          $ref: '#/components/headers/QuotaRemaining'
        X-Quota-Reset:
          $ref: '#/components/headers/QuotaReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: PLAN_REQUIRED
            message: The account of this key has no active data API plan
    NotFound:
      description: No company has this ticker or CIK.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-Quota-Unit:
          $ref: '#/components/headers/QuotaUnit'
        X-Credits-Used:
          $ref: '#/components/headers/CreditsUsed'
        X-Quota-Limit:
          $ref: '#/components/headers/QuotaLimit'
        X-Quota-Remaining:
          $ref: '#/components/headers/QuotaRemaining'
        X-Quota-Reset:
          $ref: '#/components/headers/QuotaReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: NOT_FOUND
            message: No company has this ticker or CIK
    RateLimited:
      description: >-
        The key sent more requests in a minute than its limit (RATE_LIMITED), or
        its account has no credits left (QUOTA_EXCEEDED).
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-Quota-Unit:
          $ref: '#/components/headers/QuotaUnit'
        X-Credits-Used:
          $ref: '#/components/headers/CreditsUsed'
        X-Quota-Limit:
          $ref: '#/components/headers/QuotaLimit'
        X-Quota-Remaining:
          $ref: '#/components/headers/QuotaRemaining'
        X-Quota-Reset:
          $ref: '#/components/headers/QuotaReset'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: RATE_LIMITED
            message: Too many requests
    InternalError:
      description: Darvas failed; the error is reported.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-Quota-Unit:
          $ref: '#/components/headers/QuotaUnit'
        X-Credits-Used:
          $ref: '#/components/headers/CreditsUsed'
        X-Quota-Limit:
          $ref: '#/components/headers/QuotaLimit'
        X-Quota-Remaining:
          $ref: '#/components/headers/QuotaRemaining'
        X-Quota-Reset:
          $ref: '#/components/headers/QuotaReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: INTERNAL_ERROR
            message: Something went wrong
    Unavailable:
      description: The data store is unavailable.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        X-Quota-Unit:
          $ref: '#/components/headers/QuotaUnit'
        X-Credits-Used:
          $ref: '#/components/headers/CreditsUsed'
        X-Quota-Limit:
          $ref: '#/components/headers/QuotaLimit'
        X-Quota-Remaining:
          $ref: '#/components/headers/QuotaRemaining'
        X-Quota-Reset:
          $ref: '#/components/headers/QuotaReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: UNAVAILABLE
            message: The data service is unavailable
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: 'A Darvas data API key: dvk_ and 43 characters.'
    bearerKey:
      type: http
      scheme: bearer
      description: The same key as a Bearer token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.