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

# Market Data Overview

> Exchange-level and CryptoQuant-aggregated spot & derivatives data in API v2 — OHLCV, trade, funding rate, open interest, and liquidation.

API v2 Market Data serves raw **market** time-series — prices, volumes, and derivatives
metrics — both per individual exchange and as CryptoQuant's cross-exchange aggregate. It uses
the same `status`/`result` envelope, Bearer authentication, and `window`/`from`/`to` time
convention as the rest of the API.

## Endpoint structure

Every market data endpoint follows one shape:

```text theme={null}
/v2/market/{origin}/{instrument}/{metric}
```

| Segment      | Values                                                           | Meaning                                                      |
| ------------ | ---------------------------------------------------------------- | ------------------------------------------------------------ |
| `origin`     | `exchange`, `cq`                                                 | Per-exchange data, or CryptoQuant's cross-exchange aggregate |
| `instrument` | `spot`, `swap`                                                   | Cash (spot) market, or perpetual/futures (swap)              |
| `metric`     | `ohlcv`, `trade`, `funding-rate`, `open-interest`, `liquidation` | The dataset                                                  |

Not every combination exists — `funding-rate`, `open-interest`, and `liquidation` are
derivatives-only (`swap`), so there is no `spot` variant.

| Metric                                                  | `exchange/spot` | `exchange/swap` | `cq/spot` | `cq/swap` |
| ------------------------------------------------------- | :-------------: | :-------------: | :-------: | :-------: |
| [OHLCV](/v2/market/exchange-spot-ohlcv)                 |        ✓        |        ✓        |     ✓     |     ✓     |
| [Trade](/v2/market/exchange-spot-trade)                 |        ✓        |        ✓        |     ✓     |     ✓     |
| [Funding Rate](/v2/market/exchange-swap-funding-rate)   |        —        |        ✓        |     —     |     ✓     |
| [Open Interest](/v2/market/exchange-swap-open-interest) |        —        |        ✓        |     —     |     ✓     |
| [Liquidation](/v2/market/exchange-swap-liquidation)     |        —        |        ✓        |     —     |     ✓     |

## Origin: `exchange` vs `cq`

* **`exchange`** — data for one named exchange. Requires an `exchange` parameter
  (e.g. `binance`) and per-quote `symbol`s such as `btc_usdt`.
* **`cq`** — CryptoQuant's cross-exchange aggregate. Takes **no** `exchange`
  parameter, and is selected by aggregated `symbol`s such as `btc_all`.

## Symbols

The `symbol` parameter selects the trading pair. There are two symbol classes:

| Class                      | Example    | Where                                                        |
| -------------------------- | ---------- | ------------------------------------------------------------ |
| **Per-quote**              | `btc_usdt` | Exchange origin — a specific base/quote pair on one exchange |
| **All-quote (aggregated)** | `btc_all`  | CQ origin — one base aggregated across all quotes/exchanges  |

For **funding rate, open interest, and liquidation**, the `exchange` endpoints are
*dual-class*: a `btc_usdt` symbol returns the single pair, while `btc_all` returns that
exchange's all-quote aggregate across all its quote currencies.

Because `exchange` and `symbol` are open-ended, use the discovery endpoints to enumerate
valid values:

* [List Active Exchanges](/v2/market/info-exchanges) — `/v2/market/info/exchanges`
* [List Active Symbols](/v2/market/info-symbols) — `/v2/market/info/symbols`

A typical first-time flow: call **exchanges** to pick an exchange, then **symbols** for the
endpoint you want, then query the data endpoint with those values.

<Note>
  Discovery returns what has been **active in the last 30 days**. Delisted or illiquid
  symbols are hidden there, but can still be queried directly with `from`/`to`.
</Note>

## Linear vs inverse (`swap` only)

Swap endpoints accept an optional `inverse` flag:

* `inverse=false` (default) — **linear** contracts (USDⓈ-margined).
* `inverse=true` — **inverse** contracts (coin-margined).

`inverse` only applies to `swap`. Spot endpoints don't take it — sending `inverse` to a
`spot` endpoint is ignored (the request still succeeds).

## Time parameters

Identical to the rest of the API — see [Time Convention](/guides/time-convention).

| Parameter    | Notes                                                               |
| ------------ | ------------------------------------------------------------------- |
| `window`     | `day` (default), `hour`, `10min`, `min`                             |
| `from`, `to` | `YYYYMMDDTHHMMSS` (UTC); `YYYYMMDD` also accepted when `window=day` |
| `limit`      | Max rows returned (default 100, max 10000)                          |
| `format`     | `json` (default) or `csv`                                           |

Market timestamps are returned as `datetime` in `YYYY-MM-DD HH:MM:SS` (UTC).

## Response envelope

```jsonc theme={null}
{
  "status": { "code": 200, "message": "success" },
  "result": {
    "window": "day",
    "data": [
      { "datetime": "2024-01-01 00:00:00", "symbol": "btc_usdt", "base": "btc", "quote": "usdt",
        "open": 42280.0, "high": 44200.0, "low": 42120.0, "close": 44180.0,
        "volume": 18342.5, "quote_volume": 794512000.0 }
    ]
  }
}
```

Each metric page below documents its own response fields, parameters, and an interactive
playground.
