LogoLogo
  • Kaiko Knowledge Hub
  • General
    • 👋Introduction
    • 🏎️Getting Started
      • API input
      • API output
        • "taker_side_sell" Explained
        • Market open and close
        • Timestamp
      • Authentication
      • Data versioning
      • Envelope
      • Error codes
      • Pagination
      • Rate limiting
  • Data Feeds
    • Introduction
    • Level 1 & Level 2 Data
      • Level 1 Aggregations
        • Trade Count, OHLCV, & VWAP
          • OHLCV only
          • VWAP only
      • Level 1 Tick-Level
        • All trades
        • Derivative liquidation events
        • Borrows, repayments, liquidations, and withdrawals
      • Level 2 Aggregations
        • Market depth (snapshot)
        • Market depth (aggregation)
        • Price slippage (snapshot)
        • Price slippage (aggregation)
        • Bid-ask spread (aggregation)
        • Tokens in a liquidity pool
          • Tokens in a liquidity pool (Uniswap v3)
        • Interest rates, borrowed and deposited amounts
        • Raw order book snapshot
          • Raw order book snapshot + market depth, bid/ask spread & price slippage
      • Level 2 Tick-Level
        • Mints and burns
    • Reference Data
      • Free tier
        • Asset codes
        • Exchange codes
        • Exchange trading pair codes (instruments)
        • Lending protocol codes
        • Blockchain codes
      • Advanced tier
        • Derivatives contract details
        • Derivatives price details
      • Premium tier
        • Market capitalization and circulating supply (BETA)
  • ANALYTICS Solutions
    • Introduction
    • Kaiko Fair Market Value
      • Kaiko Fair Market Value (Direct prices for high liquidity pairs)
      • Kaiko Fair Market Value (Synthetic prices for low liquidity pairs)
        • Convert with Oanda FX Rates
    • Kaiko Derivatives Risk Indicators
      • Exchange-provided metrics
      • Token-level liquidation volumes
      • Implied volatility calculation - smile
      • Implied volatility calculation - surface
    • Kaiko Portfolio Risk & Performance
      • Value at risk calculation
      • Custom valuation
  • Monitoring Solutions
    • Kaiko Market Explorer
      • Assets
      • Exchanges
    • Kaiko Blockchain Monitoring
      • Ethereum Wallets
        • Balances and transactions
      • Bitcoin Wallets
        • Balances
        • Transaction
      • Solana Wallets
        • Balances and transactions
      • Provenance Wallets
        • Balances and transactions
  • Misc & Legacy endpoints
    • CME
Powered by GitBook
On this page
  • What is this endpoint for?
  • Endpoint
  • Parameters
  • Fields
  • Request examples
  • Response example

Was this helpful?

Export as PDF
  1. Monitoring Solutions
  2. Kaiko Market Explorer

Exchanges

What is this endpoint for?

This endpoint helps inform exchange analysis with data such as total volume in USD, trades, the number of listed assets, and volume proportions by asset. The data aggregates all instruments available on the requested exchange. Only base assets are taken into consideration.

Endpoint

https://us.market-api.kaiko.io/v2/data/analytics.v2/exchange_metrics

Parameters

Parameter
Required
Description
Example

exchange

Yes

cbse

start_time

Yes

Starting time in ISO 8601 (inclusive). First time at which we want to have metrics.

2023-11-29T14:00:00.0000000Z

end_time

Yes

Ending time in ISO 8601 (exclusive). Last time at which we want to have exchange metrics.

2023-11-29T15:00:00.0000000Z

interval

Yes

The interval parameter is suffixed with h or d to specify hours or days, respectively. Any arbitrary value between one second and one day can be used, as long as it sums up to a maximum of 1 day. The suffixes are h (hour) and d (day). Default: 1h.

1h

sources

No

If true, returns trading information detailed by pair. Default: false

page_size

No

Default: 10

100

sort

No

If asc, sort time-series in ascending. If desc, sort time-series in descending. Default: desc

100

Fields

Field
Category
Description
Example

timestamp

Trading activity

Timestamp at which the interval begins.

2023-11-29T14:00:00.000Z

total_volume_usd

Trading activity

Total volume in USD traded in the interval. 0 when no trades are reported.

139803179.89191553

total_trade_count

Trading activity

Total trade count in the interval. 0 when no trades are reported.

121748

nb_listed_assets

Trading activity

Number of listed assets in the interval. 0 when no trades are reported.

235

nb_listed_pairs

Trading activity

Number of listed pairs in the interval. 0 when no trades are reported.

379

asset_volumes

Trading activity

Trading information details by asset.

[{"asset_code": "btc", "asset_trade_count": 22772, "asset_total_volume_usd": 61612344.01769975, "asset_price_usd": 37994.62623807689, "asset_contribution": 0.4407077440250888, "pairs_volumes": []]}, ...]

asset_code

Trading activity

Asset code.

btc

asset_trade_count

Trading activity

Trade count in the interval by asset. 0 when no trades are reported.

159115

asset_total_volume_usd

Trading activity

Volume in USD traded in the interval by asset. 0 when no trades are reported.

61612344.01769975

asset_price_usd

Trading activity

Asset cross-price in USD used to compute volume in USD.

37994.62623807689

asset_contribution

Trading activity

Asset volume percentage over total volume.

0.4407077440250888

pairs_volumes

Trading activity

Trading information details by pair.

[{"pair_code": "btc-usd", "pair_trade_count": 19193, "pair_volume_usd": 57484171.99063697, "pair_contribution": 0.9329976469345679}, ...]

pair_code

Trading activity

Pair code.

btc-usd

pair_trade_count

Trading activity

Trade count in the interval by pair. 0 when no trades are reported.

1686

pair_volume_usd

Trading activity

Volume in USD traded in the interval by pair. 0 when no trades are reported.

57484171.99063697

pair_contribution

Trading activity

Pair volume percentage over asset volume.

0.9329976469345679

Request examples

curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/exchange_metrics?exchange=cbse&sort=desc&sources=true&start_time=2023-11-29T14:00:00.0000000Z&end_time=2023-11-29T15:00:00.0000000Z&interval=1h&page_size=100'
import http.client
import json

# Enter your Kaiko API Key
api_key = "KAIKO_API_KEY"
api_host = "us.market-api.kaiko.io"
api_base_endpoint = "/v2/data/analytics.v2/exchange_metrics"
# Start of mandatory parameter configuration
mandatory_params = {
    "exchange": "cbse",
    "start_time": "2024-08-27T13:13:53.441Z",
    "end_time" : "2024-08-27T18:27:53.441Z",
    "interval" : "1h",
}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
    "sources": "false",
}
# End of optional parameter configuration
conn = http.client.HTTPSConnection(api_host)
headers = {
    "X-Api-Key": api_key,
    "Accept": "application/json"
}

all_params = {**mandatory_params, **optional_params}

url_params = []
for param, value in all_params.items():
    url_params.append(f"{param}={value}")
url_params = '&'.join(url_params)

endpoint_with_params = f"{api_base_endpoint}?{url_params}"

# Pagination for next pages
all_data = []
next_url = endpoint_with_params
while next_url:
    conn.request("GET", next_url, headers=headers)
    response = conn.getresponse()
    data = json.loads(response.read().decode("utf-8"))
    all_data.extend(data.get("data", []))
    print(f"Fetched {len(data.get('data', []))} datapoints. Total: {len(all_data)}")
    next_url = data.get("next_url", "").replace("https://us.market-api.kaiko.io", "")
    if not next_url:
        break
conn.close()
print(f" datapoints fetched: {(all_data)}")

Response example

{
    "data": [
        {
            "timestamp": "2023-11-29T14:00:00.000Z",
            "total_volume_usd": 139803179.89191553,
            "total_trade_count": 121748,
            "nb_listed_assets": 235,
            "nb_listed_pairs": 379,
            "assets_volumes": [
                {
                  "asset_code": "btc",
                  "asset_trade_count": 22772,
                  "asset_total_volume_usd": 61612344.01769975,
                  "asset_price_usd": 37994.62623807689,
                  "asset_contribution": 0.4407077440250888,
                  "pairs_volumes": [
                        {
                          "pair_code": "btc-usd",
                          "pair_trade_count": 19193,
                          "pair_volume_usd": 57484171.99063697,
                          "pair_contribution": 0.9329976469345679
                        },
                        {
                          "pair_code": "btc-eur",
                          "pair_trade_count": 1686,
                          "pair_volume_usd": 1722929.4947314486,
                          "pair_contribution": 0.027964030945430225
                        },
                        {
                          "pair_code": "btc-usdt",
                          "pair_trade_count": 807,
                          "pair_volume_usd": 1590807.5262940996,
                          "pair_contribution": 0.02581962351305931
                        },
                        {
                          "pair_code": "btc-gbp",
                          "pair_trade_count": 1086,
                          "pair_volume_usd": 814435.0060372388,
                          "pair_contribution": 0.013218698606942646
                        }
                    ]
                },
              /* ... */
            ]
        },
        /* ... */
    ]  
}
PreviousAssetsNextKaiko Blockchain Monitoring

Last updated 2 months ago

Was this helpful?

The desired exchange code. See

See Minimum: 1 Maximum: 100

Exchange codes
Pagination