# BTC Market Data

This namespace contains endpoints to retrieve metrics related to the value of Bitcoin, including price, open interest, market cap, realized cap, etc. On top of providing basic market data like price and market cap, we focus on onchain indicators in order to evaluate the true value of Bitcoin. These indicators have been commonly used in building long term valuations, and identifying lows and highs. For more detailed information, please refer to the description of each metric.

## Price OHLCV

> This endpoint returns metrics related to BTC price. \
> We provide two types of price, CryptoQuant's BTC Index Price and USD or USDT price of BTC of global exchanges.\
> \
> Price OHLCV data consists of five metrics. \
> \`open\`, the opening price at the beginning of the window, \`close\`, USD closing price at the end of the window, \
> \`high\`, the highest USD price in a given window, \`low\`, the lowest USD price in a given window, \
> and \`volume\`, the total volume traded in a given window. \
> \
> At this endpoint, metrics are calculated by Minute, Hour and Day. \
> \
> BTC Index Price is calculated by taking VWAP(Volume Weighted Average Price) of BTC price data aggregated from all exchanges we provide. The exchanges we provide are as follows. \
> \
> \<br>\
> \
> \### Supported Exchanges By Market\
> \
> \| Name | Market  |    Supported Exchanges     |\
> \|--------|---------|----------------------------|\
> \| Spot   | \`spot\`  | All Exchange\*, Binance, Binance US, Bitfinex, Bittrex, Coinbase Advanced, FTX\*\*, Gemini, HTX Global, Kraken, OKX |\
> \| Perpetual   | \`perpetual\`  | All Exchange\*, Binance, Bitmex, Bybit, Deribit, FTX\*\*, HTX Global, OKX |\
> \
> \> (\*) Default exchange \<br>\
> \> (\*\*) Use in cautions due to the deprecation (no data update)\
> \
> In order to get USD or USDT price of BTC of specific exchange from above (eg. \`btcusdt\` pair of \`binance\`), \
> you must specify \`market\`, \`exchange\` and \`symbol\` of BTC pair.  \
> \
> For \`volume\` metric, the unit of volume could be USD, USDT or BTC. \
> This is because exchanges have their own price data policy. All Exchange's \`volume\` is in BTC and available since the earliest time of exchanges. \
> Please refer to volume unit of each exchange from below table.  \
> \
> \<br>\
> \
> \### Supported Pairs By Exchange\
> \
> \#### ◦ Spot\
> \| Name           |   Exchange       | Symbol                      | Volume Unit  | Available Since   |\
> \|----------------|------------------|-----------------------------|--------------|-------------------------------|\
> \| All Exchange   | \`all\_exchange\`   |  \`btc\_usd\`\*                  |    BTC       |  2009-01-03 18:15:00          |\
> \| Binance        | \`binance\`        |  \`btc\_usdt\`\*                 |    BTC       | 2017-08-17 04:00:00           |\
> \| Binance US     | \`binance\_us\`     |  \`btc\_usd\`\* \<br/> \`btc\_usdt\`  |    BTC       | 2019-09-17 10:17:00 \<br/> 2019-09-23 08:34:00 |\
> \| Bitfinex       | \`bitfinex\`       |  \`btc\_usd\`\* \<br/> \`btc\_usdt\`  |    BTC       | 2013-04-01 00:07:00 \<br/> 2019-03-11 10:05:00 |\
> \| Bittrex        | \`bittrex\`        |  \`btc\_usd\`\* \<br/> \`btc\_usdt\`  |    USD \<br/> USDT | 2018-05-31 16:26:00 \<br/> 2015-12-12 14:59:00 |\
> \| Coinbase Advanced   | \`coinbase\_advanced\`   |  \`btc\_usd\`\*                  |    BTC       | 2015-07-20 21:37:00  \
> \| FTX\*\*            | \`ftx\`            |  \`btc\_usd\`\* \<br/> \`btc\_usdt\`  |    USD \<br/> USDT | 2019-07-21 13:11:00 \<br/> 2020-03-28 14:40:00 |\
> \| Gemini         | \`gemini\`         |  \`btc\_usd\`\*                  |    BTC       | 2019-08-30 00:00:00           |\
> \| HTX Global   | \`htx\_global\`   |  \`btc\_usdt\`\*                 |    BTC       | 2019-11-19 00:00:00           |\
> \| Kraken         | \`kraken\`         |  \`btc\_usd\`\* \<br/> \`btc\_usdt\`  |    BTC       | 2013-10-06 21:34:00 \<br/> 2019-12-19 18:06:00 |\
> \| OKX            | \`okx\`           |  \`btc\_usdt\`\*                 |    BTC       | 2019-10-01 00:00:00           |\
> \
> \#### ◦ Perpetual\
> \|    Exchange    | Exchange Symbol  |     Pair Symbol               |    Volume         |    Historical Starting Point   |\
> \|----------------|------------------|-------------------------------|-------------------|--------------------------------|\
> \| All Exchange   | \`all\_exchange\`   |  \`btc\_usd\`\*                   |    BTC            |  The earliest time in the exchanges below.         |\
> \| Binance        | \`binance\`        |  \`btc\_usd\`\* \<br/> \`btc\_usdt\`  |    Cont \<br/> BTC | 2020-08-11 07:02:00 \<br/> 2019-09-08 17:57:00 |\
> \| Bitmex         | \`bitmex\`         |  \`btc\_usd\`\*                   |    USD            | 2015-09-25 12:34:00            |\
> \| Bybit          | \`bybit\`          |  \`btc\_usd\`\* \<br/> \`btc\_usdt\`  |    USD  \<br/> BTC | 2018-11-14 16:00:00 \<br/> 2020-03-25 10:36:00 |\
> \| Deribit        | \`deribit\`        |  \`btc\_usd\`\*                   |    USD            | 2018-08-14 10:34:00  |\
> \| FTX\*\*            | \`ftx\`            |  \`btc\_usd\`\*                   |    USD            | 2019-07-20 12:35:00 |\
> \| HTX Global   | \`htx\_global\`   |  \`btc\_usd\`\* \<br/> \`btc\_usdt\`  |    Cont \<br/> BTC | 2020-03-25 09:45:00 \<br/> 2020-10-21 09:08:00 |\
> \| OKX            | \`okx\`           |  \`btc\_usd\`\* \<br/> \`btc\_usdt\`  |    Cont \<br/> BTC | 2019-03-30 00:00:00 \<br/> 2019-12-25 00:00:00 |\
> \
> \> (\*) Default exchange \<br>\
> \> (\*\*) Use in cautions due to the deprecation (no data update)\
> \
> \> We calculate the OHLCV data of a day from the beginning of UTC 00:00:00. \
> \> However, the OHLCV data in official sites of HTX and OKX are calculated from the beginning of UTC 16:00:00. \
> \> Thus, be aware that there may be some intended discrepancy between those.\
> \
> \<br>\
> \
> \### Supported Windows By Market\
> \
> \|   Market  |   Supported Windows           |\
> \|-----------|-------------------------------|\
> \| Spot      | \`min\`, \`hour\`, \`day\*\`         |\
> \| Perpetual | \`min\`, \`hour\`, \`day\*\`         |\
> \
> \> (\*) Default exchange

```json
{"openapi":"3.0.0","info":{"title":"CryptoQuant Data API","version":"1.3.0"},"tags":[{"name":"BTC Market Data","description":"This namespace contains endpoints to retrieve metrics related to the value of Bitcoin, including price, open interest, market cap, realized cap, etc. On top of providing basic market data like price and market cap, we focus on onchain indicators in order to evaluate the true value of Bitcoin. These indicators have been commonly used in building long term valuations, and identifying lows and highs. For more detailed information, please refer to the description of each metric."}],"servers":[{"url":"https://api.cryptoquant.com/v1/","description":"Default server"}],"security":[{"Access Token":[]}],"components":{"securitySchemes":{"Access Token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"For each API request, include this HTTP header:\n`Authorization` with the `Bearer {access_token}`. Bearer access token is the type of HTTP Authorization.  You have to include access token to the HTTP header and note that leading bearer is required.\nYou must include your access token in HTTP header in every request you make. The token is unique, issued for each client, and regularly changed(once a year). To obtain an access token, please [upgrade your plan](https://cryptoquant.com/pricing) to Professional or Premium plan. You'll be able to see your access token on the [API tab](https://cryptoquant.com/settings/api) of your profile page after the subscription."}},"parameters":{"market_btc":{"description":"A market type from the table that we support. [See here](#operation/getBTCPriceOHLCV)","explode":false,"in":"query","name":"market","required":false,"schema":{"type":"string","default":"spot"},"style":"form"},"btc_exchange_ohlcv":{"description":"A exchange from the table that we support. [See here](#operation/getBTCPriceOHLCV).","explode":false,"in":"query","name":"exchange","required":false,"schema":{"type":"string","default":"all_exchange"},"style":"form"},"symbol_btc_ohlcv":{"description":"A BTC pair symbol from the table that we support. [See here](#operation/getBTCPriceOHLCV)","explode":false,"in":"query","name":"symbol","required":false,"schema":{"type":"string"},"style":"form"},"window_mdh_btc_spotperp":{"description":"A window from the table that we support. [See here](#operation/getBTCPriceOHLCV)","explode":false,"in":"query","name":"window","schema":{"type":"string","default":"day"},"style":"form"},"from":{"description":"This defines the starting time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the earliest time.","explode":false,"in":"query","name":"from","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"to":{"description":"This defines the ending time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the latest time.","explode":false,"in":"query","name":"to","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"limit":{"description":"The maximum number of entries to return before the latest data point (or before `to` if specified). This field ranges from 1 to 100,000.","explode":false,"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":100,"minimum":1,"maximum":100000},"style":"form"},"format":{"description":"A format type about return message type. Supported formats are json, csv.","explode":false,"in":"query","name":"format","required":false,"schema":{"type":"string","default":"json"},"style":"form"}},"responses":{"PriceOHLCV":{"description":"Price OHLCV Data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceOHLCVResponse"}}}}},"schemas":{"PriceOHLCVResponse":{"type":"object","required":["status","result"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"result":{"type":"object","required":["window","data"],"properties":{"window":{"$ref":"#/components/schemas/Window_MDHB"},"data":{"type":"array","items":{"type":"object","required":["open","high","low","close","volume"],"properties":{"blockheight":{"$ref":"#/components/schemas/Blockheight"},"date":{"$ref":"#/components/schemas/Date"},"datetime":{"$ref":"#/components/schemas/Datetime"},"open":{"type":"decimal","description":"opening price at the beginning of the window."},"high":{"type":"decimal","description":"opening price at the end of the window."},"low":{"type":"decimal","description":"The highest price in a given window."},"close":{"type":"decimal","description":"The lowest price in a given window."},"volume":{"type":"decimal","description":"The total traded amount in a given window."}}}}}}}},"Status":{"type":"object","description":"The status object is return with most of requests and indicates if the request was successful. If it is not successful, error information is included.","properties":{"code":{"type":"integer","format":"int32","description":"HTTP status code"},"message":{"type":"string","description":"Text description of the error or success."}},"required":["code","message"]},"Window_MDHB":{"type":"string","description":"The size of window. It can be day, hour, min, or block and it depends on the user request."},"Blockheight":{"type":"string","description":"The height of the block. This optional field only appears when window=block is used."},"Date":{"type":"string","description":"The date in YYYY-DD-MM. This optional field only appears when window=day is used."},"Datetime":{"type":"string","description":"The date and time formatted as YYYY-MM-DD HH:MM:SS (UTC time). This field only appears when window=block is used."}}},"paths":{"/btc/market-data/price-ohlcv":{"get":{"tags":["BTC Market Data"],"summary":"Price OHLCV","description":"This endpoint returns metrics related to BTC price. \nWe provide two types of price, CryptoQuant's BTC Index Price and USD or USDT price of BTC of global exchanges.\n\nPrice OHLCV data consists of five metrics. \n`open`, the opening price at the beginning of the window, `close`, USD closing price at the end of the window, \n`high`, the highest USD price in a given window, `low`, the lowest USD price in a given window, \nand `volume`, the total volume traded in a given window. \n\nAt this endpoint, metrics are calculated by Minute, Hour and Day. \n\nBTC Index Price is calculated by taking VWAP(Volume Weighted Average Price) of BTC price data aggregated from all exchanges we provide. The exchanges we provide are as follows. \n\n<br>\n\n### Supported Exchanges By Market\n\n| Name | Market  |    Supported Exchanges     |\n|--------|---------|----------------------------|\n| Spot   | `spot`  | All Exchange*, Binance, Binance US, Bitfinex, Bittrex, Coinbase Advanced, FTX**, Gemini, HTX Global, Kraken, OKX |\n| Perpetual   | `perpetual`  | All Exchange*, Binance, Bitmex, Bybit, Deribit, FTX**, HTX Global, OKX |\n\n> (*) Default exchange <br>\n> (**) Use in cautions due to the deprecation (no data update)\n\nIn order to get USD or USDT price of BTC of specific exchange from above (eg. `btcusdt` pair of `binance`), \nyou must specify `market`, `exchange` and `symbol` of BTC pair.  \n\nFor `volume` metric, the unit of volume could be USD, USDT or BTC. \nThis is because exchanges have their own price data policy. All Exchange's `volume` is in BTC and available since the earliest time of exchanges. \nPlease refer to volume unit of each exchange from below table.  \n\n<br>\n\n### Supported Pairs By Exchange\n\n#### ◦ Spot\n| Name           |   Exchange       | Symbol                      | Volume Unit  | Available Since   |\n|----------------|------------------|-----------------------------|--------------|-------------------------------|\n| All Exchange   | `all_exchange`   |  `btc_usd`*                  |    BTC       |  2009-01-03 18:15:00          |\n| Binance        | `binance`        |  `btc_usdt`*                 |    BTC       | 2017-08-17 04:00:00           |\n| Binance US     | `binance_us`     |  `btc_usd`* <br/> `btc_usdt`  |    BTC       | 2019-09-17 10:17:00 <br/> 2019-09-23 08:34:00 |\n| Bitfinex       | `bitfinex`       |  `btc_usd`* <br/> `btc_usdt`  |    BTC       | 2013-04-01 00:07:00 <br/> 2019-03-11 10:05:00 |\n| Bittrex        | `bittrex`        |  `btc_usd`* <br/> `btc_usdt`  |    USD <br/> USDT | 2018-05-31 16:26:00 <br/> 2015-12-12 14:59:00 |\n| Coinbase Advanced   | `coinbase_advanced`   |  `btc_usd`*                  |    BTC       | 2015-07-20 21:37:00  \n| FTX**            | `ftx`            |  `btc_usd`* <br/> `btc_usdt`  |    USD <br/> USDT | 2019-07-21 13:11:00 <br/> 2020-03-28 14:40:00 |\n| Gemini         | `gemini`         |  `btc_usd`*                  |    BTC       | 2019-08-30 00:00:00           |\n| HTX Global   | `htx_global`   |  `btc_usdt`*                 |    BTC       | 2019-11-19 00:00:00           |\n| Kraken         | `kraken`         |  `btc_usd`* <br/> `btc_usdt`  |    BTC       | 2013-10-06 21:34:00 <br/> 2019-12-19 18:06:00 |\n| OKX            | `okx`           |  `btc_usdt`*                 |    BTC       | 2019-10-01 00:00:00           |\n\n#### ◦ Perpetual\n|    Exchange    | Exchange Symbol  |     Pair Symbol               |    Volume         |    Historical Starting Point   |\n|----------------|------------------|-------------------------------|-------------------|--------------------------------|\n| All Exchange   | `all_exchange`   |  `btc_usd`*                   |    BTC            |  The earliest time in the exchanges below.         |\n| Binance        | `binance`        |  `btc_usd`* <br/> `btc_usdt`  |    Cont <br/> BTC | 2020-08-11 07:02:00 <br/> 2019-09-08 17:57:00 |\n| Bitmex         | `bitmex`         |  `btc_usd`*                   |    USD            | 2015-09-25 12:34:00            |\n| Bybit          | `bybit`          |  `btc_usd`* <br/> `btc_usdt`  |    USD  <br/> BTC | 2018-11-14 16:00:00 <br/> 2020-03-25 10:36:00 |\n| Deribit        | `deribit`        |  `btc_usd`*                   |    USD            | 2018-08-14 10:34:00  |\n| FTX**            | `ftx`            |  `btc_usd`*                   |    USD            | 2019-07-20 12:35:00 |\n| HTX Global   | `htx_global`   |  `btc_usd`* <br/> `btc_usdt`  |    Cont <br/> BTC | 2020-03-25 09:45:00 <br/> 2020-10-21 09:08:00 |\n| OKX            | `okx`           |  `btc_usd`* <br/> `btc_usdt`  |    Cont <br/> BTC | 2019-03-30 00:00:00 <br/> 2019-12-25 00:00:00 |\n\n> (*) Default exchange <br>\n> (**) Use in cautions due to the deprecation (no data update)\n\n> We calculate the OHLCV data of a day from the beginning of UTC 00:00:00. \n> However, the OHLCV data in official sites of HTX and OKX are calculated from the beginning of UTC 16:00:00. \n> Thus, be aware that there may be some intended discrepancy between those.\n\n<br>\n\n### Supported Windows By Market\n\n|   Market  |   Supported Windows           |\n|-----------|-------------------------------|\n| Spot      | `min`, `hour`, `day*`         |\n| Perpetual | `min`, `hour`, `day*`         |\n\n> (*) Default exchange","operationId":"getBTCPriceOHLCV","parameters":[{"$ref":"#/components/parameters/market_btc"},{"$ref":"#/components/parameters/btc_exchange_ohlcv"},{"$ref":"#/components/parameters/symbol_btc_ohlcv"},{"$ref":"#/components/parameters/window_mdh_btc_spotperp"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/format"}],"responses":{"200":{"$ref":"#/components/responses/PriceOHLCV"}}}}}}
```

## Open Interest

> This endpoint returns BTC Perpetual Open Interest from derivative exchanges. Supported exchanges for Open Interest are below. Note we unify the unit of return value to USD for each exchange where its contract specification may vary.\
> \
> \| Name           |   Exchange     | Symbol |  Available Since   |\
> \|----------------|--------------|-------------|-----------------------------|\
> \| All Exchanges  |   \`all\_exchange\` | \`all\_symbol\`   | The earliest time in the exchanges below. |\
> \| Binance        |   \`binance\`  |    \`all\_symbol\` \<br/> \`btc\_busd\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\`  | The earliest time in the symbols. \<br/> 2021-01-12 00:00:00 \<br/> 2020-08-11 00:00:00 \<br/> 2020-03-13 02:13:00      |\
> \| Bitfinex       |   \`bitfinex\` |    \`all\_symbol\` \<br/> \`btc\_usdt\`  | The earliest time in the symbols. \<br/> 2020-06-01 00:00:00  |\
> \| Bitmex         |   \`bitmex\`   |    \`all\_symbol\` \<br/> \`btc\_usd\`  | The earliest time in the symbols. \<br/> 2019-03-30 00:00:00  |\
> \| Bybit          |   \`bybit\`    |    \`all\_symbol\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\` | The earliest time in the symbols. \<br/> 2019-11-07 00:00:00 \<br/> 2020-05-28 00:00:00 |\
> \| Deribit        |   \`deribit\`  |    \`all\_symbol\` \<br/> \`btc\_usd\`  | The earliest time in the symbols. \<br/> 2019-03-30 00:00:00        |\
> \| FTX\*\*            |   \`ftx\`      |    \`all\_symbol\` \<br/> \`btc\_usd\` | The earliest time in the symbols. \<br/> 2020-05-13 00:00:00  |\
> \| Gate.io        |   \`gate\_io\`      | \`all\_symbol\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\` | The earliest time in the symbols. \<br/> 2020-07-01 00:00:00 \<br/> 2020-07-01 00:00:00 |\
> \| HTX Global   |   \`htx\_global\` | \`all\_symbol\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\` | The earliest time in the symbols. \<br/> 2020-06-23 00:00:00 \<br/> 2021-08-26 04:00:00 |\
> \| Kraken         |   \`kraken\`       | \`all\_symbol\` \<br/> \`btc\_usd\` | The earliest time in the symbols. \<br/> 2019-03-30 00:00:00  |\
> \| OKX            |   \`okx\`         | \`all\_symbol\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\` | The earliest time in the symbols. \<br/> 2019-09-05 23:59:00 \<br/> 2020-01-01 00:00:00 |\
> \
> \> (\*\*) Use in cautions due to the deprecation (no data update)

```json
{"openapi":"3.0.0","info":{"title":"CryptoQuant Data API","version":"1.3.0"},"tags":[{"name":"BTC Market Data","description":"This namespace contains endpoints to retrieve metrics related to the value of Bitcoin, including price, open interest, market cap, realized cap, etc. On top of providing basic market data like price and market cap, we focus on onchain indicators in order to evaluate the true value of Bitcoin. These indicators have been commonly used in building long term valuations, and identifying lows and highs. For more detailed information, please refer to the description of each metric."}],"servers":[{"url":"https://api.cryptoquant.com/v1/","description":"Default server"}],"security":[{"Access Token":[]}],"components":{"securitySchemes":{"Access Token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"For each API request, include this HTTP header:\n`Authorization` with the `Bearer {access_token}`. Bearer access token is the type of HTTP Authorization.  You have to include access token to the HTTP header and note that leading bearer is required.\nYou must include your access token in HTTP header in every request you make. The token is unique, issued for each client, and regularly changed(once a year). To obtain an access token, please [upgrade your plan](https://cryptoquant.com/pricing) to Professional or Premium plan. You'll be able to see your access token on the [API tab](https://cryptoquant.com/settings/api) of your profile page after the subscription."}},"parameters":{"btc_exchange_oi":{"description":"A derivative exchange from the table that we support. [See here](#operation/BTCgetOpenInterest).","explode":false,"in":"query","name":"exchange","required":true,"schema":{"type":"string"},"style":"form"},"window_mhd":{"description":"Currently we support `day`, `hour`, and `min`.","explode":false,"in":"query","name":"window","schema":{"type":"string","default":"day"},"style":"form"},"from":{"description":"This defines the starting time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the earliest time.","explode":false,"in":"query","name":"from","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"to":{"description":"This defines the ending time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the latest time.","explode":false,"in":"query","name":"to","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"limit":{"description":"The maximum number of entries to return before the latest data point (or before `to` if specified). This field ranges from 1 to 100,000.","explode":false,"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":100,"minimum":1,"maximum":100000},"style":"form"},"format":{"description":"A format type about return message type. Supported formats are json, csv.","explode":false,"in":"query","name":"format","required":false,"schema":{"type":"string","default":"json"},"style":"form"}},"responses":{"OpenInterest":{"description":"Open Interest in USD","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenInterestResponse"}}}}},"schemas":{"OpenInterestResponse":{"type":"object","required":["status","result"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"result":{"type":"object","required":["window","data"],"properties":{"window":{"$ref":"#/components/schemas/Window_MDH"},"data":{"type":"array","items":{"type":"object","required":["open_interest"],"properties":{"date":{"$ref":"#/components/schemas/Date"},"datetime":{"$ref":"#/components/schemas/Datetime"},"open_interest":{"type":"string","description":"The amount of open interest in the given period and exchange. The standard unit can differ from each exchange."}}}}}}}},"Status":{"type":"object","description":"The status object is return with most of requests and indicates if the request was successful. If it is not successful, error information is included.","properties":{"code":{"type":"integer","format":"int32","description":"HTTP status code"},"message":{"type":"string","description":"Text description of the error or success."}},"required":["code","message"]},"Window_MDH":{"type":"string","description":"The size of window. It can be day, hour, or min and it depends on the user request."},"Date":{"type":"string","description":"The date in YYYY-DD-MM. This optional field only appears when window=day is used."},"Datetime":{"type":"string","description":"The date and time formatted as YYYY-MM-DD HH:MM:SS (UTC time). This field only appears when window=block is used."}}},"paths":{"/btc/market-data/open-interest":{"get":{"tags":["BTC Market Data"],"summary":"Open Interest","description":"This endpoint returns BTC Perpetual Open Interest from derivative exchanges. Supported exchanges for Open Interest are below. Note we unify the unit of return value to USD for each exchange where its contract specification may vary.\n\n| Name           |   Exchange     | Symbol |  Available Since   |\n|----------------|--------------|-------------|-----------------------------|\n| All Exchanges  |   `all_exchange` | `all_symbol`   | The earliest time in the exchanges below. |\n| Binance        |   `binance`  |    `all_symbol` <br/> `btc_busd` <br/> `btc_usd` <br/> `btc_usdt`  | The earliest time in the symbols. <br/> 2021-01-12 00:00:00 <br/> 2020-08-11 00:00:00 <br/> 2020-03-13 02:13:00      |\n| Bitfinex       |   `bitfinex` |    `all_symbol` <br/> `btc_usdt`  | The earliest time in the symbols. <br/> 2020-06-01 00:00:00  |\n| Bitmex         |   `bitmex`   |    `all_symbol` <br/> `btc_usd`  | The earliest time in the symbols. <br/> 2019-03-30 00:00:00  |\n| Bybit          |   `bybit`    |    `all_symbol` <br/> `btc_usd` <br/> `btc_usdt` | The earliest time in the symbols. <br/> 2019-11-07 00:00:00 <br/> 2020-05-28 00:00:00 |\n| Deribit        |   `deribit`  |    `all_symbol` <br/> `btc_usd`  | The earliest time in the symbols. <br/> 2019-03-30 00:00:00        |\n| FTX**            |   `ftx`      |    `all_symbol` <br/> `btc_usd` | The earliest time in the symbols. <br/> 2020-05-13 00:00:00  |\n| Gate.io        |   `gate_io`      | `all_symbol` <br/> `btc_usd` <br/> `btc_usdt` | The earliest time in the symbols. <br/> 2020-07-01 00:00:00 <br/> 2020-07-01 00:00:00 |\n| HTX Global   |   `htx_global` | `all_symbol` <br/> `btc_usd` <br/> `btc_usdt` | The earliest time in the symbols. <br/> 2020-06-23 00:00:00 <br/> 2021-08-26 04:00:00 |\n| Kraken         |   `kraken`       | `all_symbol` <br/> `btc_usd` | The earliest time in the symbols. <br/> 2019-03-30 00:00:00  |\n| OKX            |   `okx`         | `all_symbol` <br/> `btc_usd` <br/> `btc_usdt` | The earliest time in the symbols. <br/> 2019-09-05 23:59:00 <br/> 2020-01-01 00:00:00 |\n\n> (**) Use in cautions due to the deprecation (no data update)","operationId":"BTCgetOpenInterest","parameters":[{"$ref":"#/components/parameters/btc_exchange_oi"},{"$ref":"#/components/parameters/window_mhd"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/format"}],"responses":{"200":{"$ref":"#/components/responses/OpenInterest"}}}}}}
```

## Funding Rates

> Funding rates represents traders' sentiments of which position they bet on in perpetual swaps market. Positive funding rates implies that many traders are bullish and long traders pay funding to short traders. Negative funding rates implies many traders are bearish and short traders pay funding to long traders.\
> \
> \| Name           |   Exchange     | Symbol |  Available Since   |\
> \|----------------|--------------|----|-------------------------|\
> \| All Exchanges  |   \`all\_exchange\` | | The earliest time in the exchanges below. |\
> \| Binance        |   \`binance\`  | BTC-USDT  | 2019-09-10 00:00:00        |\
> \| Bybit          |   \`bybit\`    | BTC-USD | 2019-12-01 00:00:00        |\
> \| Bitmex         |   \`bitmex\`   | BTC-USD | 2016-05-14 04:00:00  |\
> \| Deribit        |   \`deribit\`  | BTC-PERPETUAL | 2019-03-30 00:00:00        |\
> \| HTX Global   |   \`htx\_global\` | BTC-USD  | 2020-03-25 04:00:00       |\
> \| OKX            |   \`okx\`     | BTC-USD | 2019-04-01 00:00:00        |

```json
{"openapi":"3.0.0","info":{"title":"CryptoQuant Data API","version":"1.3.0"},"tags":[{"name":"BTC Market Data","description":"This namespace contains endpoints to retrieve metrics related to the value of Bitcoin, including price, open interest, market cap, realized cap, etc. On top of providing basic market data like price and market cap, we focus on onchain indicators in order to evaluate the true value of Bitcoin. These indicators have been commonly used in building long term valuations, and identifying lows and highs. For more detailed information, please refer to the description of each metric."}],"servers":[{"url":"https://api.cryptoquant.com/v1/","description":"Default server"}],"security":[{"Access Token":[]}],"components":{"securitySchemes":{"Access Token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"For each API request, include this HTTP header:\n`Authorization` with the `Bearer {access_token}`. Bearer access token is the type of HTTP Authorization.  You have to include access token to the HTTP header and note that leading bearer is required.\nYou must include your access token in HTTP header in every request you make. The token is unique, issued for each client, and regularly changed(once a year). To obtain an access token, please [upgrade your plan](https://cryptoquant.com/pricing) to Professional or Premium plan. You'll be able to see your access token on the [API tab](https://cryptoquant.com/settings/api) of your profile page after the subscription."}},"parameters":{"exchange_fr":{"description":"A derivative exchange from the table that we support. [See here](#operation/getFundingRates).","explode":false,"in":"query","name":"exchange","required":true,"schema":{"type":"string"},"style":"form"},"window_mhd":{"description":"Currently we support `day`, `hour`, and `min`.","explode":false,"in":"query","name":"window","schema":{"type":"string","default":"day"},"style":"form"},"from":{"description":"This defines the starting time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the earliest time.","explode":false,"in":"query","name":"from","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"to":{"description":"This defines the ending time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the latest time.","explode":false,"in":"query","name":"to","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"limit":{"description":"The maximum number of entries to return before the latest data point (or before `to` if specified). This field ranges from 1 to 100,000.","explode":false,"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":100,"minimum":1,"maximum":100000},"style":"form"},"format":{"description":"A format type about return message type. Supported formats are json, csv.","explode":false,"in":"query","name":"format","required":false,"schema":{"type":"string","default":"json"},"style":"form"}},"responses":{"FundingRates":{"description":"Funding Rates in percentage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingRatesResponse"}}}}},"schemas":{"FundingRatesResponse":{"type":"object","required":["status","result"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"result":{"type":"object","required":["window","data"],"properties":{"window":{"$ref":"#/components/schemas/Window_MDH"},"data":{"type":"array","items":{"type":"object","required":["funding_rates"],"properties":{"date":{"$ref":"#/components/schemas/Date"},"datetime":{"$ref":"#/components/schemas/Datetime"},"funding_rates":{"type":"decimal","description":"Funding rates in the given period and exchange. The standard unit is percentage."}}}}}}}},"Status":{"type":"object","description":"The status object is return with most of requests and indicates if the request was successful. If it is not successful, error information is included.","properties":{"code":{"type":"integer","format":"int32","description":"HTTP status code"},"message":{"type":"string","description":"Text description of the error or success."}},"required":["code","message"]},"Window_MDH":{"type":"string","description":"The size of window. It can be day, hour, or min and it depends on the user request."},"Date":{"type":"string","description":"The date in YYYY-DD-MM. This optional field only appears when window=day is used."},"Datetime":{"type":"string","description":"The date and time formatted as YYYY-MM-DD HH:MM:SS (UTC time). This field only appears when window=block is used."}}},"paths":{"/btc/market-data/funding-rates":{"get":{"tags":["BTC Market Data"],"summary":"Funding Rates","description":"Funding rates represents traders' sentiments of which position they bet on in perpetual swaps market. Positive funding rates implies that many traders are bullish and long traders pay funding to short traders. Negative funding rates implies many traders are bearish and short traders pay funding to long traders.\n\n| Name           |   Exchange     | Symbol |  Available Since   |\n|----------------|--------------|----|-------------------------|\n| All Exchanges  |   `all_exchange` | | The earliest time in the exchanges below. |\n| Binance        |   `binance`  | BTC-USDT  | 2019-09-10 00:00:00        |\n| Bybit          |   `bybit`    | BTC-USD | 2019-12-01 00:00:00        |\n| Bitmex         |   `bitmex`   | BTC-USD | 2016-05-14 04:00:00  |\n| Deribit        |   `deribit`  | BTC-PERPETUAL | 2019-03-30 00:00:00        |\n| HTX Global   |   `htx_global` | BTC-USD  | 2020-03-25 04:00:00       |\n| OKX            |   `okx`     | BTC-USD | 2019-04-01 00:00:00        |","operationId":"BTCgetFundingRates","parameters":[{"$ref":"#/components/parameters/exchange_fr"},{"$ref":"#/components/parameters/window_mhd"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/format"}],"responses":{"200":{"$ref":"#/components/responses/FundingRates"}}}}}}
```

## Taker Buy Sell Stats

> Taker Buy/Sell Stats represent takers' sentiment of which position they are taking in the market. This metric is calculated with perpetual swap trades in each exchange.\
> \`taker\_buy\_volume\` is volume that takers buy.\
> \`taker\_sell\_volume\` is volume that takers sell.\
> \`taker\_total\_volume\` is the sum of \`taker\_buy\_volume\` and \`taker\_sell\_volume\`.\
> \`taker\_buy\_ratio\` is the ratio of \`taker\_buy\_volume\` divided by \`taker\_total\_volume\`.\
> \`taker\_sell\_ratio\` is the ratio of \`taker\_sell\_volume\` divided by \`taker\_total\_volume\`.\
> \`taker\_buy\_sell\_ratio\` is the ratio of \`taker\_buy\_volume\` divided by \`taker\_sell\_volume\`.\
> Note we unify the unit of return value to USD for each exchange where its contract specification may vary.\
> \
> \| Name           |   Exchange     | Symbol |  Available Since   |\
> \|----------------|--------------|------|-----------------------------|\
> \| All Exchanges  |   \`all\_exchange\` | | The earliest time in the exchanges below. |\
> \| Binance        |   \`binance\`  | BTC-USDT | 2019-09-08 17:57:00        |\
> \| Bybit          |   \`bybit\`    | BTC-USD | 2019-11-07 00:00:00        |\
> \| Bitmex         |   \`bitmex\`   | BTC-USD | 2015-09-25 12:34:00  |\
> \| Deribit        |   \`deribit\`  | BTC-PERPETUAL | 2019-03-30 00:00:00       |\
> \| HTX Global   |   \`htx\_global\` | BTC-USD  | 2020-03-28 00:00:00       |\
> \| OKX           |   \`okx\`     | BTC-USD | 2019-03-30 00:00:00        |

```json
{"openapi":"3.0.0","info":{"title":"CryptoQuant Data API","version":"1.3.0"},"tags":[{"name":"BTC Market Data","description":"This namespace contains endpoints to retrieve metrics related to the value of Bitcoin, including price, open interest, market cap, realized cap, etc. On top of providing basic market data like price and market cap, we focus on onchain indicators in order to evaluate the true value of Bitcoin. These indicators have been commonly used in building long term valuations, and identifying lows and highs. For more detailed information, please refer to the description of each metric."}],"servers":[{"url":"https://api.cryptoquant.com/v1/","description":"Default server"}],"security":[{"Access Token":[]}],"components":{"securitySchemes":{"Access Token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"For each API request, include this HTTP header:\n`Authorization` with the `Bearer {access_token}`. Bearer access token is the type of HTTP Authorization.  You have to include access token to the HTTP header and note that leading bearer is required.\nYou must include your access token in HTTP header in every request you make. The token is unique, issued for each client, and regularly changed(once a year). To obtain an access token, please [upgrade your plan](https://cryptoquant.com/pricing) to Professional or Premium plan. You'll be able to see your access token on the [API tab](https://cryptoquant.com/settings/api) of your profile page after the subscription."}},"parameters":{"exchange_lss":{"description":"A derivative exchange from the table that we support. [See here](#operation/getLongShortStats).","explode":false,"in":"query","name":"exchange","required":true,"schema":{"type":"string"},"style":"form"},"window_mhd":{"description":"Currently we support `day`, `hour`, and `min`.","explode":false,"in":"query","name":"window","schema":{"type":"string","default":"day"},"style":"form"},"from":{"description":"This defines the starting time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the earliest time.","explode":false,"in":"query","name":"from","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"to":{"description":"This defines the ending time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the latest time.","explode":false,"in":"query","name":"to","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"limit":{"description":"The maximum number of entries to return before the latest data point (or before `to` if specified). This field ranges from 1 to 100,000.","explode":false,"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":100,"minimum":1,"maximum":100000},"style":"form"},"format":{"description":"A format type about return message type. Supported formats are json, csv.","explode":false,"in":"query","name":"format","required":false,"schema":{"type":"string","default":"json"},"style":"form"}},"responses":{"TakerBuySellStats":{"description":"Taker Buy, Sell volume and ratio","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TakerBuySellStatsResponse"}}}}},"schemas":{"TakerBuySellStatsResponse":{"type":"object","required":["status","result"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"result":{"type":"object","required":["window","data"],"properties":{"window":{"$ref":"#/components/schemas/Window_MDH"},"data":{"type":"array","items":{"type":"object","required":["taker_buy_volume","taker_sell_volume","taker_buy_ratio","taker_sell_ratio","taker_buy_sell_ratio"],"properties":{"date":{"$ref":"#/components/schemas/Date"},"datetime":{"$ref":"#/components/schemas/Datetime"},"taker_buy_volume":{"type":"decimal","description":"Volume that takers buy in the given period and exchange."},"taker_sell_volume":{"type":"decimal","description":"Volume that takers sell in the given period and exchange."},"taker_buy_ratio":{"type":"decimal","description":"The ratio of taker buy volume to taker total volume in the given period and exchange. Taker total volume is sum of taker buy and sell volume."},"taker_sell_ratio":{"type":"decimal","description":"The ratio of taker sell volume to taker total volume in the given period and exchange. Taker total volume is sum of taker buy and sell volume."},"taker_buy_sell_ratio":{"type":"decimal","description":"The ratio fo taker buy volume to taker sell volume in the given period and exchange."}}}}}}}},"Status":{"type":"object","description":"The status object is return with most of requests and indicates if the request was successful. If it is not successful, error information is included.","properties":{"code":{"type":"integer","format":"int32","description":"HTTP status code"},"message":{"type":"string","description":"Text description of the error or success."}},"required":["code","message"]},"Window_MDH":{"type":"string","description":"The size of window. It can be day, hour, or min and it depends on the user request."},"Date":{"type":"string","description":"The date in YYYY-DD-MM. This optional field only appears when window=day is used."},"Datetime":{"type":"string","description":"The date and time formatted as YYYY-MM-DD HH:MM:SS (UTC time). This field only appears when window=block is used."}}},"paths":{"/btc/market-data/taker-buy-sell-stats":{"get":{"tags":["BTC Market Data"],"summary":"Taker Buy Sell Stats","description":"Taker Buy/Sell Stats represent takers' sentiment of which position they are taking in the market. This metric is calculated with perpetual swap trades in each exchange.\n`taker_buy_volume` is volume that takers buy.\n`taker_sell_volume` is volume that takers sell.\n`taker_total_volume` is the sum of `taker_buy_volume` and `taker_sell_volume`.\n`taker_buy_ratio` is the ratio of `taker_buy_volume` divided by `taker_total_volume`.\n`taker_sell_ratio` is the ratio of `taker_sell_volume` divided by `taker_total_volume`.\n`taker_buy_sell_ratio` is the ratio of `taker_buy_volume` divided by `taker_sell_volume`.\nNote we unify the unit of return value to USD for each exchange where its contract specification may vary.\n\n| Name           |   Exchange     | Symbol |  Available Since   |\n|----------------|--------------|------|-----------------------------|\n| All Exchanges  |   `all_exchange` | | The earliest time in the exchanges below. |\n| Binance        |   `binance`  | BTC-USDT | 2019-09-08 17:57:00        |\n| Bybit          |   `bybit`    | BTC-USD | 2019-11-07 00:00:00        |\n| Bitmex         |   `bitmex`   | BTC-USD | 2015-09-25 12:34:00  |\n| Deribit        |   `deribit`  | BTC-PERPETUAL | 2019-03-30 00:00:00       |\n| HTX Global   |   `htx_global` | BTC-USD  | 2020-03-28 00:00:00       |\n| OKX           |   `okx`     | BTC-USD | 2019-03-30 00:00:00        |","operationId":"BTCgetTakerBuySellStats","parameters":[{"$ref":"#/components/parameters/exchange_lss"},{"$ref":"#/components/parameters/window_mhd"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/format"}],"responses":{"200":{"$ref":"#/components/responses/TakerBuySellStats"}}}}}}
```

## Liquidations

> Liquidations are sum of forced market orders to exit leveraged positions caused by price volatility. Liquidations indicate current price volatility and traders' sentiment which side they had been betting.\
> Note that Binance's liquidation data collection policy has changed since \[2021-04-27]\(<https://binance-docs.github.io/apidocs/futures/en/#change-log>), which makes the distribution of the data has changed after that.\
> \
> \| Name           |   Exchange     |    Symbol    |   Available Since           |\
> \|----------------|----------------|--------------|-----------------------------|\
> \| All Exchanges  | \`all\_exchange\` | \`all\_symbol\` | The earliest time in the exchanges below. |\
> \| Binance        | \`binance\`      | \`all\_symbol\` \<br/> \`btc\_busd\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\` | The earliest time in the symbols. \<br/> 2019-11-20 00:00:00 \<br/> 2020-08-14 00:00:00 \<br/> 2021-01-15 00:00:00 |\
> \| Bitfinex       | \`bitfinex\`     | \`all\_symbol\` \<br/> \`btc\_usdt\`| The earliest time in the symbols. \<br/> 2019-09-18 00:00:00  |\
> \| Bitmex         | \`bitmex\`       | \`all\_symbol\` \<br/> \`btc\_usd\` | The earliest time in the symbols. \<br/> 2019-04-02 00:00:00 |\
> \| Bybit          | \`bybit\`        | \`all\_symbol\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\` | The earliest time in the symbols. \<br/> 2020-12-20 00:00:00 \<br/> 2020-12-18 00:00:00 |\
> \| Deribit        | \`deribit\`      | \`all\_symbol\` \<br/> \`btc\_usd\` | The earliest time in the symbols. \<br/> 2019-05-25 00:00:00 |\
> \| FTX\*\*            | \`ftx\`          | \`all\_symbol\` \<br/> \`btc\_usd\` | The earliest time in the symbols. \<br/> 2019-08-04 00:00:00 |\
> \| Gate.io        | \`gate\_io\`      | \`all\_symbol\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\` | The earliest time in the symbols. \<br/> 2018-12-20 16:00:00 \<br/> 2019-11-18 17:00:00 |\
> \| HTX Global   | \`htx\_global\` | \`all\_symbol\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\` | The earliest time in the symbols. \<br/> 2020-06-26 00:00:00 \<br/> 2021-09-23 12:00:00 |\
> \| OKX            | \`okx\`         | \`all\_symbol\` \<br/> \`btc\_usd\` \<br/> \`btc\_usdt\` | The earliest time in the symbols. \<br/> 2020-12-20 00:00:00 \<br/> 2020-12-17 00:00:00 |\
> \
> \> (\*\*) Use in cautions due to the deprecation (no data update)

```json
{"openapi":"3.0.0","info":{"title":"CryptoQuant Data API","version":"1.3.0"},"tags":[{"name":"BTC Market Data","description":"This namespace contains endpoints to retrieve metrics related to the value of Bitcoin, including price, open interest, market cap, realized cap, etc. On top of providing basic market data like price and market cap, we focus on onchain indicators in order to evaluate the true value of Bitcoin. These indicators have been commonly used in building long term valuations, and identifying lows and highs. For more detailed information, please refer to the description of each metric."}],"servers":[{"url":"https://api.cryptoquant.com/v1/","description":"Default server"}],"security":[{"Access Token":[]}],"components":{"securitySchemes":{"Access Token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"For each API request, include this HTTP header:\n`Authorization` with the `Bearer {access_token}`. Bearer access token is the type of HTTP Authorization.  You have to include access token to the HTTP header and note that leading bearer is required.\nYou must include your access token in HTTP header in every request you make. The token is unique, issued for each client, and regularly changed(once a year). To obtain an access token, please [upgrade your plan](https://cryptoquant.com/pricing) to Professional or Premium plan. You'll be able to see your access token on the [API tab](https://cryptoquant.com/settings/api) of your profile page after the subscription."}},"parameters":{"exchange_liq":{"description":"A derivative exchange from the table that we support. [See here](#operation/getLiquidations).","explode":false,"in":"query","name":"exchange","required":true,"schema":{"type":"string"},"style":"form"},"symbol_liq_btc":{"description":"A BTC pair symbol from the table that we support. [See here](#operation/getLiquidations)","explode":false,"in":"query","name":"symbol","required":false,"schema":{"type":"string","default":"all_symbol"},"style":"form"},"window_mhd":{"description":"Currently we support `day`, `hour`, and `min`.","explode":false,"in":"query","name":"window","schema":{"type":"string","default":"day"},"style":"form"},"from":{"description":"This defines the starting time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the earliest time.","explode":false,"in":"query","name":"from","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"to":{"description":"This defines the ending time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the latest time.","explode":false,"in":"query","name":"to","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"limit":{"description":"The maximum number of entries to return before the latest data point (or before `to` if specified). This field ranges from 1 to 100,000.","explode":false,"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":100,"minimum":1,"maximum":100000},"style":"form"},"format":{"description":"A format type about return message type. Supported formats are json, csv.","explode":false,"in":"query","name":"format","required":false,"schema":{"type":"string","default":"json"},"style":"form"}},"responses":{"Liquidations":{"description":"Amount of long/short liquidations orders","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiquidationsResponse"}}}}},"schemas":{"LiquidationsResponse":{"type":"object","required":["status","result"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"result":{"type":"object","required":["window","data"],"properties":{"window":{"$ref":"#/components/schemas/Window_MDH"},"data":{"type":"array","items":{"type":"object","required":["long_liquidations","short_liquidations","long_liquidations_usd","short_liquidations_usd"],"properties":{"date":{"$ref":"#/components/schemas/Date"},"datetime":{"$ref":"#/components/schemas/Datetime"},"long_liquidations":{"type":"decimal","description":"Amount of liquidated orders in long positions."},"short_liquidations":{"type":"decimal","description":"Amount of liquidated orders in short positions."},"long_liquidations_usd":{"type":"decimal","description":"Amount of liquidated orders in long positions in USD."},"short_liquidations_usd":{"type":"decimal","description":"Amount of liquidated orders in short positions in USD."}}}}}}}},"Status":{"type":"object","description":"The status object is return with most of requests and indicates if the request was successful. If it is not successful, error information is included.","properties":{"code":{"type":"integer","format":"int32","description":"HTTP status code"},"message":{"type":"string","description":"Text description of the error or success."}},"required":["code","message"]},"Window_MDH":{"type":"string","description":"The size of window. It can be day, hour, or min and it depends on the user request."},"Date":{"type":"string","description":"The date in YYYY-DD-MM. This optional field only appears when window=day is used."},"Datetime":{"type":"string","description":"The date and time formatted as YYYY-MM-DD HH:MM:SS (UTC time). This field only appears when window=block is used."}}},"paths":{"/btc/market-data/liquidations":{"get":{"tags":["BTC Market Data"],"summary":"Liquidations","description":"Liquidations are sum of forced market orders to exit leveraged positions caused by price volatility. Liquidations indicate current price volatility and traders' sentiment which side they had been betting.\nNote that Binance's liquidation data collection policy has changed since [2021-04-27](https://binance-docs.github.io/apidocs/futures/en/#change-log), which makes the distribution of the data has changed after that.\n\n| Name           |   Exchange     |    Symbol    |   Available Since           |\n|----------------|----------------|--------------|-----------------------------|\n| All Exchanges  | `all_exchange` | `all_symbol` | The earliest time in the exchanges below. |\n| Binance        | `binance`      | `all_symbol` <br/> `btc_busd` <br/> `btc_usd` <br/> `btc_usdt` | The earliest time in the symbols. <br/> 2019-11-20 00:00:00 <br/> 2020-08-14 00:00:00 <br/> 2021-01-15 00:00:00 |\n| Bitfinex       | `bitfinex`     | `all_symbol` <br/> `btc_usdt`| The earliest time in the symbols. <br/> 2019-09-18 00:00:00  |\n| Bitmex         | `bitmex`       | `all_symbol` <br/> `btc_usd` | The earliest time in the symbols. <br/> 2019-04-02 00:00:00 |\n| Bybit          | `bybit`        | `all_symbol` <br/> `btc_usd` <br/> `btc_usdt` | The earliest time in the symbols. <br/> 2020-12-20 00:00:00 <br/> 2020-12-18 00:00:00 |\n| Deribit        | `deribit`      | `all_symbol` <br/> `btc_usd` | The earliest time in the symbols. <br/> 2019-05-25 00:00:00 |\n| FTX**            | `ftx`          | `all_symbol` <br/> `btc_usd` | The earliest time in the symbols. <br/> 2019-08-04 00:00:00 |\n| Gate.io        | `gate_io`      | `all_symbol` <br/> `btc_usd` <br/> `btc_usdt` | The earliest time in the symbols. <br/> 2018-12-20 16:00:00 <br/> 2019-11-18 17:00:00 |\n| HTX Global   | `htx_global` | `all_symbol` <br/> `btc_usd` <br/> `btc_usdt` | The earliest time in the symbols. <br/> 2020-06-26 00:00:00 <br/> 2021-09-23 12:00:00 |\n| OKX            | `okx`         | `all_symbol` <br/> `btc_usd` <br/> `btc_usdt` | The earliest time in the symbols. <br/> 2020-12-20 00:00:00 <br/> 2020-12-17 00:00:00 |\n\n> (**) Use in cautions due to the deprecation (no data update)","operationId":"getLiquidations","parameters":[{"$ref":"#/components/parameters/exchange_liq"},{"$ref":"#/components/parameters/symbol_liq_btc"},{"$ref":"#/components/parameters/window_mhd"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/format"}],"responses":{"200":{"$ref":"#/components/responses/Liquidations"}}}}}}
```

## Capitalization

> This endpoint returns metrics related to market capitalization. First, we provide \`market\_cap\`, which is total market capitalization of BTC, calculated by multiplying the total supply with its USD price. Moreover, we provide several adjusted capitalization metrics which are used for further fundamental analysis. \`realized\_cap\` is the sum of each UTXO \* last movement price. Since cryptocurrencies can be lost, unclaimed, or unreachable through various bugs, \`realized\_cap\` is introduced to discount those coins which have remained unmoved for a long period. It is one way to attempt to measure the value of Bitcoin. This can be described as an on-chain version of volume weighted average price(VWAP). \`average\_cap\` is forever moving average, calculated by dividing the cumulated sum of daily market cap with the age of market. Instead of using fixed time for calculating the moving average (e.g. 50 days, 100days ...), this serves as the true mean.  Both \`realized\_cap\` and \`average\_cap\` are used to calculate \`delta\_cap\` (\`realized\_cap\`-\`average\_cap\`). \`delta\_cap\` is often used to spot market bottoms. Moreover, by analyzing the movement of \`delta\_cap\` which oscillates between \`realized\_cap\` and \`average\_cap\`, we could notice that market tops are reached when \`delta\_cap\` is near \`realized\_cap\`(in a log scaled chart). Another metric that can be used to spot market bottoms is \`thermo\_cap\` which is the weighted cumulative sum of the mined cryptocurrency price. This metric provides the total amount of funds in the blockchain network and also helps to evaluate whether \`market\_cap\` is overvalued or not.  \
> \_\_\[Go to Data Guide‣]\(<https://userguide.cryptoquant.com/cryptoquant-metrics/market/capitalization-models)\\_\\>\_<br>

```json
{"openapi":"3.0.0","info":{"title":"CryptoQuant Data API","version":"1.3.0"},"tags":[{"name":"BTC Market Data","description":"This namespace contains endpoints to retrieve metrics related to the value of Bitcoin, including price, open interest, market cap, realized cap, etc. On top of providing basic market data like price and market cap, we focus on onchain indicators in order to evaluate the true value of Bitcoin. These indicators have been commonly used in building long term valuations, and identifying lows and highs. For more detailed information, please refer to the description of each metric."}],"servers":[{"url":"https://api.cryptoquant.com/v1/","description":"Default server"}],"security":[{"Access Token":[]}],"components":{"securitySchemes":{"Access Token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"For each API request, include this HTTP header:\n`Authorization` with the `Bearer {access_token}`. Bearer access token is the type of HTTP Authorization.  You have to include access token to the HTTP header and note that leading bearer is required.\nYou must include your access token in HTTP header in every request you make. The token is unique, issued for each client, and regularly changed(once a year). To obtain an access token, please [upgrade your plan](https://cryptoquant.com/pricing) to Professional or Premium plan. You'll be able to see your access token on the [API tab](https://cryptoquant.com/settings/api) of your profile page after the subscription."}},"parameters":{"window":{"description":"Currently we support `day` and `block`.","explode":false,"in":"query","name":"window","schema":{"type":"string","default":"day"},"style":"form"},"from":{"description":"This defines the starting time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the earliest time.","explode":false,"in":"query","name":"from","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"to":{"description":"This defines the ending time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the latest time.","explode":false,"in":"query","name":"to","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"limit":{"description":"The maximum number of entries to return before the latest data point (or before `to` if specified). This field ranges from 1 to 100,000.","explode":false,"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":100,"minimum":1,"maximum":100000},"style":"form"},"format":{"description":"A format type about return message type. Supported formats are json, csv.","explode":false,"in":"query","name":"format","required":false,"schema":{"type":"string","default":"json"},"style":"form"}},"responses":{"Capitalization":{"description":"market_cap, realized_cap, average_cap, delta_cap, thermo_cap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapitalizationResponse"}}}}},"schemas":{"CapitalizationResponse":{"type":"object","required":["status","result"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"result":{"type":"object","required":["window","data"],"properties":{"window":{"$ref":"#/components/schemas/Window"},"data":{"type":"array","items":{"type":"object","required":["market_cap","realized_cap","average_cap","delta_cap","thermo_cap"],"properties":{"blockheight":{"$ref":"#/components/schemas/Blockheight"},"date":{"$ref":"#/components/schemas/Date"},"datetime":{"$ref":"#/components/schemas/Datetime"},"market_cap":{"type":"decimal","description":"Market capitalization of BTC, calculated by total_supply * price_usd_close."},"realized_cap":{"type":"decimal","description":"The sum of all UTXOs multiplied by the price they last moved."},"average_cap":{"type":"decimal","description":"Forever moving average, calculated by dividing the cumulated sum of daily market cap with the age of market."},"delta_cap":{"type":"decimal","description":"realized_cap minus average_cap."},"thermo_cap":{"type":"decimal","description":"The weighted cumulative sum of the mined cryptocurrency price."}}}}}}}},"Status":{"type":"object","description":"The status object is return with most of requests and indicates if the request was successful. If it is not successful, error information is included.","properties":{"code":{"type":"integer","format":"int32","description":"HTTP status code"},"message":{"type":"string","description":"Text description of the error or success."}},"required":["code","message"]},"Window":{"type":"string","description":"The size of window. It can be day or block, and it depends on the user request."},"Blockheight":{"type":"string","description":"The height of the block. This optional field only appears when window=block is used."},"Date":{"type":"string","description":"The date in YYYY-DD-MM. This optional field only appears when window=day is used."},"Datetime":{"type":"string","description":"The date and time formatted as YYYY-MM-DD HH:MM:SS (UTC time). This field only appears when window=block is used."}}},"paths":{"/btc/market-data/capitalization":{"get":{"tags":["BTC Market Data"],"summary":"Capitalization","description":"This endpoint returns metrics related to market capitalization. First, we provide `market_cap`, which is total market capitalization of BTC, calculated by multiplying the total supply with its USD price. Moreover, we provide several adjusted capitalization metrics which are used for further fundamental analysis. `realized_cap` is the sum of each UTXO * last movement price. Since cryptocurrencies can be lost, unclaimed, or unreachable through various bugs, `realized_cap` is introduced to discount those coins which have remained unmoved for a long period. It is one way to attempt to measure the value of Bitcoin. This can be described as an on-chain version of volume weighted average price(VWAP). `average_cap` is forever moving average, calculated by dividing the cumulated sum of daily market cap with the age of market. Instead of using fixed time for calculating the moving average (e.g. 50 days, 100days ...), this serves as the true mean.  Both `realized_cap` and `average_cap` are used to calculate `delta_cap` (`realized_cap`-`average_cap`). `delta_cap` is often used to spot market bottoms. Moreover, by analyzing the movement of `delta_cap` which oscillates between `realized_cap` and `average_cap`, we could notice that market tops are reached when `delta_cap` is near `realized_cap`(in a log scaled chart). Another metric that can be used to spot market bottoms is `thermo_cap` which is the weighted cumulative sum of the mined cryptocurrency price. This metric provides the total amount of funds in the blockchain network and also helps to evaluate whether `market_cap` is overvalued or not.  \n__[Go to Data Guide‣](https://userguide.cryptoquant.com/cryptoquant-metrics/market/capitalization-models)__\n","operationId":"getCapitalization","parameters":[{"$ref":"#/components/parameters/window"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/format"}],"responses":{"200":{"$ref":"#/components/responses/Capitalization"}}}}}}
```

## Coinbase Premium Index

> Coinbase Premium Index is calculated as percent difference from Binance price(BTCUSDT) to Coinbase price(BTCUSD). Coinbase Premium Gap is calculated as gap between Coinbase price(BTCUSD) and Binance price(BTCUSDT). The higher the premium, the stronger the spot buying pressure from Coinbase.<br>

```json
{"openapi":"3.0.0","info":{"title":"CryptoQuant Data API","version":"1.3.0"},"tags":[{"name":"BTC Market Data","description":"This namespace contains endpoints to retrieve metrics related to the value of Bitcoin, including price, open interest, market cap, realized cap, etc. On top of providing basic market data like price and market cap, we focus on onchain indicators in order to evaluate the true value of Bitcoin. These indicators have been commonly used in building long term valuations, and identifying lows and highs. For more detailed information, please refer to the description of each metric."}],"servers":[{"url":"https://api.cryptoquant.com/v1/","description":"Default server"}],"security":[{"Access Token":[]}],"components":{"securitySchemes":{"Access Token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"For each API request, include this HTTP header:\n`Authorization` with the `Bearer {access_token}`. Bearer access token is the type of HTTP Authorization.  You have to include access token to the HTTP header and note that leading bearer is required.\nYou must include your access token in HTTP header in every request you make. The token is unique, issued for each client, and regularly changed(once a year). To obtain an access token, please [upgrade your plan](https://cryptoquant.com/pricing) to Professional or Premium plan. You'll be able to see your access token on the [API tab](https://cryptoquant.com/settings/api) of your profile page after the subscription."}},"parameters":{"window_mhd":{"description":"Currently we support `day`, `hour`, and `min`.","explode":false,"in":"query","name":"window","schema":{"type":"string","default":"day"},"style":"form"},"from":{"description":"This defines the starting time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the earliest time.","explode":false,"in":"query","name":"from","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"to":{"description":"This defines the ending time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the latest time.","explode":false,"in":"query","name":"to","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"limit":{"description":"The maximum number of entries to return before the latest data point (or before `to` if specified). This field ranges from 1 to 100,000.","explode":false,"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":100,"minimum":1,"maximum":100000},"style":"form"},"format":{"description":"A format type about return message type. Supported formats are json, csv.","explode":false,"in":"query","name":"format","required":false,"schema":{"type":"string","default":"json"},"style":"form"}},"responses":{"BTCCoinbasePremiumIndex":{"description":"Coinbase Premium Index in percentage and Coinbase Premium Gap","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BTCCoinbasePremiumIndexResponse"}}}}},"schemas":{"BTCCoinbasePremiumIndexResponse":{"type":"object","required":["status","result"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"result":{"type":"object","required":["window","data"],"properties":{"window":{"$ref":"#/components/schemas/Window_MDH"},"data":{"type":"array","items":{"type":"object","required":["coinbase_premium_gap","coinbase_premium_index"],"properties":{"date":{"$ref":"#/components/schemas/Date"},"datetime":{"$ref":"#/components/schemas/Datetime_MH"},"coinbase_premium_gap":{"type":"decimal","description":"The gap between Coinbase Advanced price(USD pair) and Binance price(USDT pair)."},"coinbase_premium_index":{"type":"decimal","description":"The percent difference from Binance price(BTCUSDT) to Coinbase price(BTCUSD)."}}}}}}}},"Status":{"type":"object","description":"The status object is return with most of requests and indicates if the request was successful. If it is not successful, error information is included.","properties":{"code":{"type":"integer","format":"int32","description":"HTTP status code"},"message":{"type":"string","description":"Text description of the error or success."}},"required":["code","message"]},"Window_MDH":{"type":"string","description":"The size of window. It can be day, hour, or min and it depends on the user request."},"Date":{"type":"string","description":"The date in YYYY-DD-MM. This optional field only appears when window=day is used."},"Datetime_MH":{"type":"string","description":"The date and time formatted as YYYY-MM-DD HH:MM:SS (UTC time). This field only appears when window=min or window=hour is used."}}},"paths":{"/btc/market-data/coinbase-premium-index":{"get":{"tags":["BTC Market Data"],"summary":"Coinbase Premium Index","description":"Coinbase Premium Index is calculated as percent difference from Binance price(BTCUSDT) to Coinbase price(BTCUSD). Coinbase Premium Gap is calculated as gap between Coinbase price(BTCUSD) and Binance price(BTCUSDT). The higher the premium, the stronger the spot buying pressure from Coinbase.\n","operationId":"getBTCCoinbasePremiumIndex","parameters":[{"$ref":"#/components/parameters/window_mhd"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/format"}],"responses":{"200":{"$ref":"#/components/responses/BTCCoinbasePremiumIndex"}}}}}}
```
