Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Kaiko Fair Market Value [Emerging Assets]
Kaiko Fair Market Value [Full Coverage]
This endpoint should be used when there isn’t enough liquidity to produce a direct or synthetic price. Especially useful for DeFi-only assets, state price derives a price by analyzing the real-time state of liquidity pools for the selected asset, inspecting the pools’ reserves, balances, and recent flow to infer a-price consistent with current market conditions. The data includes the calculated state price and the trading volume from the associated block within each pool, expressed in USD.
Data is only available for the last 24 hours.
Only the largest eligible pools, (which together account for 95% of the total aggregated volume over the past 7 days) are displayed in this endpoint.
Pool eligibility depends on the pairing: non-LST tokens must be paired with USDT, USDC, or wETH, while LST tokens must be paired with wETH.
Supported Protocols: Uniswap v2, Uniswap v3, Balancer v2, Curve v1, Curve v2
asset
Asset requested
wsteth
datetime
The timestamp indicates when the data was processed. One data point will be published per second.
base
Base asset requested.
{
"datetime": "2025-01-08T10:48:58.002432007Z",
"base": "wsteth",
"lst_quote": "weth",
"aggregated_price_usd": "3985.5509347142515",
"aggregated_price_lst": "1.1892311869094472",
"last_known_blocks": [
{
"blockchain": "ethereum",
"block_number": 21579259
}
],
"pool_data": [
{
"pool_address": "0x93d199263632a4ef4bb438f1feb99e57b4b5f0bd",
"blockchain": "ethereum",
"exchange": "blc2",
"quote": "weth",
"state_price": "1.1892290818833757",
"rate_usd": 3351.367655495001,
"trading_volume_weight": "0.642086707107293",
"market_depth_weight": "0.07335226235574528",
"market_depth_m1_quote": "19.395711139793057",
"market_depth_m1_usd": "65002.15896922653",
"market_depth_p1_base": "108.00101402959565",
"market_depth_p1_usd": "430442.780499229",
"last_block_volume": "0",
"last_aggregated_volume": "28000.703235419944"
},
{
"pool_address": "0x109830a1aaad605bbf02a9dfa7b0b92ec2fb7daa",
"blockchain": "ethereum",
"exchange": "usp3",
"quote": "weth",
"state_price": "1.1892322697310238",
"rate_usd": 3351.367655495001,
"trading_volume_weight": "0.7417266504989011",
"market_depth_weight": "1.0729150777662464",
"market_depth_m1_quote": "2603.753585841387",
"market_depth_m1_usd": "8726135.550467951",
"market_depth_p1_base": "952.8608347165278",
"market_depth_p1_usd": "3797678.8483253857",
"last_block_volume": "0",
"last_aggregated_volume": "34687.298752135"
},
]
}start_time
Starting time in ISO 8601 (inclusive).
2025-01-07T10:48:59.528Z
end_time
Ending time in ISO 8601 (exclusive).
2025-01-08T10:48:59.528Z
page_size
Number of data points to return data for. (default: 1000, max: 10000). See
1000
sort
Return the data in ascending (asc) or descending (desc) order. Default results will return in descending order.
asc
lst_Quote
LST quote token if relevant, otherwise field will return empty.
aggregated_Price_Usd
The state price aggregated over several pools, denominated in USD.
aggregated_Price_lst
The state price aggregated over multiple pools, denominated in ETH. This field will return empty for LST tokens.
last_known_blocks
List of last read blocks per blockchain.
last_known_blocks\blockchain
Name of the blockchain.
last_known_blocks\block_number
The last block number processed on the associated blockchain.
pool_data
A list of state price data and additional information per pool.
pool_data\pool_address
The pool address.
pool_data\blockchain
Name of the blockchain.
pool_data\exchange
Protocol’s code. See .
pool_data\quote
Quote asset in of the pool.
pool_data\state_price
Last state price extracted from the pool.
pool_data\rate_usd
Conversion quote rate in usd.
pool_data\trading_volume_weight
The weight calculated based on trading volumes that is used for the associated pool to determine the aggregated state price."
pool_data\market_depth_weight
The weight calculated based on market depth that is used for the associated pool to determine the aggregated state price."
pool_data\market_depth_m1_quote
-1% market depth (amount of quote token).
pool_data\market_depth_m1_usd
-1% USD valued market depth.
pool_data\market_depth_m1_base
+1% market depth (amount of base token).
pool_data\market_depth_m1_usd
+1% USD valued market depth.
pool_data\last_block_volume
Trading volume extracted from the last known block.
pool_data\last_aggregated_volume
Aggregated trading volume on the associated pool from the past 7 days. This volume is updated every 30 seconds.
Kaiko's Supply and Market Cap Data covers circulating supply metrics for crypto assets through normalized API endpoints.
Level 1 & Level 2 Data [Level 2 Aggregations Tier]
Level 1 & Level 2 Data [Level 2 Tick-Level Tier]
CeFi Spot ticker packs.
This endpoint returns the average price slippage for the requested period. Read more about how the aggregation period works here: .
https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/ob_aggregations/slippageregion
Yes
Choose between eu and us.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
continuation_token
No
See
end_time
No
poll_timestamp
The timestamp at which the interval begins.
ask_slippage
The average percentage of price slippage for a market buy order over a specified interval.
bid_slippage
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/ob_aggregations/slippage?page_size=10&slippage=100000&interval=1h'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-01-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
slippage = 1000
slippage_ref = "mid_price"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int, slippage: int, slippage_ref: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/ob_aggregations/slippage'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"slippage": slippage,
"slippage_ref": slippage_ref
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size), slippage=slippage, slippage_ref=slippage_ref)message = "hello world"
puts message{
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1h",
"slippage": 100000,
"slippage_ref": "mid_price",
"sort": "desc",
"aggregation": "slippage",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T15:07:06.840Z"
},
"time": "2020-05-26T15:07:07.260Z",
"timestamp": 1590505627260,
"data": [
{
"poll_timestamp": 1590505200000,
"ask_slippage": "0.00012513598764468878",
"bid_slippage": "0.0003678539692963374"
},
{
"poll_timestamp": 1590501600000,
"ask_slippage": "0.00030969034268815156",
"bid_slippage": "0.00024353107110561094"
},
/* ... */
],
"result": "success",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1h.
page_size
No
Number of snapshots to return data for. (default: 10, max: 100). See Automatically included in continuation tokens.
sort
No
Return the data in ascending asc or descending desc order. Default desc
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
slippage
No
Order size (in quote asset) for which to calculate the percentage of slippage.
Default: 0.
When null is returned, not enough volume is present on the order book to execute the order.
slippage_ref
No
Price point for which to calculate slippage from. Either from the mid price (mid_price) or from the best bid/ask (best).
Default: mid_price.
The average percentage of price slippage for a market sell order over a specified interval.
Each and every derivative liquidation event
Level 1 & Level 2 Data [Level 1 Tick-Level]
Level 1 & Level 2 Data [Level 2 Aggregations]
Level 1 & Level 2 Data [Level 2 Tick-Level]
This endpoint returns all derivative liquidation events for a given instrument on an exchange. It includes all details available for the event like price and position. Data is available for futures and perpetual futures. For exchange coverage, see .
https://{region}.market-api.kaiko.io/v2/data/liquidation.v1/trades/{exchange}/{instrument_class}/{instrument}region
Yes
Choose between:
eu
us
exchange
Yes
Exchange code.
See
instrument_class
Yes
Choose between :
future
perpetual-future
instrument
Yes
Instrument code.
See
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
2025-01-23T00:01:00.000Z
amount
The quantity, displayed in base currency.
0.113
amount_quote
The quantity, displayed in the quote asset.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/liquidation.v1/trades/bbit/perpetual-future/eth-usdt?start_time=2025-04-12T00:00:00Z&end_time=2025-04-12T08:00:00Z&page_size=10'##### 1. Import dependencies #####
import requests
import pandas as pd
from urllib.parse import urlencode
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "bbit"
instrument_class = "perpetual-future"
instrument = "eth-usdt"
# ---- Optional parameters ---- #
page_size = 10
sort = "desc"
start_time = "2025-04-12T00:00:00Z"
end_time = "2025-04-12T08:00:00Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_liquidation_trades(api_key: str, exchange: str, instrument_class: str, instrument: str,
start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
base_url = f'https://us.market-api.kaiko.io/v2/data/liquidation.v1/trades/{exchange}/{instrument_class}/{instrument}'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
# Debug: Show the URL being generated
query_string = urlencode(params)
full_url = f"{base_url}?{query_string}"
print(f"DEBUG - Making request to URL: {full_url}")
print(f"DEBUG - Headers: {headers}")
try:
res = requests.get(base_url, headers=headers, params=params)
# Debug: Show the actual URL that requests used
print(f"DEBUG - Actual request URL: {res.url}")
print(f"DEBUG - Response status code: {res.status_code}")
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
print(f"DEBUG - Initial data fetch successful, got {len(df)} records")
# Handle pagination with continuation token
page_count = 1
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
print(f"DEBUG - Fetching page {page_count + 1} with URL: {next_url}")
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
new_records = len(data['data'])
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
print(f"DEBUG - Fetched additional {new_records} records, total now: {len(df)}")
page_count += 1
else:
print("DEBUG - No more data in pagination response")
break
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
print(f"Response status code: {e.response.status_code if hasattr(e, 'response') else 'N/A'}")
print(f"Response text: {e.response.text if hasattr(e, 'response') else 'N/A'}")
return pd.DataFrame()
# ---- Get the data ---- #
print("Starting API request...")
df = get_kaiko_liquidation_trades(
api_key=api_key,
exchange=exchange,
instrument_class=instrument_class,
instrument=instrument,
start_time=start_time,
end_time=end_time,
sort=sort,
page_size=page_size
)```json
{
"query": {
"exchange": "bbit",
"instrument": "eth-usdt",
"instrument_class": "perpetual-future",
"commodity": "liquidationEvents",
"request_time": "2025-04-04T11:58:32.545Z",
"start_time": "2025-02-12T00:00:01.000Z",
"start_timestamp": 1739318401000,
"end_time": "2025-02-24T23:59:37.000Z",
"end_timestamp": 1740441577000,
"page_size": 10,
"sort": "desc",
"data_version": "v1"
},
"answer_time": "2025-04-04T11:58:32.554Z",
"answer_timestamp": 1743767912554,
"access": {
"access_range": {
"start_timestamp": 1688428800000,
"end_timestamp": 2177539199000
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
},
"data": [
{
"amount": 0.1,
"amount_quote": 249.77100000000002,
"amount_usd": 249.76370743089532,
"price": 2497.71,
"rate": 0.9999708029791101,
"position_side": "long",
"timestamp": 1740441553739,
"trade_id": "376def42502a7a307b85d7ffdebec8c8c08990b19f6fb165e0f97c8fd058a1b2"
},
{
"amount": 0.04,
"amount_quote": 99.7556,
"amount_usd": 99.75268743366291,
"price": 2493.89,
"rate": 0.9999708029791101,
"position_side": "long",
"timestamp": 1740441446020,
"trade_id": "f1062a8c42743ffbddc3d129d65f1ae6848227b871361d6fd66f3bbbbb4b10da"
},
/*---*/
],
*/....
"continuation_token": "3RuQ1KYk3AEZTJXXqsaUMrdUKSYH4CVdGUFQCZC5pts7AYMafCjbnYSuedeLMFu72PsXKepcvdtpvZmNzXmotWV1ARAF8hJxLfaDXn75MmkN3zMq6ma9Ym",
"next_url": "https://us.market-api.kaiko.io/v2/data/liquidation.v1/trades/bbit/perpetual-future/eth-usdt?continuation_token=3RuQ1KYk3AEZTJXXqsaUMrdUKSYH4CVdGUFQCZC5pts7AYMafCjbnYSuedeLMFu72PsXKepcvdtpvZmNzXmotWV1ARAF8hJxLfaDXn75MmkN3zMq6ma9Ym"
}end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
2025-02-25T23:59:00.000Z
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
asc
page_size
No
See
Default: 100
Maximum: 1000
500
9362.592400000001
amount_usd
The quantity, displayed in USD.
9359.689996356
price
The price at which the liquidation was executed, displayed in USD.
82854.8
rate
Rate used to convert quote currency to USD. For example: 1 USDT = 0.997 USD
0.99969
position_side
The position liquidated
long
timestamp
The timestamp provided by the exchange or the collection timestamp in Unix Timestamp (in milliseconds)
1741785829372000000
trade_id
Unique trade ID (unique to the exchange). In case the exchange does not provide an ID, we generate it ourselves.
d472cae0135..dfdh6_g
Explore market dynamics of assets and exchanges, including trading volumes, market depth, token metrics, and both on-chain and off-chain transaction data.
These endpoints offers in-depth insights into BTC wallets including transactions, transfers and wallet balances over time.
Blockchain Monitoring can also be accessed through Google BigQuery. To get started, read our .
Our standard Rest API is limited to 6000 requests per API key per minute. If you query the API beyond that threshold, a 429 error message will occur.
If you'd like to discuss rate-limiting, please contact support@kaiko.com.
Our standard Rest API is limited to 6000 requests per API key per minute. If you query the API beyond that threshold, a 429 error message will occur.
If you'd like to discuss rate-limiting, please contact support@kaiko.com.
Digital asset exchanges operate approximately 24x7x365. For daily aggregated data, the opening price is calculated as the first trade at or after 00:00:00 UTC. The closing price is calculated as the last trade prior to 00:00:00 UTC.
Kaiko Portfolio & Risk Management
This endpoint helps you calculate the expected shortfall (ES) and stressed ES. It is computed by a proprietary and thoroughly backtested methodology that accounts for the idiosyncrasies of crypto market structure. By convention, it's a forecasting ES, i.e.,the prediction of the potential loss for the next day. We introduced a mixture parameter that can provide either the ES, the stressed ES or a combination of the two (see the stress_parameter below).
https://us.market-api.kaiko.io/v2/data/analytics.v2/expected_shortfallbases
Yes
List of portfolio base components. See
Total must match quantities below.
The order of bases and their respective quantities must match in the request.
quote
Yes
The fiat currency.
quantities
Yes
Quantities list of base asset in the portfolio.
Must match the number of bases.
The order of quantities and their respective bases must match in the request.
risk_level
Yes
The risk level for the expected shortfall.
Min: 0.90 (included)
Max: 1 (excluded)
start_time
Yes
First fixing of the calculation in ISO 8601 (inclusive).
end_time
Yes
Last fixing of the calculation in ISO 8601 (inclusive).
stress_parameter
No
Float between 0 and 1 that controls the blend between ES and Stressed ES.
It is 0 for ES and 1 for stressed ES.
It equals 0 by default.
reporting_currency
No
This allows you to express the final risk metrics in a specific fiat currency.
By default, expressed in USD.
sources
No
boolean. If true, returns all pair prices which were used to compute the expected shortfall.
Default: false
es_time
The time at which the ES is computed.
expected_shortfall
Composed of two fields: value and risk_level (the expected shortfall estimator at the specified risk_level)
pair
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/expected_shortfall?bases=eth,btc,ltc&quantities=3,2,5"e=usd&risk_level=0.95&start_time=2025-12-01T00:00:00.000Z&end_time=2025-12-05T00:00:00.000Z&stress_parameter=0.5&reporting_currency=eur'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
bases = "btc,eth"
quote = "usd"
quantities = "1,10"
risk_level = "0.95"
start_time = "2021-12-01T00:00:00.000Z"
end_time = "2022-01-31T00:00:00.000Z"
# ---- Optional parameters ---- #
sources = None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, bases: str, quote: str, quantities: str, risk_level: str, start_time: str, end_time: str, sources: bool = None):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/analytics.v2/expected_shortfall'
params = {
"bases": bases,
"quote": quote,
"quantities": quantities,
"risk_level": risk_level,
"start_time": start_time,
"end_time": end_time,
"sources": sources
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, bases=bases, quote=quote, quantities=quantities, risk_level=risk_level, start_time=start_time, end_time=end_time, sources=sources)
print (df){
"query": {
"bases": "eth,btc,ltc",
"quote": "usd",
"quantities": [
3,
2,
5
],
"exchanges": "",
"risk_level": 0.95,
"sources": false,
"data_version": "v2",
"commodity": "analytics",
"request_time": "2026-04-01T14:29:00.536Z",
"reporting_currency": "eur"
},
"time": "2026-04-01T14:29:00.825Z",
"timestamp": 1775053740825,
"data": [
{
"es_time": 1764547200000,
"expected_shortfall": {
"value": 13337.396618466695,
"risk_level": 0.95
}
},
{
"es_time": 1764633600000,
"expected_shortfall": {
"value": 13193.145029429792,
"risk_level": 0.95
}
},
{
"es_time": 1764720000000,
"expected_shortfall": {
"value": 13476.064947481469,
"risk_level": 0.95
}
},
{
"es_time": 1764806400000,
"expected_shortfall": {
"value": 13587.247396977718,
"risk_level": 0.95
}
},
{
"es_time": 1764892800000,
"expected_shortfall": {
"value": 13553.701550483325,
"risk_level": 0.95
}
}
],
"access": {
"access_range": {
"start_timestamp": 1763683200,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}The constituent pair. (showing only when sources is set to be true)
ref_price
The reference price per asset. (showing only when sources is set to be true)
date
The date of the reference price. (showing only when sources is set to be true)
Each endpoint for the Market Data solution lives under its own hostname. You must include an API key in the header of every request you make. The format for the API key is:
X-Api-Key: <client-api-key>Reference Data [Basic Tier]
Reference Data [Advanced Tier]
This endpoint retrieves a list of defi protocols and associated codes. This can help you identify which exchanges are defi when working with our data.
https://reference-data-api.kaiko.io/v1/pools-protocolsNo parameters supported
protocol
The protocol code. ex:crm,aav2, curv, blc2
curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/pools-protocols'All API responses are in JSON format. A result field, with a value of success or error is returned with each request. In the event of an error, a message field will provide an error message.
An access object is also echoed back. It contains two ranges of timestamps:
access_range: The time range for which the Client has access to the API
{
"result": "success",
"data": [
"crm",
"cmpd",
"pksp",
"aav2",
"curv",
"qsp3",
"aav3",
"mkr",
"tjv2",
"qsp2",
"usp2",
"sush",
"tj21",
"blcr",
"tjv1",
"aav1",
"blc2",
"usp3",
"crv2"
]
}data_range : The time range of data the Client is authorized to access
access
{}
Time ranges of accesses.
data
[] | {}
Reference Data [Basic Tier]
Reference Data [Advanced Tier]
This endpoint retrieves a list of exchanges and associated codes.
https://reference-data-api.kaiko.io/v1/exchangesNo parameters supported
code
Kaiko identifier for the exchange.
kaiko_legacy_slug
This endpoint retrieves a list of assets and associated codes.
No parameters supported
Response result data.
message
string
Error message, if query was not successful.
query
{}
All handled query parameters echoed back.
result
string
success if query successful, error otherwise.
time
string
The current time at our endpoint.
timestamp
long
The current time at our endpoint.
Identifier used in delivery of aggregated data.
name
The exchange name.
We strive to use only one exchange code to cover all the instrument classes such as spot, futures, etc. However, due to legacy issues, we might use different exchange codes for one exchange. The following exchanges are the exchanges that have more than one exchange code, covering different instrument classes.
Binance
Bybit
Huobi
Kraken
code
Kaiko identifier for the asset.
name
The asset name
asset_class
The asset's primary asset class
asset_classes
The asset's secondary asset classes
curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/exchanges'{
"result": "success",
"data": [
{
"code": "bfly",
"name": "bitFlyer",
"kaiko_legacy_slug": "bl"
},
{
"code": "bfnx",
"name": "Bitfinex",
"kaiko_legacy_slug": "bf"
}
/* ... */
]
}curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/assets'{
"result": "success",
"data": [
{
"code": "btc",
"name": "Bitcoin",
"asset_class": "cryptocurrency",
"asset_classes": [
"cryptocurrency"
]
},
{
"code": "bch",
"name": "Bitcoin Cash",
"asset_class": "cryptohttps://reference-data-api.kaiko.io/v1/assetsReference Data [Basic Tier]
Reference Data [Advanced Tier]
This endpoint retrieves a list of all pools supported by Kaiko. This can help you identify which markets are available when working with our data.
https://reference-data-api.kaiko.io/v1/poolsblockchain
No
Filter on a specific blockchain.
No parameters supported
CME Group publishes fixing prices, typically calculated based on the volume-weighted average price (VWAP) of contracts traded during a pre-defined window of time. These price references are used to determine the exercise and assignment of options positions at expiration and serve as an informational reference point for market participants. Fixing prices also can play an important role in determination of price limits during rapidly moving markets.
For the fixing prices of cryptocurrencies, Bitcoin fixing price will be based on a notionally adjusted volume-weighted average traded price of Bitcoin futures and Micro Bitcoin futures during the 30 minutes prior to 4:00 p.m. London time. For Ethereum fixing price, it will be based on Ether futures and Micro Ether futures.
No parameters supported
Forecast market volatility with implied volatility models and access real-time contract-level derivatives data, including trading volume, open interest, funding rates, and options Greeks.
protocol
The protocol code.
Ex:usp3,aav3, curv, blc2
type
The pool type.
fee
The fee tier.
tokens
Table of each token in the pool. Some pools have 1 token (lending vaults), some can have up to 8 tokens (Balancer DEX).
Format:
[{blockchain, address, symbol, decimals}, ]
tickSpacing
For concentrated liquidity pools.
weights
For Balancer weighted pools.
protocol
No
Exchange code. See
tokens
No
The desired asset code. See
blockchain
The blockchain.
address
The blockchain address of the pool.
name
The name of the pool.
curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/pools'{
"result": "success",
"count": 1537,
"data":
[
{
"blockchain": "bsc",
"address": "0x0004222c2075e9a1291e41f1ca4c8d32141db501",
"name": "MBOX-WBNB-0.003",
"protocol": "pks3",
"type": "liquidity_pool",
"fee": "0.0025",
"tokens":
[
{
"blockchain": "bsc",
"address": "0x3203c9e46ca618c8c1ce5dc67e7e9d75f5da2377",
"symbol": "mbox",
"decimals": "18"
},
{
"blockchain": "bsc",
"address": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
"symbol": "wbnb",
"decimals": "18"
}
],
"tickSpacing": "50"
},
/**********/
]
}trade_date
Reference date of the Fixing Prices
timestamp
Event timestamp
product_code
Product code
instrument
Instrument code
description
Description of the instrument
fixing_price
Fixing price published by CME
{
"query": {},
"time": "2024-05-21T07:04:25.684Z",
"timestamp": 1716275065684,
"data": [
{
"trade_date": "2024-04-30",
"timestamp": 1714489210000,
"product_code": "BTC",
"instrument": "BTCK4",
"description": "Bitcoin Futures",
"fixing_price": 61602.66
},
/* ... */
],
"result": "success"
}This REST API endpoint provides several CME CF Reference Rates, including Bitcoin, Ethereum and others, which are published once a day. These benchmark index prices aggregate trade data from multiple USD markets operated by major cryptocurrency exchanges that conform to the CME CF Constituent Exchange Criteria.
No parameters supported
ref_date
Publication date of the reference rates
instrument
Reference rates name
price
{
"query": {},
"time": "2024-05-21T09:44:14.892Z",
"timestamp": 1716284654892,
"data": [
{
"ref_date": "2024-04-26",
"instrument": "AAVEUSD_RR",
"price": 90.7542
},
{
"ref_date": "2024-04-26",
"instrument": "ADAUSD_RR",
"price": 0.470587
},
/* ... */
],
"result": "success"
}https://us.market-api.kaiko.io/v2/data/fixing.v1/xcmecurl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/fixing.v1/xcme'https://us.market-api.kaiko.io/v2/data/cfbenchmark.v1/cfbenchmarks/xcmecurl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/cfbenchmark.v1/cfbenchmarks/xcme'This endpoint provides access to historical statistics for Broadridge Distributed Ledger Repo (DLR) on the Canton Network. It includes the total number of active contracts, total quantity, and total funds in active DLR transactions for each day over a specified date range. The endpoint is a custom-made for a specific client and is not part of our standard packages. This dataset contains Broadridge's proprietary data and so requires their licensing approval to access. If you're interested in this data, please get in touch and we'll process your access request in partnership with Broadridge.
https://<eu|us>.market-api.kaiko.io/v2/data/dlr/statisticsValue of the reference rates
Analyze and report portfolio performance and measure potential investment losses.
start_date
Start date for the data range in YYYYMMDD format.
20240101
end_date
End date for the data range in YYYYMMDD format. Defaults to current date if not provided.
20240131
sort
Sort order for results: asc (oldest first) or desc (most recent first).
Default: asc
asc
page_size
Maximum number of records per page. Integer between 1 and 1000.
Default: 1000.
100
continuation_token
Token for retrieving the next page of results (if paginating). Obtain from the previous response.
See
Field
Description
date
Date for the data point in YYYYMMDD format.
timestamp
Unix timestamp in milliseconds representing the start of the period.
contracts
curl -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/dlr/statistics?start_date=20250601&end_date=20250630&page_size=1000&sort=asc'import requests
url = "https://us.market-api.kaiko.io/v2/data/dlr/statistics"
headers = {"X-Api-Key": "<client-api-key>", "Accept": "application/json"}
params = {
"start_date": "20250601",
"end_date": "20250630",
"sort": "asc"
}
response = requests.get(url, headers=headers, params=params)
print(response.json()){
"time": "2025-06-26T07:45:28.269608752Z",
"timestamp": 1750923928,
"data": [
{
"date": "20250601",
"timestamp": 1748736000000,
"contracts": 1250,
"quantity": 100000000,
"funds": 113000000
},
{
"date": "20250602",
"timestamp": 1748822400000,
"contracts": 1270,
"quantity": 102500000,
"funds": 115000000
}
/* ... */
],
"continuation_token": "mUNJbiuDHsQ3dtNu7FCP1e8ymWhSnGd7fTuKsJWrGzzw5dACxNpMQ6BwicaUqijfj1bB9GtdYKar4c6BUtkQ8CVunEtCtkwPuCNg8HdhvQXtBxEKy",
"next_url": "https://us.market-api.kaiko.io/v2/data/dlr/statistics?continuation_token=mUNJbiuDHsQ3dtNu7FCP1e8ymWhSnGd7fTuKsJWrGzzw5dACxNpMQ6BwicaUqijfj1bB9GtdYKar4c6BUtkQ8CVunEtCtkwPuCNg8HdhvQXtBxEKy"
}Integer. Count of individual repurchase agreement transactions settled on a given day. Includes both new trades and rolls. One trade = one counterparty pair agreeing to exchange securities for cash with a repurchase obligation.
quantity
Number. Aggregate face value of all securities used as collateral in repo transactions on a given day. For a Treasury repo, this is the par amount of Treasuries delivered, not their market value or the cash borrowed.
funds
Number. Total Aggregate cash volume exchanged in repo transactions on a given day. The sum of all cash lent or borrowed. For overnight repos, this equals the principal amount; for term repos, the initial cash leg.
Reference Data [Advanced Tier]
This endpoint shows the mark price, index price, and price (last traded price) of a derivative.
https://eu.market-api.kaiko.io/v2/data/derivatives.v2/priceregion
Yes
Choose between eu and us.
Information from this endpoint can be accessed through Google BigQuery. To get started, read our .
Market Explorer [Supply and Market Cap]
Market Explorer [Full Coverage]
This endpoint receives information on the supply of each asset, including circulating supply and market capitalization.
Supply data is provided as:
An aggregated supply value derived from all blockchains on which the asset is deployed.
A blockchain-specific supply value for each chain
Data is provided at 5-minute intervals.
Read our supply and market cap methodology .
Reference Data [Basic Tier]
Reference Data [Advanced Tier]
This endpoint retrieves the list of blockchains and associated codes.
https://reference-data-api.kaiko.io/v1/blockchainsNo parameters supported
id
The blockchain's id in our reference data.
name
All API responses are in JSON format. A result field, with a value of success or error is returned with each request. In the event of an error, a message field will provide an error message.
HTTP error codes
The Kaiko platform API uses the following error codes:
When interacting with Kaiko HTTP APIs, you are expected to pass two pieces of information in a header:
Accept: application/json: API responses will be in JSON format.
Accept-Encoding: gzip: All our endpoints benefit from use of compression.
All time parameters are in UTC time zone and returned in the following ISO 8601 datetime format:
YYYY-MM-DD
All Kaiko data is timestamped in the UTC time zone. All timestamps are returned as millisecond Unix timestamps (the number of milliseconds elapsed since 1970-01-01 00:00:00.000 UTC). For metadata fields, times are also returned in millisecond-resolution ISO 8601 datetime strings in the same format as input for convenience.
Accurately value your digital assets to meet fair value standards and regulatory requirements.
406
Not Acceptable
429
Rate limit reached
500
Internal Server Error -- We had a problem with our service. Try again later.
503
Service Unavailable -- We're temporarily offline for maintenance.
400
Bad Request
401
Unauthorized -- You are not authenticated properly. See Authentication.
403
Forbidden -- You don't have access to the requested resource.
404
Not Found
405
Method Not Allowed
Yes
Starting time in ISO 8601 (inclusive).
2023-01-25T00:00:00.000Z
end_time
Yes
Ending time in ISO 8601 (exclusive).
2023-01-26T00:00:00.000Z
sources
No
boolean. If true, returns the breakdown by blockchain of the supply.
Default: false
true
page_size
No
See
Minimum: 1
Maximum: 100
Default: 10
100
circulating_supply
Total circulating supply
1.99478e+07
market_cap
Market capitalisation
2.09489e+12
sources
The per-blockchain breakdown of the supply
chain
The blockchain name
Bitcoin
circulating_supply
Circulating supply
19947806.25
excluded_supply
Excluded supply for the specific chain
0
total_supply
The total supply for the specific chain
19947806.25
asset
Yes
The desired asset code.
See
agix
timestamp
Timestamp at which the interval begins
2023-01-25T00:00:00.000Z
asset
Asset
start_time
btc
The blockchain's name in our reference data.
is_evm
If the blockchain is EVM-Compatible or not.
https://us.market-api.kaiko.io/v2/data/supply.v2/assets/{asset}curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/supply.v2/assets/btc?start_time=2025-11-12T14:00:00.000Z&page_size=100&sources=true&sort=desc'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/supply.v2/assets/btc"
# Start of mandatory parameter configuration
mandatory_params = {
}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
'start_time':'2025-11-12T14:00:00.000Z',
'page_size':100,
'sort':'desc',
'sources':'true'
}
# 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)}"){
"query":
{
"start_time": "2025-11-12T14:00:00.000Z",
"end_time": "2025-11-12T14:00:48.317Z",
"page_size": 100,
"asset": "btc",
"sort": "desc",
"request_time": "2025-11-12T14:00:48.317Z",
"start_timestamp": 1735689600000,
"end_timestamp": 1762956048317
},
"time": "2025-11-12T14:00:48.326Z",
"timestamp": 1762956048326,
"data":
[
{
"timestamp": 1762956005,
"asset": "btc",
"circulating_supply": 19947809.375,
"market_cap": 2093053874177.4607,
"sources":
[
{
"chain": "Bitcoin",
"circulating_supply": "19947809.375",
"excluded_supply": "0",
"total_supply": "19947809.375"
}
]
}
/** Results **/
],
"result": "success",
"continuation_token": "xxx",
"next_url": "https://us.market-api.kaiko.io/v2/data/supply.v2/assets/btc?continuation_token=xxx",
"access":
{
"access_range":
{
"start_timestamp": 1073001600000,
"end_timestamp": "None"
},
"data_range":
{
"start_timestamp": "None",
"end_timestamp": "None"
}
}
}
curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/blockchains'{
"result":"success",
"count": 10,
"data":
[
{"id":1,"name":"ethereum","is_evm":true},
{"id":2,"name":"bsc","is_evm":true},
{"id":3,"name":"polygon","is_evm":true},
{"id":4,"name":"arbitrum","is_evm":true},
{"id":5,"name":"avalanche","is_evm":true},
/* ... */
]
}future, perpetual-future, or option
future
instrument
Yes
Instrument code.
See
One instrument returned per query.
btcusdt250117
interval
No
Interval period (can be one of 1m, 1h, 4h, and 1d). Default 1m
When you query data using aninterval greater than one minute, we'll return the data from the last minute of that time period. For example, if you query data for 09:00 with the interval set at 1h, we'll return data from 09:59 (since that's the last minute of the 09:00-10:00 hour period).
1h
page_size
No
Number of snapshots to return data for. (default: 100, min: 1, max: 1000). See
10
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
asc
start_time
No
Starting time in ISO 8601 (inclusive).
2025-01-01T00:00:00.000Z
end_time
No
Ending time in ISO 8601 (exclusive).
2025-01-04T00:00:00.000Z
mark_price
The mark price of the contract. It is used for calculating profit and loss (PnL) and liquidation price. Designed to be fair and avoid price manipulation.
39745.9
price
Most recent traded price of derivative contract
39767
mark_price
The mark price of the contract. It is used for calculating profit and loss (PnL) and liquidation price. Designed to be fair and avoid price manipulation.
104276.62
price
Most recent traded price of derivative contract
104293.8
mark_price
The mark price of the contract. It is used for calculating profit and loss (PnL) and liquidation price. Designed to be fair and avoid price manipulation.
0.0061
price
Most recent traded price of derivative contract
0.0065
exchange
Yes
Should be one of the exchanges currently supported
okex
instrument_class
timestamp
Timestamp at which the interval begins. In milliseconds.
1650441900000
index_price
The price of the underlying index, often as a weighted average across multiple exchanges' spot prices
timestamp
Timestamp at which the interval begins. In milliseconds.
1735850520000
index_price
The price of the underlying index, often as a weighted average across multiple exchanges' spot prices
timestamp
Timestamp at which the interval begins. In milliseconds.
1735850520000
index_price
The price of the underlying index, often as a weighted average across multiple exchanges' spot prices
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://eu.market-api.kaiko.io/v2/data/derivatives.v2/price?exchange=okex&instrument_class=perpetual-future&instrument=btc-usdt&page_size=2'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "okex"
instrument_class = "perpetual-future"
instrument = "btc-usdt"
# ---- Optional parameters ---- #
interval = "1h"
page_size = 10
sort = "asc"
start_time = None
end_time = None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, instrument_class: str, instrument: str, interval: str, page_size: int, sort: str, start_time: str, end_time: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://eu.market-api.kaiko.io/v2/data/derivatives.v2/price'
params = {
"exchange": exchange,
"instrument_class": instrument_class,
"instrument": instrument,
"interval": interval,
"page_size": page_size,
"sort": sort,
"start_time": start_time,
"end_time": end_time
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, instrument_class=instrument_class, instrument=instrument, interval=interval, page_size=page_size, sort=sort, start_time=start_time, end_time=end_time)
print (df){
"query": {
"exchange": "okex",
"instrument_class": "perpetual-future",
"instrument": "btc-usdt",
"interval": "1m",
"page_size": 2,
"sort": "desc",
"data_version": "v2",
"commodity": "derivatives",
"request_time": "2022-04-28T12:36:34.981Z"
},
"time": "2022-04-28T12:36:37.166Z",
"timestamp": 1651149397166,
"data": [
{
"timestamp": 1651149360000,
"index_price": null,
"mark_price": "39707.8",
"price": "39709.7"
},
{
"timestamp": 1651149300000,
"index_price": "39713.3",
"mark_price": "39745.9",
"price": "39767"
}
],
/*---*/
"access": {
"access_range": {
"start_timestamp": 1646006400000,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Yes
39713.3
97353.8
97508.58
hh:mm:ss.sssFor example:
2017-12-17T13:35:24.351Z
The "T" separates the date from the time. The trailing "Z" indicates UTC time.
Find exchange codes here: .
Find instrument codes here: .
curl --compressed -H 'Accept: application/json' 'https://<api_hostname>/<endpoint>'Level 1 & Level 2 Data [Level 2 Aggregations Tier]
Level 1 & Level 2 Data [Level 2 Tick-Level Tier]
CeFi Spot ticker packs.
This endpoint uses our Raw order book snapshot as source data and enhances its raw data with the Price Slippage metric.
Price Slippage calculates the potential slippage for a market buy order if it were placed at the time the Order Book Snapshot was taken.
https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/snapshots/slippageregion
Yes
Kaiko takes transparency and accountability very seriously. Therefore, our provided datasets are versioned. Dataset versioning is orthogonal to API versioning. Any potential breaking changes in results (e.g. semantical changes or corrections of historically incorrect data) will result in a new dataset version - no corrections or adjustments will be done in the dark. Addition of new data will not result in a new dataset version. Data is versioned on a per-base-data level.
The versioning is selected by selecting a base data set and a version. All current Market Data API endpoints take the commodity and data_version parameters.
By setting this to latest, you will get the most recent version. The returned version is always included in the query field and can be referred to if you would ever need to compare results, should we ever need to adjust historical data. Paginating over a request with version set to latest will preserve the current version across subsequent pagination requests.
latest label might move at any time to a breaking change. For the trades and order_book_snapshots commodities the latest version is currently v1
Choose between eu and us.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
continuation_token
No
See
page_size
No
poll_timestamp
The timestamp at which the raw data snapshot was taken.
poll_date
The date at which the raw data snapshot was taken.
timestamp
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/slippage?end_time=2019-12-09T00:00:00Z&slippage_ref=best&start_time=2019-12-01T00:00:00Z&slippage=1000000&page_size=10'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/snapshots/slippage'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size)){
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"slippage": 100000,
"limit_orders": 0,
"slippage_ref": "best",
"sort": "desc",
"metric": "slippage",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:42:17.053Z"
},
"time": "2020-05-26T14:42:17.123Z",
"timestamp": 1590504137123,
"data": [
{
"poll_timestamp": 1590504124917,
"poll_date": "2020-05-26T14:42:04.917Z",
"timestamp": null,
"ask_slippage": "0.0001057219873253085790064266041007855",
"bid_slippage": "0.0001581287020485902479395059349031256"
},
{
"poll_timestamp": 1590504075786,
"poll_date": "2020-05-26T14:41:15.786Z",
"timestamp": null,
"ask_slippage": "0.00001534073225141691226479256404443437",
"bid_slippage": "0.0002555856086571344339622641509433962"
},
/* ... */
],
"result": "success",
"continuation_token": "Z8Fj1yUWjj3uvv1U2d8fASeGLm4jZ4iHCopdsZLKUyDJE8KrBaDXwQQWXHJQxm",
"next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/slippage?continuation_token=Z8Fj1yUWjj3uvv1U2d8fASeGLm4jZ4iHCopdsZLKUyDJE8KrBaDXwQQWXHJQxm",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Number of snapshots to return data for.
Default: 10
Max: 100
See
Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
slippage
No
Order size (in quote asset) for which to calculate the percentage of slippage.
Default: 0.
When null is returned, not enough volume is present on the order book to execute the order.
slippage_ref
No
Price point for which to calculate slippage from. Either from the mid price (mid_price) or from the best bid/ask (best).
Default: mid_price.
The timestamp provided by the exchange. null when not provided.
ask_slippage
The percentage price slippage for a market buy order placed at the time that the order book snapshot was taken.
bid_slippage
The percentage price slippage for a market sell order placed at the time that the order book snapshot was taken.
Level 1 & Level 2 Data [Level 2 Aggregations Tier]
Level 1 & Level 2 Data [Level 2 Tick-Level Tier]
CeFi Spot ticker packs.
This endpoint returns the average market depth for the requested period.
We are unable to collect the full 10% snapshot from all exchanges we cover. Thus, for some exchanges, 'Market Depth' does not accurately portray the exchange's order book volume.
https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/ob_aggregations/depthregion
Yes
Choose between eu and us.
The Uniswap V3 Liquidity Estimator offers insight into the token reserves on Uniswap V3.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1h.
page_size
No
Number of snapshots to return data for. (default: 10, max: 100). See Automatically included in continuation tokens.
sort
No
Return the data in ascending asc or descending desc order. Default desc
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
continuation_token
No
poll_timestamp
The timestamp at which the interval begins
bid_volume_x
The average volume of bids placed within 0 and x% of the best bid over a specified interval.
ask_volume_x
The average volume of asks placed within 0 and x% of the best ask over a specified interval.
See
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/ob_aggregations/depth?page_size=10&interval=1h'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/ob_aggregations/depth'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size))message = "hello world"
puts message{
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1h",
"slippage": 0,
"slippage_ref": "mid_price",
"sort": "desc",
"aggregation": "depth",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:58:55.582Z"
},
"time": "2020-05-26T14:58:56.395Z",
"timestamp": 1590505136395,
"data": [
{
"poll_timestamp": 1590501600000,
"bid_volume0_1": "31.31635593220339",
"bid_volume0_2": "90.78996610169492",
"bid_volume0_3": "144.16212711864407",
"bid_volume0_4": "182.9676525423729",
"bid_volume0_5": "219.1858220338983",
"bid_volume0_6": "263.02182203389833",
"bid_volume0_7": "296.666686440678",
"bid_volume0_8": "322.5334237288136",
"bid_volume0_9": "340.6282881355932",
"bid_volume1": "356.4558474576271",
"bid_volume1_5": "427.1106949152542",
"bid_volume2": "475.76238135593223",
"bid_volume4": "863.1048559322035",
"bid_volume6": "1137.2281271186441",
"bid_volume8": "1137.5447796610172",
"bid_volume10": "1137.5447796610172",
"ask_volume0_1": "22.772533898305085",
"ask_volume0_2": "36.96916101694915",
"ask_volume0_3": "78.57454237288135",
"ask_volume0_4": "144.87783898305085",
"ask_volume0_5": "195.61884745762714",
"ask_volume0_6": "237.96824576271186",
"ask_volume0_7": "282.3425338983051",
"ask_volume0_8": "314.0606779661017",
"ask_volume0_9": "330.76757627118644",
"ask_volume1": "344.3153644067797",
"ask_volume1_5": "413.4595423728814",
"ask_volume2": "475.48172033898305",
"ask_volume4": "886.8459152542373",
"ask_volume6": "1272.5998644067795",
"ask_volume8": "1371.7920847457626",
"ask_volume10": "1371.7920847457626"
},
/* ... */
],
"result": "success",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
blockchain
No
Should be one of the currently supported blockchains.
ethereum
live
No
Shows the data as soon as the block is validated.
(Default: false, in case of block reorganization).
true
start_block
No
Starting block height (inclusive).
19645000
end_block
No
Ending block height (inclusive).
19645010
start_time
No
Starting time in ISO 8601 (inclusive).
2022-04-01T00:00:00.000Z
end_time
No
Ending time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
price_range
No
The interval of price around the current price, in % (min: 0, default: 0.1, max: 0.2).
0.05
page_size
No
Number of snapshots to return data for. (default: 10, min: 1, max: 10). See
10
blockchain
The blockchain on which the transaction happened.
ethereum
block_number
The height of the block.
Field snapshots
amount0
The amount of token0 in the specified tick range, normalized using the token0 decimals.
0
amount1
The amount of token1 in the specified tick range, normalized using the token1 decimals.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: KAIKO_API_KEY' \
'https://us.market-api.kaiko.io/v2/data/liquidity.v1/snapshots/usp3?pool_address=0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
pool_address = "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640"
# ---- Optional parameters ---- #
blockchain = "ethereum"
live = "false"
start_block = None
end_block = None
start_time = "2022-04-01T00:00:00.000Z"
end_time = "2022-04-01T00:02:00.000Z"
sort = "desc"
price_range = None
page_size = 100
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, pool_address: str, blockchain: str, live: str,
start_block: str, end_block: str, start_time: str,
end_time: str, sort: str, price_range: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://eu.market-api.kaiko.io/v2/data/liquidity.v1/snapshots/usp3'
params = {
"pool_address": pool_address,
"blockchain": blockchain,
"live": live,
"start_block": start_block,
"end_block": end_block,
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"price_range": price_range,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, pool_address=pool_address, blockchain=blockchain,
live=live, start_block=start_block, end_block=end_block,
start_time=start_time, end_time=end_time, sort=sort,
price_range=price_range, page_size=int(page_size))https://eu.market-api.kaiko.io/v2/data/liquidity.v1/snapshots/usp3pool_address
Yes
Pool address.
{
"query": {
"blockchain": "ethereum",
"protocol": "usp3",
"pool_address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"start_block": "*",
"end_block": "*",
"start_time": "*",
"end_time": "*",
"sort": "descending",
"page_size": "10",
"live": "false",
"price_range": "0.1"
},
"time": "2024-09-27T14:03:53.973Z",
"timestamp": 1727445833,
"data": [
{
"block_number": "20842364",
"pool_name": "liquidity_pool",
"pool_address": "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
"current_tick": "197507",
"current_price": 0.00037773843033961135,
"datetime": 1727444963,
"blockchain": "ethereum",
"exchange": "usp3",
"snapshots": [
{
"amount0": 0,
"amount1": 21.540770877363897,
"amount": 2335301572930716700,
"lower_tick": 196460,
"upper_tick": 196470
},
{
"amount0": 0,
"amount1": 21.58927177741234,
"amount": 2339389776616961000,
"lower_tick": 196470,
"upper_tick": 196480
},
...
]
},
...
],
"continuation_token": "xxx",
"next_url": "https://us.market-api.kaiko.io/v2/data/liquidity.v1/snapshots/usp3?continuation_token=xxx"
}
Level 1 & Level 2 Data [Level 1 Aggregations]
Level 1 & Level 2 Data [Level 1 Tick-Level]
Level 1 & Level 2 Data [Level 2 Aggregations]
This endpoint retrieves the OHLCV history for an instrument on an exchange.
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{instrument}/aggregations/ohlcvregion
Yes
Choose between eu and us.
Information from this endpoint can be accessed through Google BigQuery. To get started, read our .
For Centralized Exchange (CEX) taker_side_sell takes the value of true when a taker's sell order fills a maker's buy order and false when a taker's buy order fills a maker's sell order.
For Decentralized Exchanges (DEX) using Automatic Market Maker (AMM) protocols, the liquidity pool contract is considered the maker. The entity executing a transaction against the liquidity pool is the taker.
If an exchange does not appear below, it can be assumed that all data we provide is normalized correctly.
For exchanges where we were unable to confirm as reporting data from either a taker or a maker's perspective, we have included the notation mapping from the exchange's trade direction field to our taker_side_sell field. This is necessary so that researchers who want to further study trade direction can make their own conclusions. For exchanges that classify trade direction differently or exclude the field entirely, we also include the notation mapping and a short explanation for how their variable differs.
Furthermore, there are some trades of the Australian Exchange Independent Reserve, where we cannot decide if it is the taker buy or taker sell. As such, it is the only exchange that has 3 values, which are true, false and unknown, in the field taker_side_sell.
Finally, we have made a couple of errors in classifying exchanges as "maker" or "taker", typically early on in the process of developing taker_side_sell. Rather than switch our trade reporting after years of data collection, we have simply marked exchanges where the inverse of the notation stated should be applied. For these exchanges, researchers should be aware that when taker_side_sell: false, the inverse should be assumed.
Unconfirmed, Misclassified or Absent Trade Direction Field
For Centralized Exchange (CEX) taker_side_sell takes the value of true when a taker's sell order fills a maker's buy order and false when a taker's buy order fills a maker's sell order.
For Decentralized Exchanges (DEX) using Automatic Market Maker (AMM) protocols, the liquidity pool contract is considered the maker. The entity executing a transaction against the liquidity pool is the taker.
If an exchange does not appear below, it can be assumed that all data we provide is normalized correctly.
For exchanges where we were unable to confirm as reporting data from either a taker or a maker's perspective, we have included the notation mapping from the exchange's trade direction field to our taker_side_sell field. This is necessary so that researchers who want to further study trade direction can make their own conclusions. For exchanges that classify trade direction differently or exclude the field entirely, we also include the notation mapping and a short explanation for how their variable differs.
Furthermore, there are some trades of the Australian Exchange Independent Reserve, where we cannot decide if it is the taker buy or taker sell. As such, it is the only exchange that has 3 values, which are true, false and unknown, in the field taker_side_sell.
Finally, we have made a couple of errors in classifying exchanges as "maker" or "taker", typically early on in the process of developing taker_side_sell. Rather than switch our trade reporting after years of data collection, we have simply marked exchanges where the inverse of the notation stated should be applied. For these exchanges, researchers should be aware that when taker_side_sell: false, the inverse should be assumed.
Unconfirmed, Misclassified or Absent Trade Direction Field
This endpoint provides information about lending pools. It shows data such as how many tokens have been deposited and borrowed, as well as the interest rates for lending and borrowing at each block.
This endpoint uses our as source data and enhances its raw data with the Market Depth metric.
Market Depth provides insight into the "depth" of an exchange's order book by aggregating the volume of bids and asks within 0-10% of the best bid or ask, respectively. A higher volume of bids and asks at each level implies more liquidity.
This endpoint retrieves aggregated VWAP (volume-weighted average price) history for an instrument on an exchange.
Liquid (Quoine)
taker_side: "buy" or "sell"
inverse notation: taker_side: "buy"
Inverse, but confirmed perspective from exchange.
Bithumb
"type": "bid" or "ask"
inverse notation: "type": "bid"
Inverse, but confirmed perspective from exchange.
Coinone
"is_ask": "0"(if seller is taker)/"1"(if seller is maker)
inverse notation: "is_ask": "1"
Inverse, confirmed from exchange but slightly different notation format
Bitstamp
type: 0 (buy) or 1 (sell)
type: 1
Unconfirmed perspective from exchange
Bit-Z
"s": "buy" or "sell"
"s": "sell"
Unconfirmed perspective from exchange
EXX
type": "buy" or "sell"
type: "sell"
Unconfirmed perspective from exchange
CEX.io
type: "buy" or "sell"
type: "sell"
Unconfirmed perspective from exchange
Yobit
"type": "bid" or "ask"
"type": "bid"
Unconfirmed perspective from exchange
itBit
None
Always returns true
No buy/sell field
Korbit
None
Always returns null
No buy/sell field
Coinflex
None
Always returns null
No buy/sell field
Independent Reserve
"Side": "Buy" or "Sell"
"Side": "Sell"
Some trades have "Unknown"
AsiaNext
None
Always returns false
No buy/sell field provided
Liquid (Quoine)
taker_side: "buy" or "sell"
inverse notation: taker_side: "buy"
Inverse, but confirmed perspective from exchange.
Bithumb
"type": "bid" or "ask"
inverse notation: "type": "bid"
Inverse, but confirmed perspective from exchange.
Coinone
"is_ask": "0"(if seller is taker)/"1"(if seller is maker)
inverse notation: "is_ask": "1"
Inverse, confirmed from exchange but slightly different notation format
Bitstamp
type: 0 (buy) or 1 (sell)
type: 1
Unconfirmed perspective from exchange
Bit-Z
"s": "buy" or "sell"
"s": "sell"
Unconfirmed perspective from exchange
EXX
type": "buy" or "sell"
type: "sell"
Unconfirmed perspective from exchange
CEX.io
type: "buy" or "sell"
type: "sell"
Unconfirmed perspective from exchange
Yobit
"type": "bid" or "ask"
"type": "bid"
Unconfirmed perspective from exchange
itBit
None
Always returns true
No buy/sell field
Korbit
None
Always returns null
No buy/sell field
Coinflex
None
Always returns null
No buy/sell field
Independent Reserve
"Side": "Buy" or "Sell"
"Side": "Sell"
Some trades have "Unknown"
AsiaNext
None
Always returns false
No buy/sell field provided
Exchange
Exchange Notation
Kaiko taker_side_sell: true equivalent to:
Comment
BTCBox
"type": "buy" or "sell"
inverse notation: "type": "sell"
Inverse, but confirmed perspective from exchange.
Exchange
Exchange Notation
Kaiko taker_side_sell: true equivalent to:
Comment
BTCBox
"type": "buy" or "sell"
inverse notation: "type": "sell"
Inverse, but confirmed perspective from exchange.
16028979
pool_name
Name of the pool as it is written on the blockchain.
USDC-WETH-0.001
pool_address
Address of the contract of the pool.
0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
current_tick
The current tick at this block.
-58580
current_price
The current price at this block, normalized using the pool’s tokens decimals.
0.0028577887443084
datetime
The timestamp of the block. In seconds.
1669161611
snapshots
The snapshot of the liquidity at each tick of the pool.
See table below.
26.4381078606
amount
The amount of liquidity in the specified tick range.
1.7305248294559624e+23
lower_tick
The lower tick of the range.
-59580
upper_tick
The upper tick of the range.
-59520
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
(min: 1, default: 100, max: 100000). See Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive).
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
Automatically included in continuation tokens.
low
Lowest price during interval. null when no trades reported.
close
Closing price of interval. null when no trades reported.
volume
Volume traded in interval. 0 when no trades reported.
Level 1 & Level 2 Data [Level 2 Tick-Level]
DeFi spot ticker packs.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
continuation_token
No
timestamp
Timestamp at which the interval begins.
open
Opening price of interval. null when no trades reported.
high
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/ohlcv'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/ohlcv'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size){
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "ohlcv",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-05-26T17:25:56.221Z"
},
"time": "2020-05-26T17:26:00.160Z",
"timestamp": 1590513960160,
"data": [
{
"timestamp": 1590451200000,
"open": "8900.0",
"high": "9016.99",
"low": "8694.23",
"close": "8811.36",
"volume": "9014.60281966"
},
{
"timestamp": 1590364800000,
"open": "8715.69",
"high": "8977.0",
"low": "8632.93",
"close": "8899.31",
"volume": "12091.06145914"
},
/* ... */
],
"result": "success",
"continuation_token": "rbd2bcDp35GmDscQbvZ9YzQHZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
"next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/krkn/spot/btc-usd/aggregations/ohlcv?continuation_token=rbd2bcDp35GmDqdfaz3fZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}
See
Highest price during interval. null when no trades reported.
One or several of the currently supported blockchains.
Default: ethereum.
See
ethereum
protocol
One or several of the currently supported L&B protocols.
aav1
asset
L&B events including the requested token. Default: all available tokens.
tusd
live
Shows the data as soon as the block is validated.
(Default: false, in case of block reorganization).
true
block_number
Block height.
10795593
start_block
Starting block height (inclusive).
129870
end_block
Ending block height (inclusive).
130000
start_time
Starting time in ISO 8601 (inclusive).
2022-04-01T00:00:00.000Z
end_time
Ending time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
interval
Interval between each snapshot. The suffixes are s (second), m (minute), h (hour), d (day), b (block), change (whenever a change happens). Default: 1b.
152s
sort
Returns the data in ascending or descending order. Default: desc.
ascending
page_size
Number of snapshots to return data for.
(default: 100, min: 1, max: 1000).
See
1000
blockchain
The blockchain on which the transaction happened.
ethereum
block_number
AAVE v1
total_borrowed_stable
The total amount of assets borrowed with a stable rate for this pool.
0
total_borrowed_variable
The total amount of assets borrowed with a variable rate for this pool.
AAVE v2
total_borrowed_stable
The total amount of assets borrowed with a stable rate for this pool.
4162389.524515
total_borrowed_variable
The total amount of assets borrowed with a variable rate for this pool.
Compound
total_reserves
Total liquidity - All of the debt tokens supply.
3486037.365878
Cream
total_reserves
Total liquidity - All of the debt tokens supply.
033661.402437
Maker
collateral_ratio
Minimum ratio of collateral before liquidation.
1.5
debt_ceiling
Maximum amount of DAI that can be emitted on this type of vault.
curl --compressed \
-H 'Accept: application/json' \
-H 'X-Api-Key: <client-api-key>' \
'https://eu.market-api.kaiko.io/v2/data/lending.v1/snapshots?protocol=aav1&asset=tusd'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
blockchain = "ethereum"
protocol = "aav2"
asset = "tusd"
# ---- Optional parameters ---- #
user_address = None
live = "false"
tx_hash = None
block_number = None
start_block = None
end_block = None
start_time = "2025-03-01T13:00:00Z"
end_time = "2025-03-01T13:10:00Z"
sort = "desc"
page_size = 1000
interval = None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, blockchain: str, protocol: str, asset: str, user_address: str, live: str, tx_hash: str, block_number: int, start_block: int, end_block: int, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://eu.market-api.kaiko.io/v2/data/lending.v1/snapshots'
params = {
"blockchain": blockchain,
"protocol": protocol,
"asset": asset,
"user_address": user_address,
"live": live,
"tx_hash": tx_hash,
"block_number": block_number,
"start_block": start_block,
"end_block": end_block,
"start_time": start_time,
"end_time": end_time,
"interval": interval,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, blockchain=blockchain, protocol=protocol, asset=asset, user_address=user_address, live=live, tx_hash=tx_hash, block_number=block_number, start_block=start_block, end_block=end_block, start_time=start_time, end_time=end_time, interval=interval, sort=sort, page_size=page_size)
print (df)https://eu.market-api.kaiko.io/v2/data/lending.v1/snapshotsblockchain
{
"blockchain": "ethereum",
"block_number": "21093894",
"datetime": 1730477315,
"market_id": "aave/v1/tusd",
"protocol": "aav1",
"asset_symbol": "tusd",
"asset_address": "0x0000000000085d4780b73119b644ae5ecd22b376",
"asset_decimals": "18",
"receipt_symbol": "atusd",
"receipt_address": "0x4da9b813057d04baef4e5800e36083717b4a0341",
"receipt_decimals": "18",
"available_liquidity": 293515.77258708066,
"total_borrowed": 10897.083558481298,
"total_liquidity": 304412.85614556196,
"supply_rate": 0,
"stable_borrow_rate": 0,
"variable_borrow_rate": 0,
"metadata": {
"total_borrowed_stable": "0",
"total_borrowed_variable": "10897.083558481297049061"
}
},Choose between eu and us.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
continuation_token
No
See
start_time
No
poll_timestamp
The timestamp at which the raw data snapshot was taken.
poll_date
The date at which the raw data snapshot was taken.
timestamp
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/depth?page_size=10'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/snapshots/depth'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size))https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/snapshots/depthregion
Yes
{
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"slippage": 0,
"limit_orders": 0,
"slippage_ref": "mid_price",
"sort": "desc",
"metric": "depth",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:29:44.757Z"
},
"time": "2020-05-26T14:29:44.816Z",
"timestamp": 1590503384816,
"data": [
{
"poll_timestamp": 1590503344916,
"poll_date": "2020-05-26T14:29:04.916Z",
"timestamp": null,
"bid_volume0_1": "37.606",
"bid_volume0_2": "102.304",
"bid_volume0_3": "141.907",
"bid_volume0_4": "177.446",
"bid_volume0_5": "203.634",
"bid_volume0_6": "218.450",
"bid_volume0_7": "283.128",
"bid_volume0_8": "293.533",
"bid_volume0_9": "321.986",
"bid_volume1": "348.213",
"bid_volume1_5": "405.080",
"bid_volume2": "444.782",
"bid_volume4": "837.949",
"bid_volume6": "1110.065",
"bid_volume8": "1110.065",
"bid_volume10": "1110.065",
"ask_volume0_1": "7.401",
"ask_volume0_2": "13.744",
"ask_volume0_3": "58.917",
"ask_volume0_4": "131.104",
"ask_volume0_5": "165.971",
"ask_volume0_6": "193.786",
"ask_volume0_7": "257.001",
"ask_volume0_8": "286.384",
"ask_volume0_9": "312.040",
"ask_volume1": "319.040",
"ask_volume1_5": "382.927",
"ask_volume2": "475.467",
"ask_volume4": "909.144",
"ask_volume6": "1229.664",
"ask_volume8": "1323.505",
"ask_volume10": "1323.505"
},
/* ... */
],
"result": "success",
"continuation_token": "Z8FjYwcAjf7MZEG382e5MpmZx7wkuziQTyy2k5fVgSrcF8jAYqUpRgPH5cbQ9MhJiFaxGRbwiERMp3cWhXJshy",
"next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/depth?continuation_token=Z8FjYwcAjf7MZEG382e5MpmZx7wkuziQTyy2k5fVgSrcF8jAYqUpRgPH5cbQ9MhJiFaxGRbwiERMp3cWhXJshy",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
} exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
continuation_token
No
See
end_time
No
timestamp
Timestamp at which the interval begins.
price
VWAP. null when no trades reported.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/vwap'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/vwap'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size)https://<eu|us>.market-api.kaiko.io/v2/data/trades.v2/exchanges/{exchange}/{instrument_class}/{instrument}/aggregations/vwapregion
Yes
Choose between eu and us.
{
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "vwap",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:52:36.988Z"
},
"time": "2020-11-12T16:52:37.114Z",
"timestamp": 1605199957114,
"data": [
{
"timestamp": 1605139200000,
"price": "15879.385939106618"
},
{
"timestamp": 1605052800000,
"price": "15664.643871798791"
},
/* ... */
],
"result": "success",
"continuation_token": "55qoNvASfrVdCIjrF8Ygw6TVJ4yamzUyeL9QXAmvWZZur3iaKoPcVBW1V4unNJi2zMjojbsYr9Pgt9XFCUpnAiuBiECm8X4cedvYc9t2WxHXnHKjgAp2wRAeV8ZPUSj8WNgpWTCBVymGaQZPj3oMDZwVeCPyuTLFdVPfTXVjZA94BtHeBmghoPv92JtWxN3yRvCkrw79hJBu",
"next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/vwap?continuation_token=55qoNvASfrVdCIjrF8Ygw6TVJ4yamzUyeL9QXAmvWZZur3iaKoPcVBW1V4unNJi2zMjojbsYr9Pgt9XFCUpnAiuBiECm8X4cedvYc9t2WxHXnHKjgAp2wRAeV8ZPUSj8WNgpWTCBVymGaQZPj3oMDZwVeCPyuTLFdVPfTXVjZA94BtHeBmghoPv92JtWxN3yRvCkrw79hJBu",
"access": {
"access_range": {
"start_timestamp": 1546300800000,
"end_timestamp": 1577836800000
},
"data_range": {
"start_timestamp": 1417391000000,
"end_timestamp": 1577836800000
}
}
}This add-on endpoint ensures IFRS-compliant currency conversions for over 70 fiat pairs when a synthetic price is used in Kaiko Fair Market Value. While synthetic prices can be generated in any fiat currency, this endpoint guarantees compliance for non-USD currencies. In low-liquidity cases, users request a synthetic price quoted in USD, then convert it into their desired fiat currency using this endpoint.
https://us.market-api.kaiko.io/v2/data/analytics.{data_version}/oanda_fx_ratesquote
Kaiko Market Explorer [Full Coverage]
Kaiko Market Explorer [Supply and Market Cap]
This endpoint receives the supply of an asset on a single blockchain, including circulating supply and market capitalization where available.
To retrieve supply across all chains for an asset, use the Aggregated Supply endpoint with the blockchain query parameter, or call this endpoint once per chain.
https://us.market-api.kaiko.io/v2/data/supply.v2/blockchain-level/{blockchain}/{asset}Kaiko Market Explorer [Full Coverage]
Kaiko Market Explorer [Supply and Market Cap]
This endpoint aggregates from the Supply endpoint to provide an aggregated view of supply and market capitalization of the top assets at a specified time.
Data can be aggregated between 5-minute and 30-day intervals; the aggregation considers each 5-minute interval from the raw supply data.
Read our supply and market cap methodology here.
https://us.market-api.kaiko.io/v2/data/supply.v2/topThis endpoint offers in-depth insights into Bitcoin wallets at the transaction level over time.
This endpoint returns principal market value prices for crypto assets, helping with financial reporting under US-GAAP (FASB ASC 820), IFRS, and other major accounting frameworks. It determines the principal market using — a proprietary ranking of cryptocurrency exchanges based on criteria, including regulatory compliance, security, transparency and data quality — to determine the 20 eligible exchanges. Among these exchanges, the principal market is chosen based on the highest 2-week rolling average USD trading volume for the chosen asset.
This endpoint receives information on the Total Value Locked (TVL) of all DeFi protocols covered by Kaiko.
This endpoint retrieves aggregated VWAP (volume-weighted average price) history for an instrument on an exchange.
The height of the block in which the transaction happened.
16025918
datetime
The timestamp of the block in which the transaction happened.
1669124591
protocol
Code of the L&B protocol.
aave/v2
asset_symbol
Symbol of the underlying asset.
crv
asset_address
Address of the underlying asset.
0xd533a949740bb3306d119cc777fa900ba034cd52
asset_decimals
Decimals of the underlying asset.
18
receipt_symbol
Symbol of the receipt asset.
acrv
receipt_address
Address of the receipt asset.
0x8dae6cb04688c62d939ed9b68d32bc62e49970b1
receipt_decimals
Decimals of the receipt asset.
18
total_liquidity
The total amount of liquidity for this pool.
1486160
available_liquidity
The total amount of available liquidity for this pool.
1279630
total_borrowed
The total amount of tokens borrowed for this pool.
206535
supply_rate
The supply rate.
0.00289186
stable_borrow_rate
The stable borrow rate.
0.0442648
variable_borrow_rate
The variable borrow rate.
0.0208089
metadata
Metadata specific to each protocol.
More information below
41872.928778
345075360.304631
total_reserves
Total liquidity - All of the debt tokens supply.
51387128.92415
2500000
debt_floor
Minimum amount of DAI that can be minted for this type of Vault.
2000
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
page_size
No
Number of snapshots to return data for. (default: 10, max: 100). See Automatically included in continuation tokens.
sort
No
Return the data in ascending asc or descending desc order.
Default: desc.
Automatically included in continuation tokens.
The timestamp provided by the exchange. null when not provided.
bid_volume_x
The volume of bids placed within 0 and x% of the best bid. This is what we call "Market Depth".
ask_volume_x
The volume of asks placed within 0 and x% of the best ask. This is what we call "Market Depth"
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
(min: 1, default: 100, max: 100000). See Pagination Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
Automatically included in continuation tokens.
rank
The ranking of the asset in terms of market cap.
1
total_supply
Total supply.
1.99373e+07
circulating_supply
Circulating supply.
1.99373e+07
market_cap
Market capitalisation.
2.2094e+12
datetime
No
Time in ISO 8601. Default: Current time.
2023-01-25T00:00:00.00
interval
No
The interval parameter is suffixed with m, h or d to specify minutes, hours, or days, respectively.
Any arbitrary value between five minutes and 30 days can be used.
Default: 1d.
4h
count
No
Number of assets in the result.
Ex: 10 to retrieve the top 10 assets.
Default: 100.
10
datetime
Timestamp in seconds.
1760918400
asset
Asset.
btc
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/supply.v2/top?datetime=2026-01-01T00:00:00.000Z&count=10&interval=1d'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/supply.v2/top"
# Start of mandatory parameter configuration
mandatory_params = {
'datetime':'2026-01-01T00:00:00.000Z',
'count':10,
'interval':'1d'
}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
}
# 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)}"){
"query":
{
"datetime": "2026-01-01T00:00:00.000Z",
"count": 10,
"interval": "1d"
},
"time": "2026-02-10T13:10:35.136Z",
"timestamp": 1770729035136,
"data":
[
{
"datetime": 1767225600,
"asset": "btc",
"rank": 1,
"total_supply": 19969814.0625,
"circulating_supply": 19969814.0625,
"market_cap": 1754840038141.7961
},
{
"datetime": 1767225600,
"asset": "eth",
"rank": 2,
"total_supply": 120694917.35776222,
"circulating_supply": 120694917.35776222,
"market_cap": 359309601750.3176
},
{
"datetime": 1767225600,
"asset": "usdt",
"rank": 3,
"total_supply": 191200669545.90054,
"circulating_supply": 186408947507.7797,
"market_cap": 186164285382.73282
},
/** Results **/
],
"result": "success"
}interval
No
The interval parameter is suffixed with m, h or d to specify seconds, minutes, hours or days, respectively.
Any arbitrary value between one minute and one day can be used, as long as it sums up to a maximum of 1 day. The suffixes are m (minute), h (hour) and d (day).
Default 1h.
For each interval, the resulting FX rate is an average of all available FX rates over that period.
Automatically included in continuation tokens.
page_size
No
See
Minimum: 1
Maximum: 1000
Default: 100
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order. Default is desc.
Automatically included in continuation tokens.
Yes
The quote fiat currency. Automatically included in continuation tokens.
base
Yes
The base fiat currency. Automatically included in continuation tokens.
continuation_token
No
See Pagination
end_time
No
timestamp
Timestamp at which the interval ends.
fx_rate
Average fx rate over the interval.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/oanda_fx_rates?base=eur&page_size=2&sort=desc&interval=1d"e=jpy'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
quote = "usd"
base = "jpy"
# ---- Optional parameters ---- #
interval = "1h"
sort = "desc"
page_size = 100
start_time= "2025-01-01T00:00:00.000Z"
end_time= "2025-01-31T00:00:00.000Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, quote: str, base: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/analytics.v2/oanda_fx_rates'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval,
"quote": quote,
"base": base
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, quote=quote, base=base, interval=interval, start_time=start_time, end_time=end_time, sort=sort, page_size=page_size)
print (df){
"query": {
"base": "eur",
"quote": "jpy",
"interval": "1d",
"page_size": "2",
"sort": "desc",
"start_time": "null",
"end_time": "2022-08-31T08:38:25.883Z"
},
"time": "2022-08-31T08:38:25.905Z",
"timestamp": 1661935105,
"data": [
{
"timestamp": 1660780800000,
"fx_rate": "137.38630485436903"
},
{
"timestamp": 1660694400000,
"fx_rate": "137.15155641205303"
}
],
"continuation_token": "4tvMKJPYA6ESWsE7s87P2ujFvr6XRNvegzst2eg1EpdyQEPKWpuNic5XPGrhz47RzbbqC598E3XusLo34Hivgw4sYrrvdmYxL7WQVtebjtYVMUPPd97vqo2VjL22A6cTSNojTQsvHh8T6MPRjuJAMfx5LWyVZQWYyzLrSE",
"next_url": "https://us.market-api.kaiko.io/v2/data/analytics.v2/oanda_fx_rates?continuation_token=4tvMKJPYA6ESWsE7s87P2ujFvr6XRNvegzst2eg1EpdyQEPKWpuNic5XPGrhz47RzbbqC598E3XusLo34Hivgw4sYrrvdmYxL7WQVtebjtYVMUPPd97vqo2VjL22A6cTSNojTQsvHh8T6MPRjuJAMfx5LWyVZQWYyzLrSE"
}Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
blockchain
Blockchain name
ethereum
total_supply
Total supply on this chain
28535000000.00
circulating_supply
Circulating supply on this chain. null for Canton instruments.
28535000000.00
market_cap
Market capitalization on this chain. null for Canton instruments.
28535000000.00
blockchain
Yes
Normalized blockchain identifier. Common values: ethereum, solana, polygon, arbitrum, canton.
ethereum
asset
Yes
The desired asset code. See .
usdc
start_time
No
Starting time in ISO 8601 (inclusive).
2026-04-14T00:00:00.000Z
end_time
No
Ending time in ISO 8601 (exclusive).
2026-04-16T00:00:00.000Z
sort
No
Sort direction by timestamp (asc / desc). Default: desc.
desc
page_size
No
See Pagination. Minimum: 1 Maximum: 1000 Default: 100.
100
timestamp
Timestamp at which the interval begins
1744848000
asset
Asset
curl --request GET \
--url 'https://us.market-api.kaiko.io/v2/data/supply.v2/blockchain-level/canton/cbtc?start_time=2026-05-13T00:00:00Z&end_time=2026-05-13T23:59:59Z&page_size=10&sort=desc' \
--header 'Accept: application/json' \
--header 'X-Api-Key: KAIKO_API_KEY'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/supply.v2/blockchain-level/canton/cbtc"
# Start of mandatory parameter configuration
mandatory_params = {
}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
'start_time':'2026-05-13T00:00:00Z',
'end_time':'2026-05-13T23:59:59Z',
'page_size':10,
'sort':'desc'
}
# 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)}"){
"query": {
"start_time": "2026-05-13T00:00:00.000Z",
"end_time": "2026-05-13T23:59:59.000Z",
"page_size": 10,
"asset": "cbtc",
"blockchain": "canton",
"sort": "desc",
"request_time": "2026-05-13T07:57:55.131Z",
"start_timestamp": 1778630400000,
"end_timestamp": 1778716799000
},
"time": "2026-05-13T07:57:55.136Z",
"timestamp": 1778659075136,
"data": [
{
"timestamp": 1778655600,
"asset": "cbtc",
"blockchain": "canton",
"total_supply": 29.0089104357,
"circulating_supply": null,
"market_cap": null
}
/** Results **/
],
"result": "success",
"access": {
"access_range": {
"start_timestamp": 1578006000000,
"end_timestamp": 1893625200000
},
"data_range": {
"start_timestamp": 1578006000000,
"end_timestamp": 1893625200000
}
}
}usdc
bitcoin
sort
The sorting order for the results.
asc or desc
page_size
Number of results to return data for. (max: 5000).
See
100
start_block
Starting block height (inclusive).
600000
end_block
Ending block height (inclusive).
700000
start_time
Starting time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
end_time
Ending time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
transaction_hash
The specific transaction hash to query.
f6932e70e4c5483d7b1fa2ee7c56ad89207221bbf186ad0a15cd0cc4e18906f5
chain
Blockchain name.
bitcoin
block_number
The height of the block.
curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
"https://eu.market-api.kaiko.io/v2/data/wallet.v1/transactions?blockchain=bitcoin"##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
blockchain = "bitcoin"
# ---- Optional parameters ---- #
start_block = 600000
end_block = 600001
start_time = None
end_time = None
page_size = 100
sort = "desc"
transaction_hash = None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, blockchain: str, start_block: int, end_block: int, start_time: str, end_time: str, page_size: int, sort: str, transaction_hash: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/wallet.v1/transactions'
params = {
"blockchain": blockchain,
"start_block": start_block,
"end_block": end_block,
"start_time": start_time,
"end_time": end_time,
"page_size": page_size,
"sort": sort,
"transaction_hash": transaction_hash
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, blockchain=blockchain, start_block=start_block, end_block=end_block, start_time=start_time, end_time=end_time, page_size=page_size, sort=sort, transaction_hash=transaction_hash)
print (df)https://us.market-api.kaiko.io/v2/data/wallet.v1/transactionsblockchain
Always bitcoin.
{
"query":
{
"live": "False",
"start_time": "2009-01-01T00:00:00.000Z",
"end_time": "2009-01-01T00:00:00.000Z",
"start_block": 0,
"end_block": 0,
"page_size": 1000,
"sort": "ASCENDING",
"data_version": "v1",
"commodity": "wallet_data",
"request_time": "2009-01-01T00:00:00.000Z"
},
"time": "2009-01-01T00:00:00.000Z",
"timestamp": 1704069091000,
"access":
{
"access_range":
{
"start_timestamp": 1073001600000,
"end_timestamp": "None"
},
"data_range":
{
"start_timestamp": "None",
"end_timestamp": "None"
}
},
"data":
[
{
"chain": "bitcoin",
"block_number": 823787,
"timestamp": 1704069091000000000,
"transaction_hash": "e651241e9982332ea4cf59923d8cbc7468e1960bb5ab9f68d9e72984830c530c",
"transaction_id": "e651241e9982332ea4cf59923d8cbc7468e1960bb5ab9f68d9e72984830c530c",
"transaction_index": 15,
"sender_addresses":
[
"1n8gms991ydy1e696e9sb9esyy5cksu7hz"
],
"receiver_addresses":
[
"1n8gms991ydy1e696e9sb9esyy5cksu7hz",
"3juadjkqtgzr9p9n59rtugv5pl2tohf6t9",
"bc1q5g4w7sajpqvd0syvghsqvrxcf2ysxce0yxqjkx"
],
"token_symbol": "BTC",
"amount_out": 0.37257751,
"fees": 0.0014,
"amount_out_usd": 15729.55,
"fees_usd": 59.1
},
/* ... */
],
"continuation_token": "xxx",
"next_url": "https://us.market-api.kaiko.io/v2/data/wallet.v1/transactions?continuation_token=xxx"
}
}The desired base asset code
end_time
Ending time in ISO 8601 (exclusive) Automatically included in continuation tokens. Note: data is for the current quarter only.
timestamp
The time at which the value was calculated.
price
The Principal Market Value. Price represented in USD.
last_trade_timestamp
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/principal_market_value?end_time=2025-09-09T15:00:00.000Z&asset=btc'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
asset = "btc"
# ---- Optional parameters ---- #
end_time = "2025-09-09T15:00:00.000Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, asset: str, end_time: str = None):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/principal_market_value'
params = {
"asset": asset,
"end_time": end_time
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, asset=asset, end_time=end_time)
print(df)https://us.market-api.kaiko.io/v2/data/trades.v1/principal_market_valueasset
{
"query": {
"end_time": "2025-09-09T15:00:00Z",
"asset": "btc",
"data_version": "v1",
"commodity": "principal_market_value",
"request_time": "2025-09-15T13:00:08.391Z",
"end_timestamp": 1757430000000
},
"time": "2025-09-15T13:00:08.494Z",
"timestamp": 1757941208494,
"data": [
{
"timestamp": 1757430000000,
"last_trade_timestamp": 1757429999945,
"price": 111764,
"principal_market_name": "CRCO",
"principal_market_code": "crco",
"adtv_2w": 8135.835284285715,
"total_adtv_2w": 16893.05731083857
}
],
"result": "success",
"access": {
"access_range": {
"start_timestamp": 1454284800000,
"end_timestamp": 1877896800000
},
"data_range": {
"start_timestamp": 1454281200000,
"end_timestamp": 1877896800000
}
}
}aave
start_date
No
Starting date in YYYYMMDD (inclusive).
20230125
end_date
No
Ending date in YYYYMMDD (exclusive).
20230126
start_time
No
Starting time in ISO 8601 (inclusive) Hours will be ignored.
2023-01-25T00:00:00.00
end_time
No
Ending time in ISO 8601 (exclusive) Hours will be ignored.
2023-01-26T00:00:00.00
page_size
No
See
Minimum: 1
Maximum: 1000
Default: 1000
100
sort
No
If asc, sort time-series in ascending. If desc, sort time-series in descending.
Default: desc
asc
timestamp
Timestamp at which the interval begins.
1763856000
protocol_name
Protocol name.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/tvl?start_date=20251001&protocol=aave'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/tvl"
# Start of mandatory parameter configuration
mandatory_params = {
}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
'start_date':'20251001',
'page_size':100,
'sort':'desc',
'protocol':'aave'
}
# 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)}")https://us.market-api.kaiko.io/v2/data/tvl/protocol
No
The desired protocol code.
If not specified, the endpoint will return the list of all protocol codes.
{
"query":
{
"protocol": "aave",
"start_date": "seconds:1759276800",
"end_date": "seconds:1764028800",
"sort": "desc",
"page_size": "1"
},
"time": "2025-11-25T10:20:15.37953193Z",
"timestamp": 1764066015,
"data":
[
{
"timestamp": 1763856000,
"protocol_name": "Aave",
"protocol_code": "aave",
"tvl": 50404639283.57133
},
/** Results **/
],
"continuation_token": "xxx",
"next_url": "https://eu.market-api.kaiko.io/v2/data/tvl?continuation_token=xxx"
}
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
continuation_token
No
See
end_time
No
timestamp
Timestamp at which the interval begins.
price
VWAP. null when no trades reported.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/vwap'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/vwap'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size)https://<eu|us>.market-api.kaiko.io/v2/data/trades.v2/exchanges/{exchange}/spot/{instrument}/aggregations/vwapregion
Yes
Choose between eu and us.
You can use this same endpoint to get data for all market types. Kaiko subscriptions are sold per market type.
{
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "vwap",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:52:36.988Z"
},
"time": "2020-11-12T16:52:37.114Z",
"timestamp": 1605199957114,
"data": [
{
"timestamp": 1605139200000,
"price": "15879.385939106618"
},
{
"timestamp": 1605052800000,
"price": "15664.643871798791"
},
/* ... */
],
"result": "success",
"continuation_token": "55qoNvASfrVdCIjrF8Ygw6TVJ4yamzUyeL9QXAmvWZZur3iaKoPcVBW1V4unNJi2zMjojbsYr9Pgt9XFCUpnAiuBiECm8X4cedvYc9t2WxHXnHKjgAp2wRAeV8ZPUSj8WNgpWTCBVymGaQZPj3oMDZwVeCPyuTLFdVPfTXVjZA94BtHeBmghoPv92JtWxN3yRvCkrw79hJBu",
"next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/vwap?continuation_token=55qoNvASfrVdCIjrF8Ygw6TVJ4yamzUyeL9QXAmvWZZur3iaKoPcVBW1V4unNJi2zMjojbsYr9Pgt9XFCUpnAiuBiECm8X4cedvYc9t2WxHXnHKjgAp2wRAeV8ZPUSj8WNgpWTCBVymGaQZPj3oMDZwVeCPyuTLFdVPfTXVjZA94BtHeBmghoPv92JtWxN3yRvCkrw79hJBu",
"access": {
"access_range": {
"start_timestamp": 1546300800000,
"end_timestamp": 1577836800000
},
"data_range": {
"start_timestamp": 1417391000000,
"end_timestamp": 1577836800000
}
}
}Market Explorer [Supply and Market Cap]
Market Explorer [Full Coverage]
This endpoint aggregates from the Supply endpoint to provide an aggregated view of supply and market capitalization.
Data can be aggregated between 5-minute and 30-day intervals; the aggregation considers each 5-minute interval from the raw supply data that falls between the start_time and end_time configured.
Read our supply and market cap methodology here.
https://us.market-api.kaiko.io/v2/data/supply.v2/aggregated/{asset}For queries that result in a larger dataset than can be returned in a single response, a continuation_token field is included. Calling the same endpoint again with the continuation_token query parameter added will return the next result page. For convenience, a next_url field is also included, containing a URL that can be called directly to get the next page. Paginated endpoints also take a page_size parameter that specifies the maximum number of items that should be included in each response. Only the first call should include page_size, all subsequent calls should only use continuation_token. Paginating over a request with version set to latest will preserve the current version across subsequent pagination requests.
Parameters
The following script can be used to browse pages in Python. Make sure to update your trade_url and X-Api-Key.
This example uses Pandas for convenience. If you're unfamiliar with them, use the standard Python example.
For queries that result in a larger dataset than can be returned in a single response, a continuation_token field is included. Calling the same endpoint again with the continuation_token query parameter added will return the next result page. For convenience, a next_url field is also included, containing a URL that can be called directly to get the next page. Paginated endpoints also take a page_size parameter that specifies the maximum number of items that should be included in each response. Only the first call should include page_size, all subsequent calls should only use continuation_token. Paginating over a request with set to latest will preserve the current version across subsequent pagination requests.
Parameters
The following script can be used to browse pages in Python. Make sure to update your trade_url and X-Api-Key.
This example uses Pandas for convenience. If you're unfamiliar with them, use the standard Python example.
This endpoint offers in-depth insights into Solana wallets including transfers and wallet balances over time.
This endpoint retrieves information on instruments (exchange trading pairs) and their associated codes.
Returns time-series staking metrics for a specified blockchain protocol. The endpoint covers protocol-level data including validator counts, and yield metrics.
Timestamp of the trade corresponding to the Principal Market Value.
principal_market_name
Exchange name in which the trade has been executed, i.e. “principal market”.
principal_market_code
Exchange code in which the trade was executed, i.e. “principal market”.
adtv_2w
The two week average daily trading volume of the principal market (in base asset)
total_adtv_2w
The two week average daily trading volume among the eligible exchanges (in base asset)
395211
timestamp
The timestamp of the block.
1453853136
transaction_hash
Transaction hash.
94ad60ff0ef4cd0f31cab884adc6c39720273e9468ac0019a339911f0dd26e76
transaction_id
Transaction ID.
f6932e70e4c5483d7b1fa2ee7c56ad89207221bbf186ad0a15cd0cc4e18906f5
transaction_index
The index of the transaction.
0
sender_addresses
The addresses that sends the coin.
[1A8MMLhpGEyNqEsqzkReXtmBx9LBQgt8Mh]
receiver_addresses
The addresses that receives the coin.
[19Ntq9wC9i39284EZVVf4R7DbCz7gThxzs,12eKGe5hLdKBe8mQ7dv8NixEcX96XHBkoZ]
token_symbol
Symbol of the coin transferred
BTC
amount_out
Amount of asset transferred.
10.12592654
fees
Fees paid for the transaction.
0.0004
amount_out_usd
Amount of asset transferred in usd.
3965.771819253574
fees_usd
Fees paid for the transaction in usd.
0.15665813112855445
Aave
protocol_code
Protocol code.
aave
tvl
Total value locked (TVL) in USD.
5.04046e+10
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
(min: 1, default: 100, max: 100000). See Pagination Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
Automatically included in continuation tokens.
continuation_token
No
page_size
No
continuation_token
No
page_size
No
import http.client
import json
conn = http.client.HTTPSConnection("us.market-api.kaiko.io")
endpoint = "/v2/data/trades.v1/spot_exchange_rate/btc/usd"
params = "?interval=1h&start_time=2024-09-01T00:00:00.000Z&end_time=2024-09-10T00:00:00.000Z"
headers = {
"X-Api-Key": "XXX",
"Accept": "application/json"
}
all_trades = []
next_url = endpoint + params
while next_url:
conn.request("GET", next_url, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode("utf-8"))
all_trades.extend(data.get("data", []))
print(f"Fetched {len(data.get('data', []))} datapoints. Total: {len(all_trades)}")
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_trades)}")Maximum number of records to return in one response
Maximum number of records to return in one response
import requests
import pandas as pd
trade_url = "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/usp3/spot/usdc-weth/trades?start_time=2022-11-01T00:00:00.000Z&end_time=2022-12-01T00:00:00.000Z"
headers = {"X-Api-Key": "XXX","Accept": "application/json"}
output = requests.get(trade_url, headers = headers).json()
df = pd.DataFrame(output["data"])
while "next_url" in output:
output = requests.get(output["next_url"], headers = headers).json()
df_to_add = pd.DataFrame(output["data"])
print(df_to_add)
df= pd.concat([df, df_to_add])
print(df)import http.client
import json
conn = http.client.HTTPSConnection("us.market-api.kaiko.io")
endpoint = "/v2/data/trades.v1/spot_exchange_rate/btc/usd"
params = "?interval=1h&start_time=2024-09-01T00:00:00.000Z&end_time=2024-09-10T00:00:00.000Z"
headers = {
"X-Api-Key": "XXX",
"Accept": "application/json"
}
all_trades = []
next_url = endpoint + params
while next_url:
conn.request("GET", next_url, headers=headers)
response = conn.getresponse()
data = json.loads(response.read().decode("utf-8"))
all_trades.extend(data.get("data", []))
print(f"Fetched {len(data.get('data', []))} datapoints. Total: {len(all_trades)}")
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_trades)}")import requests
import pandas as pd
trade_url = "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/usp3/spot/usdc-weth/trades?start_time=2022-11-01T00:00:00.000Z&end_time=2022-12-01T00:00:00.000Z"
headers = {"X-Api-Key": "XXX","Accept": "application/json"}
output = requests.get(trade_url, headers = headers).json()
df = pd.DataFrame(output["data"])
while "next_url" in output:
output = requests.get(output["next_url"], headers = headers).json()
df_to_add = pd.DataFrame(output["data"])
print(df_to_add)
df= pd.concat([df, df_to_add])
print(df)2023-01-26T00:00:00.000Z
interval
No
The interval parameter is suffixed with m, h or d to specify minutes, hours, or days, respectively
Any arbitrary value between five minutes and 30 days can be used.
Default: 1h.
4h
page_size
No
See
Minimum: 1
Maximum: 100
Default: 100
100
blockchain
No
Normalized blockchain identifier. Common values: ethereum, solana, polygon, arbitrum, canton.
ethereum
circulating_supply
Circulating supply
1.99373e+07
market_cap
Market capitalisation
2.2094e+12
total_supply
Total supply
1.99373e+07
asset
Yes
The desired asset code
See
btc
start_time
No
Starting time in ISO 8601 (inclusive)
2023-01-25T00:00:00.00
end_time
No
timestamp
Timestamp at which the interval begins
1760918400
asset
Asset
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/supply.v2/aggregated/btc?start_time=2025-10-20T00:00:00.000Z&end_time=2025-10-21T00:00:00.000Z&page_size=100&interval=1d'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/supply.v2/aggregated/btc"
# Start of mandatory parameter configuration
mandatory_params = {
'start_time':'2025-10-20T00:00:00.000Z',
'end_time':'2025-10-21T00:00:00.000Z',
'page_size':100,
'interval':'1d'
}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
}
# 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)}"){
"query":
{
"start_time": "2025-10-20T00:00:00.000Z",
"end_time": "2025-10-21T00:00:00.000Z",
"page_size": 100,
"asset": "btc",
"interval": "1d",
"sort": "asc",
"request_time": "2025-11-12T14:18:27.226Z",
"start_timestamp": 1760918400000,
"end_timestamp": 1761004800000
},
"time": "2025-11-12T14:18:27.253Z",
"timestamp": 1762957107253,
"data":
[
{
"timestamp": 1760918400,
"asset": "btc",
"circulating_supply": 19937318.75,
"market_cap": 2209402368348.39,
"total_supply": 19937318.75
}
/** Results **/
],
"result": "success",
"continuation_token": "xxx",
"next_url": "https://us.market-api.kaiko.io/v2/data/supply.v2/aggregated/btc?continuation_token=xxx",
"access":
{
"access_range":
{
"start_timestamp": 1073001600000,
"end_timestamp": "None"
},
"data_range":
{
"start_timestamp": "None",
"end_timestamp": "None"
}
}
}Ending time in ISO 8601 (exclusive)
btc
sort
The sorting order for the results.
asc or desc
page_size
Number of results to return data for. (max: 5000).
See
100
start_time
Starting time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
end_time
Ending time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
transaction_hash
Filter by transaction hash.
syJFDzPJJ92GLsXqYXUKEY23e8uoLPAdgci7Ko9cUYZxvCvf5SHdKnYuC1Jh7UrTSzRc2EpUB7kzCwGd2qdTnKD
user_address
Filter by user address.
2AXXcN6oN9bBT5owwmTH53C7QHUXvhLeu718Kqt8rvY2
token_address
Filter by token address.
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
token_symbol
Filter by token symbol.
SOL
chain
Blockchain name.
solana
block_number
curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
"https://eu.market-api.kaiko.io/v2/data/wallet.v1/audit?blockchain=solana"##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
blockchain = "solana"
# ---- Optional parameters ---- #
start_time = "2025-03-05T00:00:00Z"
end_time = "2025-03-05T00:02:00Z"
page_size = 100
sort = "desc"
transaction_hash = None
user_address = None
token_address = None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, blockchain: str, start_time: str, end_time: str, page_size: int, sort: str, transaction_hash: str, user_address: str, token_address: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/wallet.v1/audit'
params = {
"blockchain": blockchain,
"start_time": start_time,
"end_time": end_time,
"page_size": page_size,
"sort": sort,
"transaction_hash": transaction_hash,
"user_address": user_address,
"token_address": token_address
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, blockchain=blockchain, start_time=start_time, end_time=end_time, page_size=page_size, sort=sort, transaction_hash=transaction_hash, user_address=user_address, token_address=token_address)
print (df)transfer
A coin transfer operation.
token_transfer
This operation involves the transfer of (SPL) tokens.
gas_fees
https://us.market-api.kaiko.io/v2/data/wallet.v1/auditblockchain
Always solana.
solana
{
"query":
{
"live": "False",
"start_time": "2024-01-01T00:00:00.000Z",
"end_time": "2024-01-02T00:00:00.000Z",
"start_block": 0,
"end_block": 0,
"page_size": 100,
"sort": "0",
"data_version": "v1",
"commodity": "wallet_data",
"request_time": "2024-01-01T00:00:00.000Z"
},
"time": "2024-01-01T00:00:00.000Z",
"timestamp": 1732530743000,
"access":
{
"access_range":
{
"start_timestamp": 1073001600000,
"end_timestamp": "None"
},
"data_range":
{
"start_timestamp": "None",
"end_timestamp": "None"
}
},
"data":
[
{
"chain": "solana",
"block_number": 328800011,
"timestamp": 1742793063000000000,
"user_address": "h3ZXAE168mNxsszYYrUfkMVSCWx6DU2Uvrx97Kb1Nch",
"transaction_hash": "swSCgiEcupMtZpvuhubRp1h9BXkWdgox11qgJKofNxSnMTQuqAJEGbaiQyJtg5qXxVtyeVzUDizyLvcHcVj7E2k",
"transaction_type": "transaction_fee",
"transaction_index": 990,
"ordinal": 11,
"sender_address": "h3ZXAE168mNxsszYYrUfkMVSCWx6DU2Uvrx97Kb1Nch",
"receiver_address": "",
"token_symbol": "SOL",
"token_address": "NativeSoL1111111111111111111111111111111111",
"direction": "out",
"amount": 5e-06,
"amount_usd": 0.0006937108995617679,
"balance_after": 51.445994867,
"balance_after_usd": 7137.729475607333
},
/* ... */
],
"continuation_token": "xxx",
"next_url": "https://us.market-api.kaiko.io/v2/data/wallet.v1/audit?continuation_token=xxx"
}
}base_asset
No
The desired base asset code. See
quote_asset
No
The desired quote asset code. See
code
No
Kaiko identifier for the instrument. Always base_asset-quote_asset for spot instruments.
kaiko_legacy_symbol
No
Kaiko legacy instrument symbol.
class
No
spot, future, perpetual-future, option, etc.
base_asset_class
No
Base asset class.
quote_asset_class
No
Quote asset class.
trade_start_timestamp
No
Starting time in ISO 8601 (inclusive).
trade_end_timestamp
No
Ending time in ISO 8601 (inclusive). Can also use "ongoing" to get ongoing instruments.
trade_count_min
No
Minimum number of trades.
trade_count_max
No
Maximum number of trades.
with_list_pools
No
true or false. For pairs traded on DEXs, provides the list of underlying pools to each instrument.
continuation_token
No
See
limit
No
Maximum number of records to return in one response
orderBy
No
Order results by a specific field. See below for all possible values.
order
No
Return the data in ascending (1) or descending (-1) order
blockchain
No
Filter on a specific blockchain for on-chain instruments.
base_asset
Base asset.
class
spot, future, perpetual-future,...
code
curl --compressed -H 'Accept: application/json' 'https://reference-data-api.kaiko.io/v1/instruments'{
"result": "success",
"data": [
{
"kaiko_legacy_exchange_slug": "bf",
"trade_start_time": "2017-08-09T23:36:33.0000000Z",
"trade_end_time": null,
"code": "xmr-btc",
"exchange_code": "bfnx",
"exchange_pair_code": "XMRBTC",
"base_asset": "xmr",
"quote_asset": "btc",
"kaiko_legacy_symbol": "xmrbtc",
"class": "spot",
"trade_start_timestamp": 1502321793000,
"trade_end_timestamp": null,
"trade_count": 2439870,
"trade_compressed_size": 35037071
},
{
"kaiko_legacy_exchange_slug": "kk",
"trade_start_time": "2017-08-08T20:10:04.0000000Z",
"trade_end_time": null,
"code": "gno-eth",
"exchange_code": "krkn",
"exchange_pair_code": "GNOETH",
"base_asset": "gno",
"quote_asset": "eth",
"kaiko_legacy_symbol": "gnoeth",
"class": "spot",
"trade_start_timestamp": 1502223004345,
"trade_end_timestamp": null,
"trade_count": 380822,
"trade_compressed_size": 21119034
},
/* ... */
]
}https://reference-data-api.kaiko.io/v1/instrumentsexchange_code
No
Exchange code. See
Some exchanges may refer to "base" and "quote" currencies differently.
When we report the "price" of a trade, we're referring to the "base_asset" price as reported by the exchange.
When we report the "volume" involved in a trade, we're referring to volume of the "base_asset" as reported by the exchange.
solana
methodology
No
The desired methodology code.
epoch_aggregate_v1
start_time
No
Starting time in ISO 8601 (inclusive)
2023-01-25T00:00:00.00
end_time
No
Ending time in ISO 8601 (exclusive)
2023-01-25T00:00:00.00
start_date
No
Starting date in YYYYMMDD (inclusive).
20250101
end_date
No
Ending date in YYYYMMDD (exclusive).
20250102
page_size
No
See
Minimum: 1
Maximum: 1000
Default: 1000
100
sort
No
If asc, sort time-series in ascending. If desc, sort time-series in descending.
Default: desc
asc
date
Date at which the interval begins.
2026-04-21
protocol
Protocol code.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/staking.v1/protocols/solana?start_date=20261001'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/staking.v1/protocols/solana"
# Start of mandatory parameter configuration
mandatory_params = {
}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
'start_date':'20251001',
'page_size':100,
'sort':'desc',
'methodology':'epoch_aggregate_v1'
}
# 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)}")https://us.market-api.kaiko.io/v2/data/staking.v1/protocols/{protocol}protocol
Yes
The desired protocol code. If not specified, the endpoint will return the list of all protocol codes and methodologies.
{
"query":
{
"start_date": "20260101",
"end_date": "20260422",
"start_time": "2026-01-01T00:00:00Z",
"end_time": "2026-04-22T00:00:00Z",
"sort": "descending",
"page_size": "10",
"methodology": "epoch_aggregate_v1"
},
"time": "2026-04-22T14:46:38.274392363Z",
"timestamp": 1776869198,
"data":
[
{
"date": "2026-04-21",
"protocol": "solana",
"apr": 4.758636113435191,
"validators": 777,
"methodology": "epoch_aggregate_v1"
},
/** Results **/
],
"continuation_token": "xxx",
"next_url": "https://eu.market-api.kaiko.io/v2/data/staking.v1/protocols/solana?continuation_token=xxx"
}
Liquidation insight for derivatives exchanges
Kaiko Derivatives Risk Indicators [Basic Tier]
Kaiko Derivatives Risk Indicators [Advanced Tier]
This endpoint returns the volumes of liquidations for derivatives contracts for a given asset. Data is aggregated across the interval requested, and expressed in USD value. Data is available for futures and perpetual futures. For exchange coverage, see Cefi derivative markets
https://<eu|us>.market-api.kaiko.io/v2/data/liquidation.v1/token/{asset}region
Yes
Level 1 & Level 2 Data [Level 1 Aggregations]
Level 1 & Level 2 Data [Level 1 Tick-Level]
Level 1 & Level 2 Data [Level 2 Aggregations]
This endpoint retrieves aggregated VWAP (volume-weighted average price) history for an instrument on an exchange.
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v2/exchanges/{exchange}/spot/{instrument}/aggregations/vwapregion
Yes
Choose between eu and us.
Tick-level data is the most granular level of trading data and contains every single trade that occurs on centralized and decentralized exchanges. The data is normalized and timestamped and contains information such as the price and volume of each trade. For DEXs specifically, we also provide additional information on the user address, the blockchain, the pool address, and the transaction hash related to the trade. Read our DEX trade data methodology .
Kaiko identifier for the instrument. Always base_asset-quote_asset for spot instruments.
exchange_code
Exchange code. See
exchange_pair_code
Identifier for the instrument used by the exchange.
For perpetual futures pairs, the code may differ from the exchange's and include a _perp suffix (e.g., btcusdt_perp).
kaiko_legacy_exchange_slug
Legacy slug for the exchange. See
kaiko_legacy_symbol
Identifier used in past deliveries of historical market data and Data Feed.
quote_asset
Quote asset
trade_start_time
Time of the first available trade in Kaiko's data set.
trade_start_timestamp
Timestamp of the first available trade in Kaiko's data set.
trade_end_time
Time of the last available trade in Kaiko's data set. null if instrument is still active
trade_end_timestamp
Timestamp of the last available trade in Kaiko's data set. null if instrument is still active
trade_count
The total number of trades available through Kaiko Rest API and Kaiko Stream. For active pairs, this is an approximation.
trade_compressed_size
Approximate size in bytes of all available trades in Kaiko Stream.
list_pools
The list of the underlying pools to each instrument. (Only when arg with_list_pools=true is provided).
solana
apr
Daily APR
4.758636
validators
Number of validators
777
methodology
The methodology used to compute the APR
epoch_aggregate_v1
The height of the block.
328800011
timestamp
The timestamp of the block.
1742793063000000000
user_address
The address on which the row is focused.
CsVdJ8WH8Q9eHSTRpwtwN3TYApm24QnLKYUMNxJ3DaED
transaction_hash
Transaction hash.
syJFDzPJJ92GLsXqYXUKEY23e8uoLPAdgci7Ko9cUYZxvCvf5SHdKnYuC1Jh7UrTSzRc2EpUB7kzCwGd2qdTnKD
transaction_type
Event type. See more information below.
transfer
transaction_index
The index of the transaction.
15
ordinal
Index of the event.
5
sender_address
The address that sends tokens or coins.
2AXXcN6oN9bBT5owwmTH53C7QHUXvhLeu718Kqt8rvY2
receiver_address
The address that receives tokens or coins.
CsVdJ8WH8Q9eHSTRpwtwN3TYApm24QnLKYUMNxJ3DaED
token_symbol
Symbol of the token or coin transferred
SOL
token_address
The address of the token or coin transferred.
So11111111111111111111111111111111111111112
direction
Inflow or outflow from the user_address.
out
amount
Amount of asset transferred.
3.697694466
amount_usd
Amount of asset transferred in usd.
513.02619
balance_after
Wallet balance for the user_address for this asset.
2816.119373498
balance_after_usd
Wallet balance for the user_address for this asset in usd.
390714.54077
The amount of gas purchased by the initiator to execute the transaction.
No
Number of snapshots to return data for.
See
Default: 100
Maximum: 1000
10
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
asc
start_time
No
Starting time in ISO 8601 (inclusive).
2025-01-01T00:00:00.000Z
end_time
No
Ending time in ISO 8601 (exclusive).
2025-01-04T00:00:00.000Z
1742169600000000000
total_trades
The total number of long & short liquidation events.
703
total_amount
The total value of the long & short liquidations, expressed in USD.
4493384.579834212
long_trades
The total number of long liquidations.
275
long_amount
The total value of the long liquidations, expressed in USD
920343.8155558605
short_trades
The total number of short liquidations.
428
short_amount
The total value of the short liquidations, expressed in USD.
3573040.764278351
exchanges
A breakdown per exchange of the requested data
-
exchange
The specific exchange.
bbit
total_trades
The total number of long & short liquidation events for the specific exchange.
400
total_amount
The total value of the long & short liquidations for the specific exchange, expressed in USD.
2441098.7305411045
long_trades
The total number of long liquidations for the specific exchange.
131
long_amount
The total value of the long liquidations for the specific exchange, expressed in USD
303823.495563143
short_trades
The total number of short liquidations for the specific exchange.
269
short_amount
The total value of the short liquidations for the specific exchange, expressed in USD.
2137275.2349779615
Choose between eu and us.
asset
Yes
Base asset. See
interval
No
The interval parameter is suffixed with h or d to specify hours or days, respectively. Any arbitrary value between one hour and one day can be used, as long as it sums up to a maximum of 1 day.
Default: 1h
1h
interval_time
Timestamp at which the interval begins in a readable format.
2025-03-17T00:00:00.000Z
interval_timestamp
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/liquidation.v1/token/eth?interval=1h&start_time=2025-01-31T09:00:01Z&end_time=2025-02-27T23:59:59Z&page_size=2'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
asset = "eth"
# ---- Optional parameters ---- #
interval = "1h"
sort = "desc"
page_size = 2
start_time = "2025-04-11T00:00:00.000Z"
end_time = "2025-04-12T00:00:00.000Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_liquidation_data(api_key: str, asset: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/liquidation.v1/token/{asset}'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
print(f"Response status code: {e.response.status_code if hasattr(e, 'response') else 'N/A'}")
print(f"Response text: {e.response.text if hasattr(e, 'response') else 'N/A'}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_liquidation_data(
api_key=api_key,
asset=asset,
start_time=start_time,
end_time=end_time,
interval=interval,
sort=sort,
page_size=page_size
)
{
"query": {
"request_time": "2025-04-04T12:09:55.546Z",
"query_start_time": "2025-01-31T09:00:01Z",
"query_end_time": "2025-02-27T23:59:59Z",
"data_start_time": "2025-01-31T09:00:00Z",
"data_end_time": "2025-02-28T00:00:00Z",
"start_time": "2025-02-27T22:00:00Z",
"start_timestamp": 1740693600000,
"end_time": "2025-02-28T00:00:00Z",
"end_timestamp": 1740700800000,
"page_size": 2,
"sort": "desc",
"token": "eth",
"interval": "1h",
"commodity": "liquidationEvents",
"data_version": "v1"
},
"answer_time": "2025-04-04T12:09:55.574Z",
"answer_timestamp": 1743768595574,
"access": {
"access_range": {
"start_timestamp": 1688428800000,
"end_timestamp": 2177539199000
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
},
"data": [
{
"interval_time": "2025-02-27T23:00:00Z",
"interval_timestamp": 1740697200000000000,
"total_trades": 40,
"total_amount": 474520.3599480028,
"long_trades": 2,
"long_amount": 11062.85615080547,
"short_trades": 38,
"short_amount": 463457.50379719737,
"exchanges": [
{
"exchange": "bbit",
"total_trades": 17,
"total_amount": 281481.78156436956,
"long_trades": 0,
"long_amount": 0,
"short_trades": 17,
"short_amount": 281481.78156436956
},
{
"exchange": "okex",
"total_trades": 23,
"total_amount": 193038.57838363323,
"long_trades": 2,
"long_amount": 11062.85615080547,
"short_trades": 21,
"short_amount": 181975.72223282777
}
]
},
/*---*/
"continuation_token": "4AQYBmrXFXrfMgzPkwxZmPNbc7WvZ1vVyZfqFXgjH9iCzvLnGZMMQTLoXwGdCLrB3DXwBVD9eSh2BjdpvsKGeWx9cBQfVc88qsDr64eCyNCNguwka8DLYbtT9F57FxpMFzrFyCTqiHMGBqdJsRj4K51oD2RmMK9oXwEB4o6VpQDWFvG3W5ndFJT13Uxvyycw41hgU2xDs6KTqSpzPrqmCwdeMzX2L71FUrhziwv7VXp9Txwz8Jac6wjGEJZpxYG7C3tF48YMN7hoSUvrXco9VxoDDpdSfduib8wtHjhjGV1re4z4CKBj6FcLakVvvVV1HoJLzpNbf7yMJZdyrTKXRYec6b",
"next_url": "https://us.market-api.kaiko.io/v2/data/liquidation.v1/token/eth?continuation_token=4AQYBmrXFXrfMgzPkwxZmPNbc7WvZ1vVyZfqFXgjH9iCzvLnGZMMQTLoXwGdCLrB3DXwBVD9eSh2BjdpvsKGeWx9cBQfVc88qsDr64eCyNCNguwka8DLYbtT9F57FxpMFzrFyCTqiHMGBqdJsRj4K51oD2RmMK9oXwEB4o6VpQDWFvG3W5ndFJT13Uxvyycw41hgU2xDs6KTqSpzPrqmCwdeMzX2L71FUrhziwv7VXp9Txwz8Jac6wjGEJZpxYG7C3tF48YMN7hoSUvrXco9VxoDDpdSfduib8wtHjhjGV1re4z4CKBj6FcLakVvvVV1HoJLzpNbf7yMJZdyrTKXRYec6b"
}page_size
Timestamp at which the interval begins. In milliseconds.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
(min: 1, default: 100, max: 100000). See Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
Automatically included in continuation tokens.
Level 1 & Level 2 Data [Level 2 Tick-Level]
CeFi derivative ticker packs.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
continuation_token
No
See Pagination
end_time
No
timestamp
Timestamp at which the interval begins.
price
VWAP. null when no trades reported.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/vwap'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/vwap'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size){
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "vwap",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:52:36.988Z"
},
"time": "2020-11-12T16:52:37.114Z",
"timestamp": 1605199957114,
"data": [
{
"timestamp": 1605139200000,
"price": "15879.385939106618"
},
{
"timestamp": 1605052800000,
"price": "15664.643871798791"
},
/* ... */
],
"result": "success",
"continuation_token": "55qoNvASfrVdCIjrF8Ygw6TVJ4yamzUyeL9QXAmvWZZur3iaKoPcVBW1V4unNJi2zMjojbsYr9Pgt9XFCUpnAiuBiECm8X4cedvYc9t2WxHXnHKjgAp2wRAeV8ZPUSj8WNgpWTCBVymGaQZPj3oMDZwVeCPyuTLFdVPfTXVjZA94BtHeBmghoPv92JtWxN3yRvCkrw79hJBu",
"next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/vwap?continuation_token=55qoNvASfrVdCIjrF8Ygw6TVJ4yamzUyeL9QXAmvWZZur3iaKoPcVBW1V4unNJi2zMjojbsYr9Pgt9XFCUpnAiuBiECm8X4cedvYc9t2WxHXnHKjgAp2wRAeV8ZPUSj8WNgpWTCBVymGaQZPj3oMDZwVeCPyuTLFdVPfTXVjZA94BtHeBmghoPv92JtWxN3yRvCkrw79hJBu",
"access": {
"access_range": {
"start_timestamp": 1546300800000,
"end_timestamp": 1577836800000
},
"data_range": {
"start_timestamp": 1417391000000,
"end_timestamp": 1577836800000
}
}
}Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
Choose between eu and us.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
end_time
No
timestamp
The timestamp provided by the exchange or the collection timestamp in Unix Timestamp (in nanoseconds)
trade_id
Unique trade ID (unique to the exchange). In case the exchange does not provide an ID, we generate it ourselves.
price
blockchain
The blockchain on which the trade happened.
transaction_hash
Transaction hash.
log_index
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = "100"
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-01-01T00:03:00Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/trades'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size)){
"query": {
"page_size": 100,
"exchange": "bfnx",
"instrument_class": "spot",
"instrument": "btc-usd",
"sort": "desc",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:33:20.575Z"
},
"time": "2020-11-12T16:33:20.869Z",
"timestamp": 1605198800869,
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
},
"data": [
{
"timestamp": 1605198775855,
"trade_id": "522419198",
"price": "16026",
"amount": "0.025",
"taker_side_sell": true
},
{
"timestamp": 1605198775031,
"trade_id": "522419197",
"price": "16026",
"amount": "0.01",
"taker_side_sell": true
},
/* ... */
],
"result": "success",
"continuation_token": "rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"next_url": "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?continuation_token=rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH"
}https://{region}.market-api.kaiko.io/v3/data/trades.v1/exchanges/{exchange}/spot/{instrument}/tradesregion
You can use this same endpoint to get data for all market types. Kaiko subscriptions are sold per market type.
Yes
{
"query": {
"page_size": 100,
"exchange": "bfnx",
"instrument_class": "spot",
"instrument": "btc-usd",
"sort": "desc",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:33:20.575Z"
},
"time": "2020-11-12T16:33:20.869Z",
"timestamp": 1605198800869,
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
},
"data": [
{
"timestamp": 1605198775855,
"trade_id": "522419198",
"price": "16026",
"amount": "0.025",
"taker_side_sell": true
},
{
"timestamp": 1605198775031,
"trade_id": "522419197",
"price": "16026",
"amount": "0.01",
"taker_side_sell": true
},
/* ... */
],
"result": "success",
"continuation_token": "rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"next_url": "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?continuation_token=rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH"
}Level 1 & Level 2 Data [Level 1 Aggregations Tier]
Level 1 & Level 2 Data [Level 1 Tick-Level Tier]
Level 1 & Level 2 Data [Level 2 Aggregations Tier]
This endpoint retrieves the Trade Count, OHLCV and VWAP history for any instrument on an exchange. The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. By making use of the sort parameter, data can be returned in ascending asc (default) or descending desc order.
You can use this same endpoint to get data for all market types. Kaiko subscriptions are sold per market type.
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/spot/{instrument}/aggregations/count_ohlcv_vwapTrade Count and OHLCV can be accessed through Google BigQuery. To get started, read our guide.
This endpoint retrieves the Trade Count, OHLCV and VWAP history for any instrument on an exchange. The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. By making use of the sort parameter, data can be returned in ascending asc (default) or descending desc order.
Trade Count and OHLCV can be accessed through Google BigQuery. To get started, read our guide.
Kaiko Fair Market Value [Established Assets]
Kaiko Fair Market Value [Full Coverage]
This endpoint calculates a synthetic price when there is no liquidity (historic trades) between two assets (fiat or digital). Let's say, for example, there was no liquidity between NEXO and GBP, but you need a price. To calculate this, the liquidity engine will use a series of intermediary assets where there is liquidity (lots of trading history) to calculate the price for NEXO > GBP. To demonstrate how this calculation works, the engine might take the price for NEXO > BTC (where there is plenty of liquidity) and then the price of BTC > GBP (where there is also lots of liquidity) and combine the two to determine a robust synthetic price for NEXO > GBP. The engine will always use the path of highest liquidity, meaning several intermediary assets might be used.
Read the full methodology here.
When using a synthetic price, in order to to meet IFRS-compliance standards, any fiat currency value should be requested in USD and converted using the .
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v2/spot_exchange_rate/{base_asset}/{quote_asset}Market Explorer [Assets + Exchanges]
Market Explorer [Full Coverage]
This endpoint receives information on the trades involving a particular asset. Information includes volumes, trade counts, liquidity, and supply. All information is broken down by exchange. Trade data is aggregated across all instruments that include the specified token as a base or quote asset, whereas liquidity data is aggregated for the base asset only.
https://us.market-api.kaiko.io/v2/data/analytics.v2/asset_metricsasset
Information from this endpoint can be accessed through Google BigQuery. To get started, read our .
Kaiko Fair Market Value [Established Assets]
Kaiko Fair Market Value [Full Coverage]
This endpoint returns a price calculation for a specific pair by aggregating prices from our Trade Data.
Read the full methodology here.
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/robust_pair_price/{base_asset}/{quote_asset}base_asset
Yes
Level 1 & Level 2 Data [Level 2 Tick-Level]
DeFi spot ticker packs.
This endpoint includes event data related to the addition (mint) and removal (burn) of tokens from a liquidity pool.
Read our DEX liquidity event data methodology here.
https://eu.market-api.kaiko.io/v2/data/liquidity.v1/eventsLevel 1 & Level 2 Data [Level 2 Aggregations]
Level 1 & Level 2 Data [Level 2 Tick-Level]
DeFi lending & borrowing ticker packs.
This indicates the amount of each token available for trading in a liquidity pool, identified through its blockchain pool address. A separate endpoint provides this data specifically for Uniswap V3 liquidity pools.
Read our DEX liquidity snapshot data methodology here.
https://us.market-api.kaiko.io/v2/data/liquidity.v1/snapshotsLevel 1 & Level 2 Data [Level 1 Tick-Level Tier]
Level 1 & Level 2 Data [Level 2 Aggregations Tier]
Level 1 & Level 2 Data [Level 2 Tick-Level Tier]
Tick-level data is the most granular level of trading data and contains every single trade that occurs on centralized and decentralized exchanges. The data is normalized and timestamped and contains information such as the price and volume of each trade. For DEXs specifically, we also provide additional information on the user address, the blockchain, the pool address, and the transaction hash related to the trade.
https://{region}.market-api.kaiko.io/v3/data/trades.v1/exchanges/{exchange}/spot/{instrument}/tradesregion
Yes
Level 1 & Level 2 Data [Level 1 Aggregations Tier]
Level 1 & Level 2 Data [Level 1 Tick-Level Tier]
Level 1 & Level 2 Data [Level 2 Aggregations Tier]
This endpoint retrieves the OHLCV history for an instrument on an exchange.
You can use this same endpoint to get data for all market types. Kaiko subscriptions are sold per market type.
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/spot/{instrument}/aggregations/ohlcvregion
Yes
Choose between eu and us.
Information from this endpoint can be accessed through Google BigQuery. To get started, read our .
Derivatives Risk endpoint
This endpoint returns exchange-provided metrics such as open interest, funding rates, and option greeks.
This endpoint retrieves the OHLCV history for an instrument on an exchange.
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
page_size
No
See Pagination Automatically included in continuation tokens.
continuation_token
No
See Pagination
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc.
Price displayed in quote currency.
amount
Quantity of asset bought or sold (can be in base_asset, quote_asset or the number of contracts).
taker_side_sell
The log index of the event (in base 10).
pool_address
The address of the pool in which the trade happened.
user_address
Trader address (beneficiary).
Yes
Instrument class.
See
instrument
Yes
Instrument code.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
See Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
Automatically included in continuation tokens.
high
Highest price during interval. null when no trades reported.
low
Lowest price during interval. null when no trades reported.
close
Closing price of interval. null when no trades reported.
volume
Volume traded in interval. 0 when no trades reported.
price
The volume weighted price during the time interval. null when no trades reported.
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
See Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
Automatically included in continuation tokens.
high
Highest price during interval. null when no trades reported.
low
Lowest price during interval. null when no trades reported.
close
Closing price of interval. null when no trades reported.
volume
Volume traded in interval. 0 when no trades reported.
price
The volume weighted price during the time interval. null when no trades reported.
Level 1 & Level 2 Data [Level 2 Tick-Level Tier]
CeFi spot ticker packs.
region
Yes
Choose between eu and us.
exchange
Yes
Exchange code.
See
continuation_token
No
See
end_time
No
timestamp
Timestamp at which the interval begins.
count
The number of trades. 0 when no trades reported.
open
region
Yes
Choose between eu and us.
exchange
Yes
continuation_token
No
See
end_time
No
timestamp
Timestamp at which the interval begins.
count
The number of trades. 0 when no trades reported.
open
You can use this same endpoint to get data for all market types. Kaiko subscriptions are sold per market type.
instrument_class
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
Opening price of interval. null when no trades reported.
Exchange code.
See
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
Opening price of interval. null when no trades reported.
price
Trading activity
Average price in usd. null when no trades are reported.
0.1699233217119519
total_volume_usd
Trading activity
Total volume in usd traded in the interval.
0 when no trades are reported.
30508181.43789653
total_volume_asset
Trading activity
Total volume in number of assets traded in the interval.
0 when no trades are reported.
179540872.49784896
total_trade_count
Trading activity
The total amount of trades reported during the interval.
0 when no trades are reported.
159684
total_off_chain_volume_usd
Trading activity
Total off-chain volume in usd traded in the interval.
0 when no trades are reported.
30038710.382665947
total_off_chain_volume_asset
Trading activity
Total off-chain volume in number of assets traded in the interval.
0 when no trades are reported.
176778031.87949985
total_off_chain_trade_count
Trading activity
The total amount of trades reported off-chain during the interval.
0 when no trades are reported.
159115
trades_data
Trading activity
List of volume in usd, volume in number of assets and total amount of trades by centralized exchange.
[{"exchange": "binc",
"volume_usd": 27539301.29722444,
"volume_asset": 162068991,
"trade_count": 125188}, ...]
total_on_chain_volume_usd
Trading activity
Total on-chain volume in usd traded in the interval. 0 when no trades are reported.
1036710779.1918713
total_on_chain_volume_asset
Trading activity
Total on-chain volume in number of assets traded in the interval.
0 when no trades are reported.
1036710779.1918713
total_on_chain_trade_count
Trading activity
The total amount of trades reported on-chain during the interval.
0 when no trades are reported.
20513
trades_data
Trading activity
List of volume in usd, volume in number of assets and total amount of trades by decentralized exchange.
[{'exchange': 'blc2',
'volume_usd': 673716.6525764248,
'volume_asset': 674153.2032810001,
'trade_count': 129}, ...]
market_depth
Liquidity information
Dictionary from 0.1% to 10% market depth. Base asset aggregation only.
blockchain
Token information
Blockchain name.
ethereum
token_address
Token information
Token address.
0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
number_of_holders
Token information
Total amount of holders.
1622286
main_holders
Token information
List of addesses holding at least 1% of the total supply and the amounts of tokens.
[{'address': '0x0a59649758aa4d66e25f08dd01271e891fe52199',
'amount': 3262712000,
'percentage': 7.91745}, ...]
total_supply
Token information
Blockchain total supply.
0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Yes
The desired asset code.
See
agix
start_time
Yes
Starting time in ISO 8601 (inclusive).
2023-01-25T00:00:00.000Z
end_time
Yes
Ending time in ISO 8601 (exclusive).
2023-01-26T00:00:00.000Z
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
boolean. If true, returns trading information and market depths detailed by exchanges as well as main holders.
Default: false
page_size
No
See Pagination
Minimum: 1
Maximum: 100
Default: 10
100
timestamp
Trading activity
Timestamp at which the interval begins.
2023-01-25T00:00:00.000Z
For any field in the "token information" category, we only cover ERC-20 tokens. Only 50 tokens have been backfilled, but we can add more on demand.
type
Event type: mint or burn.
burn or mint
pool_name
Name of the pool as it is written on the blockchain.
USDC-WETH-0.001
pool_address
Address of the contract of the pool.
0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640
exchange
Code of the DEX.
usp3
transaction_hash
Transaction hash
0x3d28ec9f35692ee6e9264735cd4f92c48bccda82487144d26ebc12376a418cdc
log_index
The log index of the transaction (in base 10)
152
user_address
Address that triggered the transaction.
0x479bc00624e58398f4cf59d78884d12fb515790a
price
Price of the token at the moment of the event.
0.000358096
amounts
Amounts of the tokens
See example
datetime
Timestamp at which the interval begins. In seconds.
1650441900
metadata
Only for Uniswap v3. Upper and lower ticker of the interval on which the liquidity is provided
{"lower_ticker": 190650, "upper_ticker": 195610}
blockchain
No
Should be one of the currently supported blockchains. See
ethereum
protocol
No
Filter on a currently supported DEX.
usp2
pool_address
No
Pool address related to the liquidity event. Default: all liquidity pools.
0x14de8287adc90f0f95bf567c0707670de52e3813
pool_contains
No
Mints and burns including the requested token. Default: all available tokens.
weth or weth,usdt,usdc
block_number
No
Block height.
129876
user_addresses
No
Filter on specific user addresses (comma separated).
0x479bc**
live
No
Shows the data as soon as the block is validated.
(Default: false, in case of block reorganization).
true
tx_hash
No
Filter on a specific transaction hash.
0xe68b84740**
start_block
No
Starting block height (inclusive).
129870
end_block
No
Ending block height (inclusive).
130000
start_time
No
Starting time in ISO 8601 (inclusive).
2022-04-01T00:00:00.000Z
end_time
No
Ending time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
sort
No
Returns the data in ascending asc or descending desc order.
Default: desc.
asc
type
No
Event type. By default both burn and mint are shown.
burn or mint
page_size
No
Number of snapshots to return data for. (default: 1000, min: 1, max: 1000). See Pagination
500
blockchain
The blockchain on which the transaction happened.
ethereum
block_number
The height of the block in which the transaction happened.
129876
pool_name
Name of the pool as it is written on the blockchain.
WETH-USDT
pool_address
Address of the contract of the pool.
0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852
exchange
Code of the DEX.
usp2
amounts
Snapshot of the liquidity pool's tokens.
See example
datetime
Timestamp at which the interval begins. In seconds.
1650441900
blockchain
No
Should be one of the currently supported blockchains. See
ethereum
pool_address
Yes
Pool address.
0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852
live
No
Shows the data as soon as the block is validated. (Default: false, in case of block reorganization).
true
start_block
No
Starting block height (inclusive).
19645000
end_block
No
Ending block height (inclusive).
19645010
start_time
No
Starting time in ISO 8601 (inclusive).
2022-04-01T00:00:00.000Z
end_time
No
Ending time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
sort
No
Returns the data in ascending (asc) or descending (desc) order. Default: desc.
asc
page_size
No
Number of snapshots to return data for. (default: 1000, min: 1, max: 1000). See Pagination
100
blockchain
The blockchain on which the transaction happened.
ethereum
block_number
The height of the block.
129876
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap'```python
##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/count_ohlcv_vwap'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
res = requests.get(data['next_url'], headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size)
```{
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "count_ohlcv_vwap",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:55:42.588Z"
},
"time": "2020-11-12T16:55:42.710Z",
"timestamp": 1605200142710,
"data": [
{
"timestamp": 1605139200000,
"open": "15705.79",
"high": "16185.87",
"low": "15446.82",
"close": "16139.93",
"volume": "14829.124546730012",
"price": "15880.01873841608",
"count": 95111
},
{
"timestamp": 1605052800000,
"open": "15315.46",
"high": "16000",
"low": "15293.04",
"close": "15705.79",
"volume": "15123.844197729988",
"price": "15664.643871798791",
"count": 114205
},
/* ... */
],
"result": "success",
"continuation_token": "rbd1XbkjMwv2SyUfvJwsqFGmCKzg3WToTvqigui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap?continuation_token=rbd1XbkjMwv2SyUfvJwsui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"access": {
"access_range": {
"start_timestamp": 1546300800000,
"end_timestamp": 1577836800000
},
"data_range": {
"start_timestamp": 1417391000000,
"end_timestamp": 1577836800000
}
}
}
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/spot/{instrument}/aggregations/count_ohlcv_vwapcurl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap'```python
##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/count_ohlcv_vwap'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
res = requests.get(data['next_url'], headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size)
```{
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "count_ohlcv_vwap",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:55:42.588Z"
},
"time": "2020-11-12T16:55:42.710Z",
"timestamp": 1605200142710,
"data": [
{
"timestamp": 1605139200000,
"open": "15705.79",
"high": "16185.87",
"low": "15446.82",
"close": "16139.93",
"volume": "14829.124546730012",
"price": "15880.01873841608",
"count": 95111
},
{
"timestamp": 1605052800000,
"open": "15315.46",
"high": "16000",
"low": "15293.04",
"close": "15705.79",
"volume": "15123.844197729988",
"price": "15664.643871798791",
"count": 114205
},
/* ... */
],
"result": "success",
"continuation_token": "rbd1XbkjMwv2SyUfvJwsqFGmCKzg3WToTvqigui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap?continuation_token=rbd1XbkjMwv2SyUfvJwsui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"access": {
"access_range": {
"start_timestamp": 1546300800000,
"end_timestamp": 1577836800000
},
"data_range": {
"start_timestamp": 1417391000000,
"end_timestamp": 1577836800000
}
}
}
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/asset_metrics?interval=1d&asset=agix&start_time=2023-01-25T00:00:00.000Z&end_time=2023-01-26T00:00:00.000Z&page_size=100&sources=true'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/asset_metrics"
# Start of mandatory parameter configuration
mandatory_params = {
"asset": "agix",
"start_time": "2024-08-27T13:13:53.441Z",
"end_time" : "2024-09-27T13:27:53.441Z",
"interval" : "1d",
}
# 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)}"){
"data": [
{
"timestamp": "2023-01-25T00:00:00.000Z",
"price": 0.1699233217119519,
"total_volume_usd": 30508181.43789653,
"total_volume_asset": 179540872.49784896,
"total_trade_count": 159684,
"off_chain_liquidity_data": {
"total_off_chain_volume_usd": 30038710.382665947,
"total_off_chain_volume_asset": 176778031.87949985,
"total_off_chain_trade_count": 159115,
"trade_data": [
{
"exchange": "binc",
"volume_usd": 27539301.29722444,
"volume_asset": 162068991,
"trade_count": 125188
},
/* ... */
],
"buy_market_depths": [
{
"exchange": "binc",
"volume_assets": {
/* ... */
},
"volume_usds": {
/* ... */
}
},
/* ... */
],
"sell_market_depths": [
{
"exchange": "binc",
"volume_assets": {
/* ... */
},
"volume_usds": {
/* ... */
}
},
/* ... */
],
"total_buy_market_depth": {
"volume_assets": {
/* ... */
},
"volume_usds": {
/* ... */
}
},
"total_sell_market_depth": {
"volume_assets": {
/* ... */
},
"volume_usds": {
/* ... */
}
}
},
"on_chain_liquidity_data": {
"total_on_chain_volume_usd": 2762840.6183491,
"total_on_chain_volume_asset": 2762840.6183491,
"total_on_chain_trade_count": 569,
"trades_data": [
{
"exchange": "usp2",
"volume_usd": 327680.4492221988,
"volume_asset": 1928401.8575017697,
"trade_count": 448
},
/* ... */
],
"token_information": [
{
"blockchain": "ethereum",
"token_address": "0x5B7533812759B45C2B44C19e320ba2cD2681b542",
"nb_of_holders": 38231,
"main_holders": [
{
"address": "0xf977814e90da44bfa03b6295a0616a897441acec",
"amount": 250774980,
"percentage": 22.61839
},
{
"address": "0x13e1367a455c45aa736d7ff2c5656ba2bd05ad46",
"amount": 112149660,
"percentage": 10.11522
},
/* ... */
],
"total_supply": 1108721700
}
]
}
}
]
}
curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
"https://eu.market-api.kaiko.io/v2/data/liquidity.v1/events"##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
blockchain = "ethereum"
protocol = "usp2"
pool_address = None
pool_contains = "weth"
block_number = None
user_addresses = None
live = "false"
tx_hash = None
start_block = None
end_block = None
start_time = "2025-03-05T13:00:00Z"
end_time = None
sort = "asc"
type = "burn"
page_size = 500
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, blockchain: str, protocol: str, pool_address: str, pool_contains: str, block_number: int, user_addresses: str, live: str, tx_hash: str, start_block: int, end_block: int, start_time: str, end_time: str, sort: str, type: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://eu.market-api.kaiko.io/v2/data/liquidity.v1/events'
params = {
"blockchain": blockchain,
"protocol": protocol,
"pool_address": pool_address,
"pool_contains": pool_contains,
"block_number": block_number,
"user_addresses": user_addresses,
"live": live,
"tx_hash": tx_hash,
"start_block": start_block,
"end_block": end_block,
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"type": type,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, blockchain=blockchain, protocol=protocol, pool_address=pool_address, pool_contains=pool_contains, block_number=block_number, user_addresses=user_addresses, live=live, tx_hash=tx_hash, start_block=start_block, end_block=end_block, start_time=start_time, end_time=end_time, sort=sort, type=type, page_size=page_size)
print (df){
"query": {
"blockchain": "*",
"exchange": "*",
"pool_address": "0x7bea39867e4169dbe237d55c8242a8f2fcdcc387",
"block_number": "*",
"type": "*",
"user_addresses": "*",
"tx_hash": "*",
"start_time": "2022-04-01 00:00:00 +0000 UTC",
"end_time": "2022-05-01 00:00:00 +0000 UTC",
"sort": "descending",
"pool_contains": "*",
"page_size": "1000"
},
"time": "2022-05-17T14:26:27.274Z",
"timestamp": 1652797587,
"data": [
{
"blockchain": "ethereum",
"block_number": 14682526,
"type": "mint",
"pool_name": "USDC-WETH-0.010",
"pool_address": "0x7bea39867e4169dbe237d55c8242a8f2fcdcc387",
"exchange": "usp3",
"transaction_hash": "0x02127cbf00c43fff6a1ec381703e66035b975e49f901ade55f1b12652e07b544",
"log_index": 187,
"user_address": "0x3cbd83d4a4ee504bf8b78d9c2927a9f22f27cce5",
"price": 0.0003564194488230487,
"amounts": [
{"symbol": "USDC", "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "amount": 31.063585},
{"symbol": "WETH", "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "amount": 0.5833806413127403}
],
"datetime": 1651280001,
"metadata": {"lower_ticker": 192600, "upper_ticker": 197000}
}
/* ... */
],
"continuation_token": "xxx",
"next_url": "https://eu.market-api.kaiko.io/v2/data/liquidity.v1/events?continuation_token=xxx"
}curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: KAIKO_API_KEY' \
'https://us.market-api.kaiko.io/v2/data/liquidity.v1/snapshots?pool_address=0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852&start_block=129870&end_block=129880'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
pool_address = "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852"
# ---- Optional parameters ---- #
blockchain = "ethereum"
live = "false"
start_block = "129870"
end_block = "129880"
start_time = None
end_time = None
sort = "desc"
page_size = 100
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, pool_address: str, blockchain: str, live: str, start_block: str, end_block: str, start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://eu.market-api.kaiko.io/v2/data/liquidity.v1/snapshots'
params = {
"pool_address": pool_address,
"blockchain": blockchain,
"live": live,
"start_block": start_block,
"end_block": end_block,
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, pool_address=pool_address, blockchain=blockchain,
live=live, start_block=start_block, end_block=end_block,
start_time=start_time, end_time=end_time, sort=sort,
page_size=int(page_size)){
"query": {
"blockchain": "ethereum",
"protocol": "*",
"pool_address": "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852",
"start_block": "*",
"end_block": "*",
"start_time": "*",
"end_time": "*",
"live": "false",
"sort": "descending",
"page_size": "100",
"live": "false"
},
"time": "2025-03-31T11:16:39.168Z",
"timestamp": 1743419799,
"data": [
{
"block_number": "22166374",
"pool_name": "WETH-USDT",
"pool_address": "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852",
"exchange": "usp2",
"price": 0.000553562,
"amounts":
[
{
"symbol": "WETH",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"amount": 3005.5794298594374
},
{
"symbol": "USDT",
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"amount": 5389884.464753
}
],
"datetime": 1743417755,
"blockchain": "ethereum"
},
...
],
"continuation_token": "xxx",
"next_url": "https://us.market-api.kaiko.io/v2/data/liquidity.v1/snapshots?continuation_token=xxx"
}interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
See
Page size limits differ by the interval selected:
Less than or equal to 1m
Default: 10, Max: 100
1m to 1h
sort
No
Return the data in ascending (asc) or descending (desc) order. Default is desc.
Automatically included in continuation tokens.
include_exchanges
No
List of exchanges' code to include in the calculation.
Default is all exchanges.
Automatically included in continuation tokens.
exclude_exchanges
No
List of exchanges' code to exclude in the calculation.
Automatically included in continuation tokens.
extrapolate_missing_values
No
When true, if there are any null (missing) prices for the calculation, they will be filled in using the last available price from the window requested. This is useful for assets that don't have a lot of trades or for data that is collected very frequently.
However, if the parameter is set to true and no prices were available in that window, a null value will still be returned.
sources
No
When true, the response includes the intermediary pair price details used to calculate the price.
Default: false
enable_price_metrics
No
When true, the response includes a price_metrics object containing the stress_market_indicator, a standardized metric indicating how fragmented or stressed the market is at a given point in time.
price_metrics
Contains ci_left and ci_right , the lower and upper bounds of the 99% confidence interval around the direct price. And the stress_market_indicator.
base_asset
Yes
The desired base asset code.
See
quote_asset
Yes
The desired quote asset code.
See
start_time
No
Start time in ISO 8601 (exclusive). Automatically included in continuation tokens.
end_time
No
timestamp
Timestamp at which the interval begins.
price
Aggregated Robust Weighted Median using liquidity path engine.
null when no trades reported, except if extrapolate_missing_values is true.
Liquidity path is calculated every 4 hours seeking for the most liquid pairs to convert from base asset to quote asset.
extrapolate_missing_values
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v2/spot_exchange_rate/dash/usd?interval=1m&extrapolate_missing_values=true&start_time=2023-05-03T00:01:00.000Z&end_time=2023-05-04T00:00:00.000Z'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
base_asset = "btc"
quote_asset = "usd"
# ---- Optional parameters ---- #
interval = "1h"
sort = "desc"
page_size = 4
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-01-01T23:59:59Z"
include_exchanges = None
exclude_exchanges = None
extrapolate_missing_values = None
sources = None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, base_asset: str, quote_asset: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int, include_exchanges: list = None, exclude_exchanges: list = None, extrapolate_missing_values: bool = None, sources: bool = None):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v2/spot_exchange_rate/{base_asset}/{quote_asset}'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval,
"include_exchanges": include_exchanges,
"exclude_exchanges": exclude_exchanges,
"extrapolate_missing_values": extrapolate_missing_values,
"sources": sources
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, base_asset=base_asset, quote_asset=quote_asset, interval=interval, start_time=start_time, end_time=end_time, sort=sort, page_size=page_size, include_exchanges=include_exchanges, exclude_exchanges=exclude_exchanges, extrapolate_missing_values=extrapolate_missing_values, sources=sources)
print (df){
"query": {
"start_time": "2023-05-03T00:01:00Z",
"end_time": "2023-05-04T00:00:00Z",
"page_size": 10,
"base_asset": "dash",
"quote_asset": "usd",
"interval": "1m",
"sort": "desc",
"sources": false,
"include_exchanges": [],
"exclude_exchanges": [],
"data_version": "v1",
"commodity": "trades",
"request_time": "2024-07-11T08:10:21.828Z",
"instruments": [
"bbsp:spot:btc-usdt",
"bfnx:spot:btc-usdt",
"bgon:spot:btc-usdt",
"binc:spot:btc-usdt",
"bnus:spot:btc-usdt",
"bull:spot:btc-usdt",
"cbse:spot:btc-usdt",
"cnex:spot:btc-usdt",
"gmni:spot:btc-usdt",
"kcon:spot:btc-usdt",
"krkn:spot:btc-usdt",
"okex:spot:btc-usdt",
"stmp:spot:btc-usdt",
"bfnx:spot:dash-btc",
"binc:spot:dash-btc",
"cbse:spot:dash-btc",
"cnex:spot:dash-btc",
"yobt:spot:dash-btc",
"bfnx:spot:usdt-usd",
"bnus:spot:usdt-usd",
"cbse:spot:usdt-usd",
"gmni:spot:usdt-usd",
"krkn:spot:usdt-usd",
"stmp:spot:usdt-usd"
],
"start_timestamp": 1683157800000,
"end_timestamp": 1683158400000,
"extrapolate_missing_values": true
},
"time": "2024-07-11T08:10:21.891Z",
"timestamp": 1720685421891,
"data": [
{
"timestamp": 1683158340000,
"price": "49.263380298334226",
"extrapolated": false
},
{
"timestamp": 1683158280000,
"price": "49.24160302106242",
"extrapolated": false
},
/*...*/
],
"result": "success",
"continuation_token": "AV2cWacBUPR8PvJTwoHZtPBUSEuqNYcv2iNgL96oZpT6MqqGc6ajQo7XM66wySCwViwNjs9C8Gu1xS2rRwGMrCT6rCRxFDCFnnKusyGFo34HkuY7Em7KqgpSzNADLhciV7w5UPeJrvm6cDgTnsaKVUgLMpj2ZioT",
"next_url": "https://us.market-api.kaiko.io/v2/data/trades.v2/spot_exchange_rate/dash/usd?continuation_token=AV2cWacBUPR8PvJTwoHZtPBUSEuqNYcv2iNgL96oZpT6MqqGc6ajQo7XM66wySCwViwNjs9C8Gu1xS2rRwGMrCT6rCRxFDCFnnKusyGFo34HkuY7Em7KqgpSzNADLhciV7w5UPeJrvm6cDgTnsaKVUgLMpj2ZioT",
"access": {
"access_range": {
"start_timestamp": 1262995200000,
"end_timestamp": 2186006399000
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
true if the value has been extrapolated from the last computed value available, false if not.
end_time
No
Ending time in ISO 8601 (exclusive) Automatically included in continuation tokens.
page_size
No
See
Page size limits differ by the interval selected:
Less than or equal to 1m
Default: 10, Max: 100
1m to 1h
sort
No
Return the data in ascending (asc) or descending (desc) order. Default is desc.
include_exchanges
No
List of exchanges' code to include in the calculation.
Default is all exchanges.
Automatically included in continuation tokens.
exclude_exchanges
No
List of exchanges' code to exclude in the calculation.
Automatically included in continuation tokens.
extrapolate_missing_values
No
When true, if there are any null (missing) prices for the calculation, they will be filled in using the last available price from the window requested. This is useful for assets that don't have a lot of trades or for data that is collected very frequently.
However, if the parameter is set to true and no prices were available in that window, a null value will still be returned.
enable_price_metrics
No
When true, the response includes a price_metrics object containing the stress_market_indicator, a standardized metric indicating how fragmented or stressed the market is at a given point in time.
count
Total amount of trades reported during the interval.
0 when no trades are reported, except if extrapolate_missing_values is true.
extrapolate_missing_values
true if the value has been extrapolated from the last computed value available, false if not.
price_metrics
Contains ci_left and ci_right , the lower and upper bounds of the 99% confidence interval around the direct price. And the stress_market_indicator.
The desired base asset code.
See
quote_asset
Yes
The desired quote asset code.
See
sort
No
Return the data in ascending (asc) or descending (desc) order. Default is desc.
interval
Yes
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 24h.
start_time
No
timestamp
Timestamp at which the interval begins.
price
RWM Robust Weighted Median.
null when no trades reported, except if extrapolate_missing_values is true
volume
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/robust_pair_price/btc/eth?interval=1m&extrapolate_missing_values=true&start_time=2023-05-03T00:01:00.000Z&end_time=2023-05-04T00:00:00.000Z'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
base_asset = "btc"
quote_asset = "usd"
interval = "1h"
# ---- Optional parameters ---- #
sort = "desc"
page_size = 4
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-01-01T23:59:59Z"
include_exchanges = None
exclude_exchanges = None
extrapolate_missing_values = None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, base_asset: str, quote_asset: str, interval: str, start_time: str, end_time: str, sort: str, page_size: int, include_exchanges: list = None, exclude_exchanges: list = None, extrapolate_missing_values: bool = None):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/robust_pair_price/{base_asset}/{quote_asset}'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval,
"include_exchanges": include_exchanges,
"exclude_exchanges": exclude_exchanges,
"extrapolate_missing_values": extrapolate_missing_values
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, base_asset=base_asset, quote_asset=quote_asset, interval=interval, start_time=start_time, end_time=end_time, sort=sort, page_size=page_size, include_exchanges=include_exchanges, exclude_exchanges=exclude_exchanges, extrapolate_missing_values=extrapolate_missing_values)
print (df){
"query": {
"start_time": "2023-05-03T23:50:00Z",
"end_time": "2023-05-04T00:00:00Z",
"base_asset": "btc",
"quote_asset": "eth",
"interval": "1m",
"sort": "desc",
"sources": false,
"page_size": 10,
"include_exchanges": [],
"exclude_exchanges": [],
"request_time": "2024-07-11T07:39:11.34695219Z",
"data_version": "v1",
"commodity": "trades",
"extrapolate_missing_values": true,
"instruments": [
"bbsp:spot:eth-btc",
"bfly:spot:eth-btc",
"bfnx:spot:eth-btc",
"bgon:spot:eth-btc",
"binc:spot:eth-btc",
"bnus:spot:eth-btc",
"bull:spot:eth-btc",
"cbse:spot:eth-btc",
"cnex:spot:eth-btc",
"kcon:spot:eth-btc",
"krkn:spot:eth-btc",
"lmax:spot:eth-btc",
"okex:spot:eth-btc",
"stmp:spot:eth-btc",
"yobt:spot:eth-btc"
]
},
"time": "2024-07-11T07:39:11.430101692Z",
"timestamp": 1720683551,
"data": [
{
"timestamp": 1683158340000,
"price": "15.236109727862226",
"volume": "10.661977267122458",
"count": 263,
"extrapolate_missing_values": false
},
{
"timestamp": 1683158280000,
"price": "15.226897227981592",
"volume": "26.42011153624422",
"count": 184,
"extrapolate_missing_values": false
},
/*...*/
],
"result": "success",
"continuation_token": "V7Dxo9XotwyC1qQtT6Dkaq3fhY8jFqzmgjwkALFWdZQ4JHWoUQFrDaTw8Zc4yCY4Cf863uPBY4phumdqcjoL4imnx5amnLJCZP3rr7dDBw2EC33kpYtsRPsmx1sVW2tfp5pUh72fP9gYrhHzzQpGAz5PKFFwiTuHT921xT1ajG8EV9aRibXxs69PLGwnfH6WD5iw4SAc58c7ZF8PafYgb34APyYC1",
"next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/robust_pair_price/btc/eth?continuation_token=V7Dxo9XotwyC1qQtT6Dkaq3fhY8jFqzmgjwkALFWdZQ4JHWoUQFrDaTw8Zc4yCY4Cf863uPBY4phumdqcjoL4imnx5amnLJCZP3rr7dDBw2EC33kpYtsRPsmx1sVW2tfp5pUh72fP9gYrhHzzQpGAz5PKFFwiTuHT921xT1ajG8EV9aRibXxs69PLGwnfH6WD5iw4SAc58c7ZF8PafYgb34APyYC1",
"access": {
"access_range": {
"start_timestamp": 1262995200000,
"end_timestamp": 2186006399000
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
Total volume in base asset traded in the interval.
0 when no trades are reported, except if extrapolate_missing_values is true.
page_size
No
See Automatically included in continuation tokens.
continuation_token
No
See
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc.
amount
Quantity of asset bought or sold (can be in base_asset, quote_asset or the number of contracts).
taker_side_sell
See
Choose between eu and us.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
end_time
No
timestamp
The timestamp provided by the exchange or the collection timestamp in Unix Timestamp (in milliseconds)
trade_id
Unique trade ID (unique to the exchange). In case the exchange does not provide an ID, we generate it ourselves.
price
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = "100"
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-01-01T00:03:00Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/trades'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size)){
"query": {
"page_size": 100,
"exchange": "bfnx",
"instrument_class": "spot",
"instrument": "btc-usd",
"sort": "desc",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:33:20.575Z"
},
"time": "2020-11-12T16:33:20.869Z",
"timestamp": 1605198800869,
"data": [
{
"timestamp": 1605198775855,
"trade_id": "522419198",
"price": "16026",
"amount": "0.025",
"taker_side_sell": true
},
{
"timestamp": 1605198775031,
"trade_id": "522419197",
"price": "16026",
"amount": "0.01",
"taker_side_sell": true
},
/* ... */
],
"result": "success",
"continuation_token": "rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?continuation_token=rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}{
"query": {
"page_size": 100,
"exchange": "bfnx",
"instrument_class": "spot",
"instrument": "btc-usd",
"sort": "desc",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:33:20.575Z"
},
"time": "2020-11-12T16:33:20.869Z",
"timestamp": 1605198800869,
"data": [
{
"timestamp": 1605198775855,
"trade_id": "522419198",
"price": "16026",
"amount": "0.025",
"taker_side_sell": true
},
{
"timestamp": 1605198775031,
"trade_id": "522419197",
"price": "16026",
"amount": "0.01",
"taker_side_sell": true
},
/* ... */
],
"result": "success",
"continuation_token": "rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?continuation_token=rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
Price displayed in quote currency.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
(min: 1, default: 100, max: 100000). See Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive).
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
Automatically included in continuation tokens.
low
Lowest price during interval. null when no trades reported.
close
Closing price of interval. null when no trades reported.
volume
Volume traded in interval. 0 when no trades reported.
Level 1 & Level 2 Data [Level 2 Tick-Level Tier]
CeFi spot ticker packs.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
continuation_token
No
timestamp
Timestamp at which the interval begins.
open
Opening price of interval. null when no trades reported.
high
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/ohlcv'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/ohlcv'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size){
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "ohlcv",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-05-26T17:25:56.221Z"
},
"time": "2020-05-26T17:26:00.160Z",
"timestamp": 1590513960160,
"data": [
{
"timestamp": 1590451200000,
"open": "8900.0",
"high": "9016.99",
"low": "8694.23",
"close": "8811.36",
"volume": "9014.60281966"
},
{
"timestamp": 1590364800000,
"open": "8715.69",
"high": "8977.0",
"low": "8632.93",
"close": "8899.31",
"volume": "12091.06145914"
},
/* ... */
],
"result": "success",
"continuation_token": "rbd2bcDp35GmDscQbvZ9YzQHZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
"next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/krkn/spot/btc-usd/aggregations/ohlcv?continuation_token=rbd2bcDp35GmDqdfaz3fZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}
See
Highest price during interval. null when no trades reported.
exchange
Yes
Should be one of the exchanges currently supported
okex
instrument_class
timestamp
Timestamp at which the interval begins. In milliseconds.
1650441900000
24h_volume
The volume of the trades executed in the last 24 hours (can be in base_asset, quote_asset or the number of contracts)
timestamp
Timestamp at which the interval begins. In milliseconds.
1650441900000
24h_volume
The volume of the trades executed in the last 24 hours (can be in base_asset, quote_asset or the number of contracts)
timestamp
Timestamp at which the interval begins. In milliseconds.
1650441900000
24h_volume
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/derivatives.v2/risk?exchange=okex&instrument_class=perpetual-future&instrument=btc-usdt&page_size=2'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "okex"
instrument_class = "perpetual-future"
instrument = "btc-usdt"
# ---- Optional parameters ---- #
interval = "1h"
sort = "desc"
page_size = 100
start_time= None
end_time= None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, instrument_class: str, instrument: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/derivatives.v2/risk'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval,
"exchange": exchange,
"instrument_class": instrument_class,
"instrument": instrument
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, instrument_class=instrument_class, instrument=instrument, interval=interval, start_time=start_time, end_time=end_time, sort=sort, page_size=page_size)
print (df)Information from this endpoint can be accessed through Google BigQuery. To get started, read our .
https://{eu/us}.market-api.kaiko.io/v2/data/derivatives.v2/riskregion
Yes
Choose between eu and us.
{
"query": {
"page_size": "2",
"exchange": "okex",
"instrument_class": "perpetual-future",
"instrument": "btc-usdt",
"sort": "desc",
"data_version": "v2",
"commodity": "derivatives",
"request_time": "2022-04-28T10:17:48.180Z"
},
"time": "2022-04-28T10:17:48.698Z",
"timestamp": 1651141068698,
"data": [
{
"timestamp": 1651141020000,
"24h_volume": "10428503",
"open_interest": "1084816",
"funding_rate": "-0.0001225804461251",
"predicted_funding_rate": "-0.0000652655998942"
},
{
"timestamp": 1651140960000,
"24h_volume": "10423219",
"open_interest": "1086823",
"funding_rate": "-0.0001225804461251",
"predicted_funding_rate": "-0.0000654154039082"
},
],
/* ... */
"access": {
"access_range": {
"start_timestamp": 1646006400,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
continuation_token
No
timestamp
Timestamp at which the interval begins.
open
Opening price of interval. null when no trades reported.
high
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/ohlcv'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/ohlcv'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size)Information from this endpoint can be accessed through Google BigQuery. To get started, read our .
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/spot/{instrument}/aggregations/ohlcvregion
Yes
Choose between eu and us.
exchange
{
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "ohlcv",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-05-26T17:25:56.221Z"
},
"time": "2020-05-26T17:26:00.160Z",
"timestamp": 1590513960160,
"data": [
{
"timestamp": 1590451200000,
"open": "8900.0",
"high": "9016.99",
"low": "8694.23",
"close": "8811.36",
"volume": "9014.60281966"
},
{
"timestamp": 1590364800000,
"open": "8715.69",
"high": "8977.0",
"low": "8632.93",
"close": "8899.31",
"volume": "12091.06145914"
},
/* ... */
],
"result": "success",
"continuation_token": "rbd2bcDp35GmDscQbvZ9YzQHZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
"next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/krkn/spot/btc-usd/aggregations/ohlcv?continuation_token=rbd2bcDp35GmDqdfaz3fZJkT3jdeFx9fSBDdVmcCZaHvQRTCTfmfQ6QCrvDNp5ciRRuGPTedVL5LMZv1qmSXhRpZFbpvBW2uA62RSYpfJ1hVykJKZfhtmXXrxz",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}
Level 1 & Level 2 Data [Level 1 Aggregations]
Level 1 & Level 2 Data [Level 1 Tick-Level]
Level 1 & Level 2 Data [Level 2 Aggregations]
This endpoint retrieves the Trade Count, OHLCV and VWAP history for any instrument on an exchange. The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. By making use of the sort parameter, data can be returned in ascending asc (default) or descending desc order.
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{instrument}/aggregations/count_ohlcv_vwapTrade Count and OHLCV can be accessed through Google BigQuery. To get started, read our guide.
This endpoint retrieves the Trade Count, OHLCV and VWAP history for any instrument on an exchange. The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. By making use of the sort parameter, data can be returned in ascending asc (default) or descending desc order.
Trade Count and OHLCV can be accessed through Google BigQuery. To get started, read our guide.
This endpoint provides details of the contracts, including base asset, quote asset, contract size, contract size unit, listing_timestamp, expiry, strike price, and underlying index.
This endpoint receives information on the trades involving a particular stablecoin. Information includes volumes, trade counts, liquidity, supply and lending rates. Trade and liquidity data are aggregated across all instruments that include the specified token as a base or quote asset.
Yes
future, perpetual-future, or option
future
instrument
Yes
Instrument code.
See
One instrument returned per query.
btcusdt250117
interval
No
Interval period (can be one of 1m, 1h, 4h, and 1d). Default 1m
When you query data using aninterval greater than one minute, we'll return the data from the last minute of that time period. For example, if you query data for 09:00 with the interval set at 1h, we'll return data from 09:59 (since that's the last minute of the 09:00-10:00 hour period).
1h
page_size
No
Number of snapshots to return data for. (default: 100, min: 1, max: 1000). See Pagination
10
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
asc
start_time
No
Starting time in ISO 8601 (inclusive).
2025-01-01T00:00:00.000Z
end_time
No
Ending time in ISO 8601 (exclusive).
2025-01-04T00:00:00.000Z
5270648
open_interest
The total outstanding number of contracts (units in which open interest metrics are quoted vary by exchange)
1127623
funding_rate
The current funding rate.
-0.0000756735759807
predicted_funding_rate
The predicted funding rate for the next period.
-0.0000845044644161
5270648
open_interest
The total outstanding number of contracts (units in which open interest metrics are quoted vary by exchange)
1127623
time_to_expiry
The number of minutes remaining before expiry.
41504
nearby
The soonest expiring contract with the same base & quote asset on the specified exchange
boolean value
quarterly_nearby
The soonest expiring quarterly contract with the same base & quote asset on the specified exchange
boolean value
settlement_price
Settlement price calculated at the end of the trading day for the contract.
106610
settlement_timestamp
Time of calculated settlement price.
0.0065
The volume of the trades executed in the last 24 hours (can be in base_asset, quote_asset or the number of contracts)
5270648
open_interest
The total outstanding number of contracts (units in which open interest metrics are quoted vary by exchange)
1127623
time_to_expiry
The number of minutes remaining before expiry.
41504
nearby
The soonest expiring contract with the same base & quote asset on the specified exchange
boolean value
quarterly_nearby
The soonest expiring quarterly contract with the same base & quote asset on the specified exchange
boolean value
ask_iv
Implied volatility for the best ask.
57.5
bid_iv
Implied volatility for the best bid.
65.4
mark_iv
The implied volatility for the mark price.
69.42
delta
The delta value for the option.
0.8841
gamma
The gamma value for the option.
0.00003
rho
The rho value for the option.
21.26122
theta
The theta value for the option.
-26.18193
vega
The vega value for the option.
2.36321
settlement_price
Settlement price calculated at the end of the trading day for the contract.
106610
settlement_timestamp
Time of calculated settlement price.
0.0065
See Pagination
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
(min: 1, default: 100, max: 100000). See Pagination Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive).
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
Automatically included in continuation tokens.
Highest price during interval. null when no trades reported.
low
Lowest price during interval. null when no trades reported.
close
Closing price of interval. null when no trades reported.
volume
Volume traded in interval. 0 when no trades reported.
410More than 1h
Default: 1, Max: 4
Automatically included in continuation tokens.
410More than 1h
Default: 1, Max: 4
Automatically included in continuation tokens.
Yes
Instrument class.
See
instrument
Yes
Instrument code.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
See Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
Automatically included in continuation tokens.
high
Highest price during interval. null when no trades reported.
low
Lowest price during interval. null when no trades reported.
close
Closing price of interval. null when no trades reported.
volume
Volume traded in interval. 0 when no trades reported.
price
The volume weighted price during the time interval. null when no trades reported.
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
See Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
Automatically included in continuation tokens.
high
Highest price during interval. null when no trades reported.
low
Lowest price during interval. null when no trades reported.
close
Closing price of interval. null when no trades reported.
volume
Volume traded in interval. 0 when no trades reported.
price
The volume weighted price during the time interval. null when no trades reported.
Level 1 & Level 2 Data [Level 2 Tick-Level]
DeFi spot ticker packs.
region
Yes
Choose between eu and us.
exchange
Yes
Exchange code.
See
continuation_token
No
See
end_time
No
timestamp
Timestamp at which the interval begins.
count
The number of trades. 0 when no trades reported.
open
region
Yes
Choose between eu and us.
exchange
Yes
continuation_token
No
See
end_time
No
timestamp
Timestamp at which the interval begins.
count
The number of trades. 0 when no trades reported.
open
instrument_class
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
Opening price of interval. null when no trades reported.
Exchange code.
See
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
Opening price of interval. null when no trades reported.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap'```python
##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/count_ohlcv_vwap'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
res = requests.get(data['next_url'], headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size)
```{
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "count_ohlcv_vwap",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:55:42.588Z"
},
"time": "2020-11-12T16:55:42.710Z",
"timestamp": 1605200142710,
"data": [
{
"timestamp": 1605139200000,
"open": "15705.79",
"high": "16185.87",
"low": "15446.82",
"close": "16139.93",
"volume": "14829.124546730012",
"price": "15880.01873841608",
"count": 95111
},
{
"timestamp": 1605052800000,
"open": "15315.46",
"high": "16000",
"low": "15293.04",
"close": "15705.79",
"volume": "15123.844197729988",
"price": "15664.643871798791",
"count": 114205
},
/* ... */
],
"result": "success",
"continuation_token": "rbd1XbkjMwv2SyUfvJwsqFGmCKzg3WToTvqigui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap?continuation_token=rbd1XbkjMwv2SyUfvJwsui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"access": {
"access_range": {
"start_timestamp": 1546300800000,
"end_timestamp": 1577836800000
},
"data_range": {
"start_timestamp": 1417391000000,
"end_timestamp": 1577836800000
}
}
}
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{instrument}/aggregations/count_ohlcv_vwapcurl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap'```python
##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/count_ohlcv_vwap'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
res = requests.get(data['next_url'], headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size)
```{
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "count_ohlcv_vwap",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:55:42.588Z"
},
"time": "2020-11-12T16:55:42.710Z",
"timestamp": 1605200142710,
"data": [
{
"timestamp": 1605139200000,
"open": "15705.79",
"high": "16185.87",
"low": "15446.82",
"close": "16139.93",
"volume": "14829.124546730012",
"price": "15880.01873841608",
"count": 95111
},
{
"timestamp": 1605052800000,
"open": "15315.46",
"high": "16000",
"low": "15293.04",
"close": "15705.79",
"volume": "15123.844197729988",
"price": "15664.643871798791",
"count": 114205
},
/* ... */
],
"result": "success",
"continuation_token": "rbd1XbkjMwv2SyUfvJwsqFGmCKzg3WToTvqigui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap?continuation_token=rbd1XbkjMwv2SyUfvJwsui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"access": {
"access_range": {
"start_timestamp": 1546300800000,
"end_timestamp": 1577836800000
},
"data_range": {
"start_timestamp": 1417391000000,
"end_timestamp": 1577836800000
}
}
}
exchange
Yes
Should be one of the exchanges currently supported
okex
instrument_class
exchange
The exchange where the specified instrument is being traded
binc
instrument_class
Shows whether the specified instrument is future, perpetual-future or option
exchange
The exchange where the specified instrument is being traded
okex
instrument_class
Shows whether the specified instrument is future, perpetual-future or option
exchange
The exchange where the specified instrument is being traded
drbt
instrument_class
Shows whether the specified instrument is future, perpetual-future or option
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/derivatives.v2/reference?exchange=drbt&instrument_class=option&base_assets=btc&page_size=50'```python##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "okex"
instrument_class = "future"
# ---- Optional parameters ---- #
instrument = None
base_assets = None
quote_assets = "btc"
option_type = None
min_strike = None
max_strike = None
start_time = None
end_time = None
page_size = 500
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, instrument_class: str, instrument: str, base_assets: str, quote_assets: str, option_type: str, min_strike: int, max_strike: int, start_time: str, end_time: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/derivatives.v2/reference'
params = {
"exchange": exchange,
"instrument_class": instrument_class,
"instrument": instrument,
"base_assets": base_assets,
"quote_assets": quote_assets,
"option_type": option_type,
"min_strike": min_strike,
"max_strike": max_strike,
"start_time": start_time,
"end_time": end_time,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, instrument_class=instrument_class, instrument=instrument, base_assets=base_assets, quote_assets=quote_assets, option_type=option_type, min_strike=min_strike, max_strike=max_strike, start_time=start_time, end_time=end_time, page_size=page_size)
print (df)Searching for contracts (Deribit exchange only). You can get a list of all the futures or options that can be traded between two specific times by using the start_time and end_time settings. For instance, if you're interested in all the futures or options that can be traded between October 1, 2022, and October 2, 2022, you would set start_time as 2022-10-01T00:00:00.000Z and end_time as 2022-10-03T00:00:00.000Z. If you want to find futures or options that were traded at a specific time, simply use the same time for both start_time and end_time. If you only provide one of the start_time or end_time, the other one will be automatically determined as shown in the table below.
Given
Given
start_time (ISO 8601) and end_time (ISO 8601) are the specified datetime respectively
Given
Not given
https://<eu|us>.market-api.kaiko.io/v2/data/derivatives.v2/referenceregion
Yes
Choose between eu and us.
{
"query": {
"exchange": "drbt",
"instrument_class": "option",
"base_assets": [
"btc"
],
"page_size": "50",
"data_version": "v2",
"commodity": "derivatives",
"request_time": "2022-11-30T15:26:49.66Z"
},
"time": "2022-11-30T15:26:55.623Z",
"timestamp": 1669822015623,
"data": [
{
"exchange": "drbt",
"instrument_class": "option",
"instrument": "btc10apr204750c",
"base": "btc",
"quote": "usd",
"contract_size": "1",
"contract_size_unit": "btc",
"listing_timestamp": "2020-03-28 03:21:00 UTC",
"expiry": "2020-04-10 08:00:00 UTC",
"strike_price": "4750",
"underlying_index": "SYN.BTC-10APR20"
},
/*---*/
],
"result": "success",
"continuation_token": "VHoT1C16LjCmtrfParGdwd4mVJnV1Qaqx5AMgXWsYawuiw68Qfymdf215NBcg9LzPJNxA9cZsBjB5S8JBHd8Giw2qoFDFvJ1tP3M5",
"next_url": "https://us.market-api.kaiko.io/v2/data/derivatives.v2/reference?continuation_token=VHoT1C16LjCmtrfParGdwd4mVJnV1Qaqx5AMgXWsYawuiw68Qfymdf215NBcg9LzPJNxA9cZsBjB5S8JBHd8Giw2qoFDFvJ1tP3M5",
"access": {
"access_range": {
"start_timestamp": 1646006400000,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}usdc
start_time
No
Starting time in ISO 8601 (inclusive).
2023-01-25T00:00:00.000Z
end_time
No
Ending time in ISO 8601 (exclusive).
2023-01-26T00:00:00.000Z
page_size
No
See
Minimum: 1
Maximum: 30
Default: 10
30
timestamp
Trading activity
Timestamp at which the interval begins.
2026-06-18T00:00:00Z
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/stablecoin_metrics?asset=usdc&sort=desc'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/stablecoin_metrics"
# Start of mandatory parameter configuration
mandatory_params = {
"asset": "usdc",
}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
#"start_time": "2024-08-27T13:13:53.441Z",
#"end_time" : "2024-09-27T13:27:53.441Z",
#"interval" : "1d",
"sort":"desc",
}
# 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)}")https://us.market-api.kaiko.io/v2/data/analytics.v2/stablecoin_metricsasset
Yes
The desired stablecoin asset code.
See
{
"result": "success",
"time": "2026-06-18T08:06:26Z",
"timestamp": 1781769986999,
"query":
{
"asset": "usdc",
"end_time": "0001-01-01T00:00:00Z",
"interval": "1d",
"page_size": "10",
"request_time": "2026-06-18T08:06:26.05808401Z",
"sort": "desc",
"start_time": "0001-01-01T00:00:00Z"
},
"data":
[
{
"timestamp": "2026-06-18T00:00:00Z",
"interval": "1d",
"asset": "usdc",
"price": 0.9997000899730081,
"total_volume_usd": 796218091.3924453,
"total_trade_count": 2000097,
"cex_volume_usd": 694548754.6376011,
"cex_trade_count": 1910473,
"dex_volume_usd": 101669336.75484413,
"dex_trade_count": 89624,
"supply_circulating": 70051396209.43329,
"market_cap": 70030387093.3053,
"supply_change": -317149147.036026,
"avg_weighted_defi_lending_yield": 0.030345222539145098,
"avg_weighted_defi_borrowing_rate": 0.03869062376513863,
"total_defi_deposited": 2321449893.228165,
"total_defi_borrowed": 2030740561.2581594,
"aggregated_buy_market_depth_asset": {
"bid_volume_0_1": 410009275.917108,
"bid_volume_0_2": 446428495.09170324,
"bid_volume_0_5": 470849445.02862155,
"bid_volume_1": 510576781.129591,
"bid_volume_2": 549239689.7563232,
"bid_volume_5": 549239689.7563232,
"bid_volume_10": 629913837.648892
},
"aggregated_buy_market_depth_usd": {
"bid_volume_0_1": 409964211.9019009,
"bid_volume_0_2": 446379428.24938184,
"bid_volume_0_5": 470797694.08590573,
"bid_volume_1": 510520663.765471,
"bid_volume_2": 549179322.9617518,
"bid_volume_5": 599292340.4341673,
"bid_volume_10": 629844603.9792498
},
"aggregated_sell_market_depth_asset": {
"ask_volume_0_1": 311924899.9123604,
"ask_volume_0_2": 327273471.225558,
"ask_volume_0_5": 354299107.9406383,
"ask_volume_1": 386901697.77497196,
"ask_volume_2": 407012117.6172724,
"ask_volume_5": 447660372.5945285,
"ask_volume_10": 470660113.3308416
},
"aggregated_sell_market_depth_usd": {
"ask_volume_0_1": 311890616.3259667,
"ask_volume_0_2": 327237500.6815961,
"ask_volume_0_5": 354260167.01582044,
"ask_volume_1": 386859173.5077997,
"ask_volume_2": 406967383.0189715,
"ask_volume_5": 447611170.35686433,
"ask_volume_10": 470608383.197524
}
},
/* ALL RESULTS HERE */
],
"continuation_token": "xxx",
"next_url": "https://us.market-api.kaiko.io/v2/data/analytics.v2/stablecoin_metrics?continuation_token=xxx",
"links":
{
"next": "/v2/data/analytics.v2/stablecoin_metrics?asset=usdc&end_time=2026-06-09T00%3A00%3A00Z&sort=desc"
},
"access":
{
"access_range":
{
"start_timestamp": 1073001600000,
"end_timestamp": 1861830000000
},
"data_range":
{
"start_timestamp": "None",
"end_timestamp": 1861830000000
}
}
}The IV Smile endpoint lets you calculate volatility on a minute-by-minute basis from options market prices. The endpoint returns a volatility curve for a specific expiry date.
You can get volatility estimates by providing the following information:
Strikes
Forward-log-moneyness
Deltas
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.
Yes
future, perpetual-future, or option
future
instrument
No
Instrument code.
See
ethusd220624, btc*220624, *usdt, btc*may22*
base_assets
No
For finding the instruments with the certain base asset
btc, eth
quote_assets
No
For finding the instruments with the certain quote asset
usd, usdt
option_type
No
option only. For finding either only the call options or put options
C, P
min_strike
No
option only. Used to retrieve options whose strike price is above this minimum value (exclusive/inclusive)
10000
max_strike
No
option only. Used to retrieve options whose strike price is below this maximum value (exclusive/inclusive)
90000
start_time
Deribit exchange only
No
future & option only. Used to retrieve futures and options that expire after this date and time (inclusive)
2022-06-23T00:01:00.000Z
end_time
Deribit exchange only
No
future & option only. Used to retrieve futures and options that are listed before this date and time (exclusive)
2022-06-25T23:59:00.000Z
page_size
No
Number of snapshots to return data for. (default: 1000, min: 1, max: 1000). See
500
perpetual-future
instrument
The specified instrument
btc-usdc
base
The base asset of the instrument
btc
quote
The unit in which the instrument is quoted
usdc
contract_size
Size of the contract
1
contract_size_unit
Unit in which contract is denominated
btc
listing_timestamp
Date listed by exchange
2024-01-03 12:30:00 UTC
funding_rate_frequency
Interval at which the funding rate is paid
8h
future
instrument
The specified instrument
btcusdt250117
base
The base asset of the instrument
btc
quote
The unit in which the instrument is quoted
usdt
contract_size
Size of the contract
0.01
contract_size_unit
Unit in which contract is denominated
btc
listing_timestamp
The timestamp when a certain option instrument is listed on the exchange
2025-01-03 08:10:00 UTC
expiry
Expiration date of the contract
2025-01-17 08:00:00 UTC
option
instrument
The specified instrument
btc10dec21100000c
base
The base asset of the instrument
btc
quote
The unit in which the instrument is quoted
usd
contract_size
Size of the contract
1
contract_size_unit
Unit in which contract is denominated
btc
listing_timestamp
The timestamp when a certain option instrument is listed on the exchange
2021-11-18 08:16:00 UTC
expiry
Expiration date of the contract
2021-12-10 08:00:00 UTC
strike_price
The strike price of the contract in USD.
30000
underlying_index
Name of the underlying asset
BTC-10DEC21
end_time (ISO 8601) = start_time (ISO 8601) + 1 day
Not given
Given
start_time (ISO 8601) = end_time (ISO 8601) - 1 day
Not given
Not given
all the instruments will be shown regardless of dates
interval
Informations
The aggregation interval.
1d
asset
Informations
The specified asset.
usdc
price
Trading activity
Average price in usd. null when no trades are reported.
0.9997000899730081
total_volume_usd
Trading activity
Total volume in usd traded in the interval.
0 when no trades are reported.
796218091.3924453
total_trade_count
Trading activity
The total amount of trades reported during the interval.
0 when no trades are reported.
2000097
cex_volume_usd
Trading activity
Total off-chain volume in usd traded in the interval.
0 when no trades are reported.
694548754.6376011
cex_trade_count
Trading activity
The total amount of trades reported off-chain during the interval.
0 when no trades are reported.
1910473
dex_volume_usd
Trading activity
Total on-chain volume in usd traded in the interval. 0 when no trades are reported.
101669336.75484413
dex_trade_count
Trading activity
The total amount of trades reported on-chain during the interval.
0 when no trades are reported.
89624
supply_circulating
Supply
Blockchain total supply.
70051396209.43329
market_cap
Supply
The market cap of the stablecoin across all chains.
70030387093.3053
supply_change
Supply
The change in supply since the last interval.
-317149147.036026
avg_weighted_defi_lending_yield
DeFi lending
Average of all lending yields across DeFi lending protocols, weighted by deposited liquidity.
0.030345222539145098
avg_weighted_defi_borrowing_rate
DeFi lending
Average of all borrowing rate across DeFi lending protocols, weighted by deposited liquidity.
0.03869062376513863
total_defi_deposited
DeFi lending
Total deposited liquidity across DeFi lending protocols.
2321449893.228165
total_defi_borrowed
DeFi lending
Total borrowed liquidity across DeFi lending protocols.
2030740561.2581594
aggregated_buy_market_depth_asset
Liquidity information
Dictionary from 0.1% to 10% market depth.
See example response below.
aggregated_buy_market_depth_usd
Liquidity information
Dictionary from 0.1% to 10% market depth.
See example response below.
aggregated_sell_market_depth_asset
Liquidity information
Dictionary from 0.1% to 10% market depth.
See example response below.
aggregated_sell_market_depth_usd
Liquidity information
Dictionary from 0.1% to 10% market depth.
See example response below.
Currently supported assets and exchanges:
BTC, ETH, SOL, and XRP on Deribit.
BTC, ETH on OKX.
BTC, ETH on Deribit & OKX (aggregated).
If you need data from other exchanges, we can add them on request.
Read our Implied Volatility Methodology here.
region
Yes
Choose between eu and us.
base
Yes
The desired base as the underlying of the options. See supported assets above.
btc, eth
value_time
The time in parameter
2022-09-20T16:15:00.000Z
expiry
The expiry in parameter
Use this example to calculate IV using deltas.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_smile?base=btc"e=usd&value_time=2024-06-07T12:00:00.000Z&expiry=2024-06-28T00:00:00.000Z&exchanges=drbt&deltas=0.25,0.5,0.75'Use this example to calculate IV using forward log moneyness.
https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_smile?base=btc"e=usd&exchanges=drbt,okex&value_time=2024-09-12T10:00:00.000Z&expiry=2024-09-27T08:00:00.000Z&forward_log_moneynesses=-1,-0.5,0,0.5,1Use this example to calculate IV using strikes.
https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_smile?base=btc"e=usd&exchanges=drbt&value_time=2024-09-12T10:00:00.000Z&expiry=2024-09-27T08:00:00.000Z&strikes=30000,50000,60000,70000,90000Use this example to calculate IV using deltas
##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
base = "btc"
quote = "usd"
value_time = "2024-06-07T12:00:00.000Z"
expiry = "2024-06-28T00:00:00.000Z"
deltas = "0.25,0.5,0.75"
# ---- Optional parameters ---- #
exchanges = "drbt"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, base: str, quote: str, value_time: str, expiry: str, deltas: str, exchanges: str = None):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_smile'
params = {
"base": base,
"quote": quote,
"value_time": value_time,
"expiry": expiry,
"deltas": deltas,
"exchanges": exchanges
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, base=base, quote=quote, value_time=value_time, expiry=expiry, deltas=deltas, exchanges=exchanges)
print (df)Use this example to calculate IV using forward log moneyness
##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
base = "btc"
quote = "usd"
value_time = "2022-09-20T16:15:00.000Z"
expiry = "2022-12-30T08:00:00.000Z"
forward_log_moneynesses = "-1,-0.5,0,0.5,1"
# ---- Optional parameters ---- #
exchanges = "drbt"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, base: str, quote: str, value_time: str, expiry: str, forward_log_moneynesses: str, exchanges: str = None):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_smile'
params = {
"base": base,
"quote": quote,
"value_time": value_time,
"expiry": expiry,
"forward_log_moneynesses": forward_log_moneynesses,
"exchanges": exchanges
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, base=base, quote=quote, value_time=value_time, expiry=expiry, forward_log_moneynesses=forward_log_moneynesses, exchanges=exchanges)
print (df)Use this example to calculate IV using forward log moneyness
##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
base = "btc"
quote = "usd"
value_time = "2022-09-20T16:15:00.000Z"
expiry = "2022-12-30T08:00:00.000Z"
strikes = "10000,15000,20000"
# ---- Optional parameters ---- #
exchanges = "drbt"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, base: str, quote: str, value_time: str, expiry: str, strikes: str, exchanges: str = None):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_smile'
params = {
"base": base,
"quote": quote,
"value_time": value_time,
"expiry": expiry,
"strikes": strikes,
"exchanges": exchanges
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, base=base, quote=quote, value_time=value_time, expiry=expiry, strikes=strikes, exchanges=exchanges)
print (df){
"query": {
"base": "btc",
"quote": "usd",
"exchanges": [
"drbt",
"okex"
],
"value_time": "2024-06-07T12:00:00.000Z",
"expiry": "2024-06-28T00:00:00.000Z",
"data_version": "v2",
"commodity": "analytics",
"request_time": "2024-06-24T12:30:09.700Z",
"sources": "false"
},
"time": "2024-06-24T12:30:10.147Z",
"data": [
{
"value_time": "2024-06-07T12:00:00.000Z",
"expiry": "2024-06-28T00:00:00.000Z",
"time_to_expiry": 0.056164383561643834,
"implied_volatilities": [
{
"strike": 72853.3324003775,
"forward_log_moneyness": 0.007321081822738051,
"implied_volatility": 0.5105897940662363,
"delta": 0.5,
"gamma": 0.000045971145294598765,
"current_spot": 71717,
"interest_rate": 0.14954983972466698
},
{
"strike": 79392.23132701412,
"forward_log_moneyness": 0.09327332815155387,
"implied_volatility": 0.5335098490669691,
"delta": 0.25,
"gamma": 0.00003504506121504308,
"current_spot": 71717,
"interest_rate": 0.14954983972466698
},
{
"strike": 67169.33106494324,
"forward_log_moneyness": -0.07391043269308284,
"implied_volatility": 0.5076566142080143,
"delta": 0.75,
"gamma": 0.000036829787686483384,
"current_spot": 71717,
"interest_rate": 0.14954983972466698
}
]
}
],
"exchanges": [
"drbt",
"okex"
]
}
{
"query": {
"base": "btc",
"quote": "usd",
"exchanges": [
"drbt",
"okex"
],
"value_time": "2024-09-12T10:00:00.000Z",
"expiry": "2024-09-27T08:00:00.000Z",
"data_version": "v2",
"commodity": "analytics",
"request_time": "2024-09-16T10:08:13.297Z",
"sources": "false"
},
"time": "2024-09-16T10:08:13.510Z",
"data": [
{
"value_time": "2024-09-12T10:00:00.000Z",
"expiry": "2024-09-27T00:00:00.000Z",
"time_to_expiry": 0.03995433789954338,
"implied_volatilities": [
{
"strike": 21393.433382294108,
"forward_log_moneyness": -1,
"implied_volatility": 1.333640363610205,
"delta": 0.9999487436462999,
"gamma": 1.3636212810241294E-8,
"current_spot": 58033.01112255454,
"interest_rate": 0.051859643540835755
},
{
"strike": 35271.80867069449,
"forward_log_moneyness": -0.5,
"implied_volatility": 0.9596570717413877,
"delta": 0.9965589532046168,
"gamma": 9.298329941261203E-7,
"current_spot": 58033.01112255454,
"interest_rate": 0.051859643540835755
},
{
"strike": 58153.381211439206,
"forward_log_moneyness": 0,
"implied_volatility": 0.5101368982713104,
"delta": 0.5203310896967671,
"gamma": 6.732894295644585E-5,
"current_spot": 58033.01112255454,
"interest_rate": 0.051859643540835755
},
{
"strike": 95878.71656643301,
"forward_log_moneyness": 0.5,
"implied_volatility": 0.8386751286583922,
"delta": 0.0018731164887705876,
"gamma": 6.140349526013891E-7,
"current_spot": 58033.01112255454,
"interest_rate": 0.051859643540835755
},
{
"strike": 158077.27941050686,
"forward_log_moneyness": 1,
"implied_volatility": 1.1585659255535645,
"delta": 1.3207614779298105E-5,
"gamma": 4.342680303635139E-9,
"current_spot": 58033.01112255454,
"interest_rate": 0.051859643540835755
}
]
}
]
}{
"query": {
"base": "btc",
"quote": "usd",
"exchanges": [
"drbt"
],
"value_time": "2024-09-12T10:00:00.000Z",
"expiry": "2024-09-27T08:00:00.000Z",
"data_version": "v2",
"commodity": "analytics",
"request_time": "2024-09-16T10:16:06.767Z",
"sources": "false"
},
"time": "2024-09-16T10:16:07.109Z",
"data": [
{
"value_time": "2024-09-12T10:00:00.000Z",
"expiry": "2024-09-27T08:00:00.000Z",
"time_to_expiry": 0.0408675799086758,
"implied_volatilities": [
{
"strike": 30000,
"forward_log_moneyness": -0.6621439523959698,
"implied_volatility": 1.0918347265102102,
"delta": 0.999065374274305,
"gamma": 2.470728795941105E-7,
"current_spot": 58026.01780838792,
"interest_rate": 0.0599458347465653
},
{
"strike": 50000,
"forward_log_moneyness": -0.15131832862997915,
"implied_volatility": 0.6151097548518855,
"delta": 0.8995619045026346,
"gamma": 2.4400231724112595E-5,
"current_spot": 58026.01780838792,
"interest_rate": 0.0599458347465653
},
{
"strike": 60000,
"forward_log_moneyness": 0.031003228163975546,
"implied_volatility": 0.5087453039141314,
"delta": 0.40128287640417803,
"gamma": 6.479219462479912E-5,
"current_spot": 58026.01780838792,
"interest_rate": 0.0599458347465653
},
{
"strike": 70000,
"forward_log_moneyness": 0.18515390799123382,
"implied_volatility": 0.5834792805075438,
"delta": 0.06542894780360681,
"gamma": 1.861991887220773E-5,
"current_spot": 58026.01780838792,
"interest_rate": 0.0599458347465653
},
{
"strike": 90000,
"forward_log_moneyness": 0.4364683362721398,
"implied_volatility": 0.7752384746098042,
"delta": 0.0033982150399509137,
"gamma": 1.125492902360329E-6,
"current_spot": 58026.01780838792,
"interest_rate": 0.0599458347465653
}
]
}
]
}
Shared in
https://{eu/us}.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_smileShort listed-maturities (e.g. 7 days time-to-maturity) are only available for individual exchanges.
The desired exchange code.
See
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
See
Minimum: 1
Maximum: 100
Default: 10
100
sort
No
If asc, sort time-series in ascending. If desc, sort time-series in descending.
Default: desc
asc
timestamp
Trading activity
Timestamp at which the interval begins.
2023-11-29T14:00:00.000Z
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)}"){
"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
}
]
},
/* ... */
]
},
/* ... */
]
}https://us.market-api.kaiko.io/v2/data/analytics.v2/exchange_metricsexchange
Yes
This endpoint returns transactions (borrows, repayments, withdrawals, deposits and liquidations) registered on-chain, for the main L&B protocols.
Learn about our methodologies for and .
This endpoint retrieves the Trade Count, OHLCV and VWAP history for any instrument on an exchange. The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. By making use of the sort parameter, data can be returned in ascending asc (default) or descending desc order.
quote
Yes
The desired quote as the underlying of the options.
usd or usdc
usd
value_time
Yes
The time at which to compute implied volatilities The time t should be smaller than the expiry T
2022-09-20T16:15:00.000Z
expiry
Yes
The expiry for which the implied volatilities are to be computed Must be an existing expiry on the selected exchange and tradable at the time of the computation.
2022-12-30T08:00:00.000Z
strikes
Yes, if neither forward_log_moneynesses nor deltas parameters are used.
The strike prices for which the implied volatilities are to be computed. Strike prices can be existing or non-existing ones (space interpolation included)
Either strikes or forward_log_moneynesses or deltas should be filled.
singular: 10000
plural: 10000,15000,20000
forward_log_moneynesses
Yes, if neither strikes nor deltas parameters are used.
The forward log moneyness for which the implied volatilities are to be computed.
Either strikes, forward_log_moneynesses or deltas should be filled.
singular: 1
plural: -1,-0.5,0,0.5,1
deltas
Yes, if neither forward_log_moneynesses nor strikes parameters are used.
The delta levels (of a Call option) for which the implied volatilities are to be computed.
Either strikes, forward_log_moneynesses or deltas should be filled.
exchanges
No
The desired exchange as source of options data. See supported exchanges above.
drbt
2022-12-30T00:00:00.000Z
time_to_expiry
The associated time to expiry in year
0.27580868156450355
implied_volatilities
The list of requested implied volatilities
[{"strike": 40000,
"forward_log_moneyness": 0.7348555803648208,
"implied_volatility": 0.7341747093260883,
"delta": 0.04334612697660922,
"gamma": 0.000012437991693543254},
{"strike": 20000,
"forward_log_moneyness": 0.041708399804875465,
"implied_volatility": 0.6670092468551713,
"delta": 0.5223606946028295,
"gamma": 0.00005929353471794603}, ... ]
delta
The first derivative of the price with regards to the underlying price.
2.8863019124747424e-7
gamma
The second derivative of the price with regards to the underlying price.
2.416523346501216e-10
vega
The first derivative of the price with regards to implied volatility.
18.73162001892539
theta
The first derivative of the price with regards to the passage of time (or time to expiration).
-194.40147413397432
current_spot
The underlying spot price at the value timestamp.
71717
interest_rate
The implied interest rate.
0.14954983972466698
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
No
Should be one or several of the currently supported blockchains. See
ethereum
protocol
No
Should be one or several of the currently supported L&B protocols.
aav1,aav2
user_address
No
Filter on a specific wallet addresses (comma separated).
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
live
No
Shows the data as soon as the block is validated.
(Default: false, in case of block reorganization).
true
tx_hash
No
Filter on a specific transaction hash.
0xe68b84740**
asset
No
L&B events including the requested token. Default: all available tokens.
weth or weth,usdt,usdc
type
No
Event type: borrow, deposit, withdraw, repayment or liquidation.
borrow,withdraw
block_number
No
Block height.
10795593
start_block
No
Starting block height (inclusive).
129870
end_block
No
Ending block height (inclusive).
130000
start_time
No
Starting time in ISO 8601 (inclusive).
2022-04-01T00:00:00.000Z
end_time
No
Ending time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
sort
No
Returns the data in ascending or descending order.
Default: desc.
ascending
page_size
No
Number of snapshots to return data for. (default: 100, min: 1, max: 1000). See
1000
blockchain
The blockchain on which the transaction happened.
ethereum
block_number
Borrow event:
amount_receipt
Amounts of the receipt token.
299899
rate
Borrow rate (at the event level or at the contract level depending on the protocol).
Deposit event:
amount_receipt
Amounts of the receipt token.
299899
rate
Supply rate of the overall lending pool.
Withdraw event:
amount_receipt
Amounts of the receipt token.
299899
on_behalf_of
The address that will receive the underlying token.
Repayment event
amount_receipt
Amounts of the receipt token.
299899
on_behalf_of
The address of the user who will incur the debt.
Liquidation event
liquidation_debt_asset_symbol
Symbol of the debt asset.
renfil
liquidation_debt_asset_address
Address of the debt asset.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: KAIKO_API_KEY' \
'https://us.market-api.kaiko.io/v2/data/lending.v1/events?blockchain=ethereum&start_time=2024-09-27T13:13:53.441Z&end_time=2024-09-29T13:13:53.441Z'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
blockchain = "ethereum"
protocol = "aav2"
# ---- Optional parameters ---- #
user_address = None
live = "false"
tx_hash = None
asset = "weth"
type = "borrow"
block_number = None
start_block = None
end_block = None
start_time = "2025-03-01T13:00:00Z"
end_time = None
sort = "desc"
page_size = 1000
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, blockchain: str, protocol: str, user_address: str, live: str, tx_hash: str, asset: str, type: str, block_number: int, start_block: int, end_block: int, start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://eu.market-api.kaiko.io/v2/data/lending.v1/events'
params = {
"blockchain": blockchain,
"protocol": protocol,
"user_address": user_address,
"live": live,
"tx_hash": tx_hash,
"asset": asset,
"type": type,
"block_number": block_number,
"start_block": start_block,
"end_block": end_block,
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, blockchain=blockchain, protocol=protocol, user_address=user_address, live=live, tx_hash=tx_hash, asset=asset, type=type, block_number=block_number, start_block=start_block, end_block=end_block, start_time=start_time, end_time=end_time, sort=sort, page_size=page_size)
print (df)https://eu.market-api.kaiko.io/v2/data/lending.v1/eventsblockchain
{
"query": {
"blockchain": "*",
"block_number": "*",
"asset": "*",
"user_address": "*",
"tx_hash": "*",
"type": "*",
"start_time": "*",
"end_time": "*",
"protocol": "*",
"sort": "descending",
"page_size": "1000",
"start_block": "*",
"end_block": "*"
},
"time": "2022-05-17T14:26:27.274Z",
"timestamp": 1652797587,
"data":
[
{
"blockchain": "ethereum",
"block_number": 16025918,
"datetime": 1669124591,
"transaction_hash":"0xa49cfa9c026e728614ca0bdf7272eaaad5b3dd8881fd263ea19ef7d648d9c941",
"exchange_code": "aave/v2",
"type": "repayment",
"user_address": "0x4f381fb46dfde2bc9dcae2d881705749b1ed6e1a",
"asset_symbol": "crv",
"asset_address": "0xd533a949740bb3306d119cc777fa900ba034cd52",
"asset_decimals": 18,
"receipt_symbol": "acrv",
"receipt_address": "0x8dae6cb04688c62d939ed9b68d32bc62e49970b1",
"receipt_decimals": 18,
"amount": 299894.78,
"metadata": {
"borrowRateMode": 2,
"amountInReceiptAsset": "299894.77",
"onBehalfOf": "0x4f381fb46dfde2bc9dcae2d881705749b1ed6e1a"
}
}
/* ... */
],
"continuation_token": "xxx",
"next_url": "https://eu.market-api.kaiko.io/v2/data/lending.v1/events?continuation_token=xxx"
}region
Yes
Choose between eu and us.
exchange
Yes
Exchange code.
See
continuation_token
No
See
end_time
No
timestamp
Timestamp at which the interval begins.
count
The number of trades. 0 when no trades reported.
open
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap'```python
##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/count_ohlcv_vwap'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
res = requests.get(data['next_url'], headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size)
```Trade Count and OHLCV can be accessed through Google BigQuery. To get started, read our guide.
This endpoint retrieves the Trade Count, OHLCV and VWAP history for any instrument on an exchange. The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, hours or days, respectively. By making use of the sort parameter, data can be returned in ascending asc (default) or descending desc order.
region
Yes
Choose between eu and us.
exchange
Yes
continuation_token
No
See
end_time
No
timestamp
Timestamp at which the interval begins.
count
The number of trades. 0 when no trades reported.
open
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap'```python
##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
interval = "1d"
sort = "desc"
page_size = 100
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-12-31T23:59:59Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, interval: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/aggregations/count_ohlcv_vwap'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"interval": interval
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
res = requests.get(data['next_url'], headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,interval=interval, sort=sort, page_size=page_size)
```Trade Count and OHLCV can be accessed through Google BigQuery. To get started, read our guide.
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/spot/{instrument}/aggregations/count_ohlcv_vwap{
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "count_ohlcv_vwap",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:55:42.588Z"
},
"time": "2020-11-12T16:55:42.710Z",
"timestamp": 1605200142710,
"data": [
{
"timestamp": 1605139200000,
"open": "15705.79",
"high": "16185.87",
"low": "15446.82",
"close": "16139.93",
"volume": "14829.124546730012",
"price": "15880.01873841608",
"count": 95111
},
{
"timestamp": 1605052800000,
"open": "15315.46",
"high": "16000",
"low": "15293.04",
"close": "15705.79",
"volume": "15123.844197729988",
"price": "15664.643871798791",
"count": 114205
},
/* ... */
],
"result": "success",
"continuation_token": "rbd1XbkjMwv2SyUfvJwsqFGmCKzg3WToTvqigui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap?continuation_token=rbd1XbkjMwv2SyUfvJwsui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"access": {
"access_range": {
"start_timestamp": 1546300800000,
"end_timestamp": 1577836800000
},
"data_range": {
"start_timestamp": 1417391000000,
"end_timestamp": 1577836800000
}
}
}
https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/{exchange}/spot/{instrument}/aggregations/count_ohlcv_vwap{
"query": {
"page_size": 100,
"exchange": "cbse",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1d",
"sort": "desc",
"aggregation": "count_ohlcv_vwap",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:55:42.588Z"
},
"time": "2020-11-12T16:55:42.710Z",
"timestamp": 1605200142710,
"data": [
{
"timestamp": 1605139200000,
"open": "15705.79",
"high": "16185.87",
"low": "15446.82",
"close": "16139.93",
"volume": "14829.124546730012",
"price": "15880.01873841608",
"count": 95111
},
{
"timestamp": 1605052800000,
"open": "15315.46",
"high": "16000",
"low": "15293.04",
"close": "15705.79",
"volume": "15123.844197729988",
"price": "15664.643871798791",
"count": 114205
},
/* ... */
],
"result": "success",
"continuation_token": "rbd1XbkjMwv2SyUfvJwsqFGmCKzg3WToTvqigui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"next_url": "https://<eu|us>.market-api.kaiko.io/v2/data/trades.v1/exchanges/cbse/spot/btc-usd/aggregations/count_ohlcv_vwap?continuation_token=rbd1XbkjMwv2SyUfvJwsui1bejckYnxd9DM1V3v58iqMCdXa4dJSXap6p6fBuvzz32tiHVrv5LC76MyRyYNbZyvSEoVzd1krSWWeXYEtEtR",
"access": {
"access_range": {
"start_timestamp": 1546300800000,
"end_timestamp": 1577836800000
},
"data_range": {
"start_timestamp": 1417391000000,
"end_timestamp": 1577836800000
}
}
}
Level 1 & Level 2 Data [Level 1 Aggregations]
Level 1 & Level 2 Data [Level 1 Tick-Level]
Level 1 & Level 2 Data [Level 2 Aggregations]
Level 1 & Level 2 Data [Level 2 Aggregations]
Level 1 & Level 2 Data [Level 2 Tick-Level]
CeFi Spot ticker packs.
The raw data on which our Level 2 Aggregations such as market depth , bid/ask spread, and price slippage are built. Details a point-in-time view of the bids and asks on an exchange's order book to 10% depth. Used to build your own custom level 2 aggregations.
https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/snapshots/rawregion
Yes
The raw data on which our Level 2 Aggregations such as market depth , bid/ask spread, and price slippage are built. Details a point-in-time view of the bids and asks on an exchange's order book to 10% depth. Used to build your own custom level 2 aggregations.
This endpoint returns a user's positions on lending and borrowing protocols. For a given wallet address, it reports the assets supplied and borrowed, their principal and accrued interest (in both token and USD terms), the applicable interest rates and APYs, and position-level health metrics such as the health factor and available borrowing capacity, at each block over the requested time range.
The height of the block in which the transaction happened.
16025918
datetime
The timestamp of the block in which the transaction happened.
1669124591
transaction_hash
Transaction hash
---
log_index
Log index of the transaction
152
protocol
Code of the L&B protocol.
aave/v2
type
Event type: Borrow, deposit, withdraw, repayment or liquidation.
borrow, deposit, etc
user_address
Address of the user.
0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
asset_symbol
Symbol of the underlying asset.
crv
asset_address
Address of the underlying asset.
0xd533a949740bb3306d119cc777fa900ba034cd52
asset_decimals
Decimals of the underlying asset.
18
receipt_symbol
Symbol of the receipt asset.
acrv
receipt_address
Address of the receipt asset.
0x8dae6cb04688c62d939ed9b68d32bc62e49970b1
receipt_decimals
Decimals of the receipt asset.
18
amount
Amounts of the borrowed token.
299894.78
metadata
Metadata linked to the event type and protocol.
More information below.
0.02820253961814756
rate_type
Stable (1) or Variable (2)
1 or 2
on_behalf_of
The address of the user who will incur the debt.
0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31
0.000203088325657998768898798
on_behalf_of
The address that will receive the receipt tokens.
0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31
0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31
0xeffc18fc3b7eb8e676dac549e0c693ad50d1ce31
borrow_rate_mode
Stable (1) or Variable (2)
1 or 2
0xd5147bc8e386d91cc5dbe72099dac6c9b99276f5
liquidation_debt_asset_decimals
Decimals of the debt asset.
18
liquidation_debt_amount_in_asset
Amount of the debt asset.
1899
liquidation_caller_address
The address that triggered the liquidation transaction.
0xdfd3bd446f1b7fd96dc995126ee845af0b1254cd
receive_receipt_token
The liquidator chooses to receive the collateral's asset (False) or receipt token (True).
True or False
liquidation_type
Debt (1) or Collateral (2)
1
Level 1 & Level 2 Data [Level 2 Tick-Level]
CeFi derivative ticker packs.
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
See Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
Automatically included in continuation tokens.
Opening price of interval. null when no trades reported.
high
Highest price during interval. null when no trades reported.
low
Lowest price during interval. null when no trades reported.
close
Closing price of interval. null when no trades reported.
volume
Volume traded in interval. 0 when no trades reported.
price
The volume weighted price during the time interval. null when no trades reported.
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1d.
page_size
No
See Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc
Automatically included in continuation tokens.
Opening price of interval. null when no trades reported.
high
Highest price during interval. null when no trades reported.
low
Lowest price during interval. null when no trades reported.
close
Closing price of interval. null when no trades reported.
volume
Volume traded in interval. 0 when no trades reported.
price
The volume weighted price during the time interval. null when no trades reported.
page_size
No
Number of snapshots to return data for.
Default: 10
Max: 100
See
Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
asks
The sell orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to sell, displayed in the base currency. price is displayed in the quote currency.
bids
The buy orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to buy, displayed in the base currency. price is displayed in the quote currency.
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
page_size
No
Number of snapshots to return data for.
Default: 10
Max: 100
See
Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
asks
The sell orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to sell, displayed in the base currency. price is displayed in the quote currency.
bids
The buy orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to buy, displayed in the base currency. price is displayed in the quote currency.
Choose between eu and us.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
continuation_token
No
See
limit_orders
No
poll_timestamp
The timestamp at which the raw data snapshot was taken.
poll_date
The date at which the raw data snapshot was taken.
timestamp
region
Yes
Choose between eu and us.
exchange
Yes
continuation_token
No
See
limit_orders
No
poll_timestamp
The timestamp at which the raw data snapshot was taken.
poll_date
The date at which the raw data snapshot was taken.
timestamp
Number of orders to return on bid and ask side per snapshot.
To retrieve the best bid/ask, set this parameter to 1
Default: 10
The timestamp provided by the exchange. null when not provided.
Exchange code.
See
Number of orders to return on bid and ask side per snapshot.
To retrieve the best bid/ask, set this parameter to 1
Default: 10
The timestamp provided by the exchange. null when not provided.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/raw?page_size=10&limit_orders=2'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
limit_orders = 10
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int, limit_orders: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/snapshots/raw'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"limit_orders": limit_orders
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size), limit_orders=limit_orders){
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"slippage": 0,
"limit_orders": 2,
"slippage_ref": "mid_price",
"sort": "desc",
"metric": "raw",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:13:08.823Z"
},
"time": "2020-05-26T14:13:08.899Z",
"timestamp": 1590502388899,
"data": [
{
"poll_timestamp": 1590502335760,
"poll_date": "2020-05-26T14:12:15.760Z",
"timestamp": null,
"asks": [
{
"amount": "12",
"price": "8830"
},
{
"amount": "3.67",
"price": "8832.9"
}
],
"bids": [
{
"amount": "13.316",
"price": "8829.9"
},
{
"amount": "0.097",
"price": "8829.4"
}
]
}
/* ... */
],
"result": "success",
"continuation_token": "Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
"next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/raw?continuation_token=Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/snapshots/rawcurl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/raw?page_size=10&limit_orders=2'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
limit_orders = 10
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int, limit_orders: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/snapshots/raw'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"limit_orders": limit_orders
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size), limit_orders=limit_orders){
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"slippage": 0,
"limit_orders": 2,
"slippage_ref": "mid_price",
"sort": "desc",
"metric": "raw",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:13:08.823Z"
},
"time": "2020-05-26T14:13:08.899Z",
"timestamp": 1590502388899,
"data": [
{
"poll_timestamp": 1590502335760,
"poll_date": "2020-05-26T14:12:15.760Z",
"timestamp": null,
"asks": [
{
"amount": "12",
"price": "8830"
},
{
"amount": "3.67",
"price": "8832.9"
}
],
"bids": [
{
"amount": "13.316",
"price": "8829.9"
},
{
"amount": "0.097",
"price": "8829.4"
}
]
}
/* ... */
],
"result": "success",
"continuation_token": "Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
"next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/raw?continuation_token=Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Block height.
21795593
start_block
No
Starting block height, inclusive.
21795593
end_block
No
Ending block height, inclusive.
22795593
datetime
No
Time in ISO 8601, inclusive.
2022-04-01T00:00:00.000Z
start_time
No
Starting time in ISO 8601, inclusive.
2022-04-01T00:00:00.000Z
end_time
No
Ending time in ISO 8601, inclusive.
2022-05-01T00:00:00.000Z
interval
No
Interval between snapshots. Use s, m, h, d, b, or change. Default: 1d.
1h
sort
No
Sort order. Default: desc.
ascending
page_size
No
Snapshots per response. Default: 100; minimum: 1; maximum: 1000. See .
1000
user_address
Address of the user's wallet.
0x1d296f5efbbb235c7a90734c2469fe8dc21e132d
blockchain
asset
Symbol of the supplied asset.
weth
asset_address
asset
Symbol of the borrowed asset.
usdt
asset_address
Underlying asset address.
curl --compressed \
-H 'Accept: application/json' \
-H 'X-Api-Key: <client-api-key>' \
'https://eu.market-api.kaiko.io/v2/data/lending.v1/addresses/0x1d296f5efbbb235c7a90734c2469fe8dc21e132d/positions?start_time=2026-06-01T00:00:00.000Z&end_time=2026-06-02T00:00:00.000Z&interval=1d'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
user_address = "0x1d296f5efbbb235c7a90734c2469fe8dc21e132d"
# ---- Optional parameters ---- #
start_time = "2026-06-01T00:00:00.000Z"
end_time = "2026-06-02T00:00:00.000Z"
interval = "1d"
page_size = 10
sort = "asc"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(
api_key: str,
user_address: str,
start_time: str,
end_time: str,
interval: str,
sort: str,
page_size: int,
):
headers = {"Accept": "application/json", "X-Api-Key": api_key}
url = f"https://eu.market-api.kaiko.io/v2/data/lending.v1/addresses/{user_address}/positions"
params = {
"start_time": start_time,
"end_time": end_time,
"interval": interval,
"sort": sort,
"page_size": page_size,
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if "data" not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data["data"])
# Handle pagination with continuation token
while data.get("next_url"):
res = requests.get(data["next_url"], headers=headers)
res.raise_for_status()
data = res.json()
if "data" in data:
df = pd.concat([df, pd.DataFrame(data["data"])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(
api_key=api_key,
user_address=user_address,
start_time=start_time,
end_time=end_time,
interval=interval,
sort=sort,
page_size=page_size,
)
print(df)https://eu.market-api.kaiko.io/v2/data/lending.v1/addresses/{user_address}/positionsblock_number
No
{
"query":
{
"user_address": "0x1d296f5efbbb235c7a90734c2469fe8dc21e132d",
"start_time": "2026-06-01T00:00:00.000Z",
"end_time": "2026-06-02T00:00:00.000Z",
"interval": "1d"
},
"time": "2026-07-02T14:38:15.282665557Z",
"timestamp": 1783003095,
"data":
[
{
"user_address": "0x1d296f5efbbb235c7a90734c2469fe8dc21e132d",
"blockchain": "ethereum",
"block_number": "25225970",
"timestamp": "2026-06-02T00:00:00Z",
"protocol": "aav3",
"health_factor": "1.839684",
"total_collateral_usd": "42075.46",
"total_supplied_usd": "42075.46",
"total_debt_usd": "18982.95",
"available_borrows_usd": "14887.79",
"net_worth_usd": "23092.51",
"net_apy": "-0.003917",
"total_supply_accrued_interest_usd": "6.58",
"total_borrow_accrued_interest_usd": "6.97",
"total_principal_supplied_usd": "42068.88",
"total_principal_borrowed_usd": "18975.99",
"roi": "-0.000017",
"supplies":
[
{
"asset": "weth",
"asset_address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"atoken_address": "0x4d5f47fa6a74757f35c14fd3a6ef8e3c9bc514e8",
"scaled_balance": "19697531323085677000",
"supplied_amount": "21.0032861479522399",
"supplied_amount_usd": "42075.46",
"principal_supplied": "21",
"principal_supplied_usd": "42068.88",
"accrued_interest": "0.0032861479522399",
"accrued_interest_usd": "6.58",
"supply_apy": "0.014136",
"current_liquidity_rate": "0.014037",
"is_collateral": "True",
"liquidation_threshold": "0.830000",
"ltv": "0.805000",
"roi": "0.000156"
}
],
"borrows":
[
{
"asset": "usdt",
"asset_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"borrow_type": "variable",
"scaled_debt_balance": "15440253275",
"borrowed_amount": "19006.977599660540473",
"borrowed_amount_usd": "18982.95",
"principal_borrowed": "19000",
"principal_borrowed_usd": "18975.99",
"accrued_interest": "6.977599660540473",
"accrued_interest_usd": "6.97",
"variable_borrow_rate": "0.035461",
"borrow_apy": "0.036097"
}
]
},
],
"result": "success",
"access":
{
"access_range":
{
"start_timestamp": 1073001600000,
"end_timestamp": 1861830000000
},
"data_range":
{
"start_timestamp": "None",
"end_timestamp": 1861830000000
}
}
}Kaiko Blockchain Monitoring
When Bitcoin is your chosen blockchain.
This endpoint offers in-depth insights into Bitcoin wallets including transfers and wallet balances over time.
https://us.market-api.kaiko.io/v2/data/wallet.v1/auditblockchain
Raw data used to build your own custom level 2 aggregations.
Blockchain on which the position exists.
ethereum
block_number
Block height at which the position was read.
25225970
timestamp
Timestamp of the block.
2026-06-02T00:00:00Z
protocol
Lending and borrowing protocol code.
aav3
health_factor
Position health factor. Values below 1 are eligible for liquidation.
1.839684
total_collateral_usd
Total collateral value in USD.
42075.46
total_supplied_usd
Total supplied value in USD.
42075.46
total_debt_usd
Total debt value in USD.
18982.95
available_borrows_usd
Remaining borrowing capacity in USD.
14887.79
net_worth_usd
Position net worth in USD.
23092.51
net_apy
Net APY across the position.
-0.003917
total_supply_accrued_interest_usd
Total accrued supply interest in USD.
6.58
total_borrow_accrued_interest_usd
Total accrued borrow interest in USD.
6.97
total_principal_supplied_usd
Principal supplied, excluding interest, in USD.
42068.88
total_principal_borrowed_usd
Principal borrowed, excluding interest, in USD.
18975.99
roi
Return on investment across the position.
-0.000017
supplies
Array of supplied assets.
See Supplies.
borrows
Array of borrowed assets.
See Borrows.
Underlying asset address.
0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
atoken_address
Receipt aToken address.
0x4d5f47fa6a74757f35c14fd3a6ef8e3c9bc514e8
scaled_balance
Scaled aToken balance in raw units.
19697531323085677000
supplied_amount
Supplied amount in token units.
21.0032861479522399
supplied_amount_usd
Supplied amount in USD.
42075.46
principal_supplied
Principal supplied, excluding interest, in token units.
21
principal_supplied_usd
Principal supplied, excluding interest, in USD.
42068.88
accrued_interest
Accrued supply interest in token units.
0.0032861479522399
accrued_interest_usd
Accrued supply interest in USD.
6.58
supply_apy
Supply APY for the asset.
0.014136
current_liquidity_rate
Current liquidity rate for the asset.
0.014037
is_collateral
Whether the asset is used as collateral.
true
liquidation_threshold
Liquidation threshold for the asset.
0.830000
ltv
Maximum loan-to-value ratio for the asset.
0.805000
roi
Return on investment for the supply.
0.000156
0xdac17f958d2ee523a2206206994597c13d831ec7
borrow_type
Borrow type: stable or variable.
variable
scaled_debt_balance
Scaled debt balance in raw units.
15440253275
borrowed_amount
Borrowed amount in token units.
19006.977599660540473
borrowed_amount_usd
Borrowed amount in USD.
18982.95
principal_borrowed
Principal borrowed, excluding interest, in token units.
19000
principal_borrowed_usd
Principal borrowed, excluding interest, in USD.
18975.99
accrued_interest
Accrued borrow interest in token units.
6.977599660540473
accrued_interest_usd
Accrued borrow interest in USD.
6.97
variable_borrow_rate
Variable borrow rate for the asset.
0.035461
borrow_apy
Borrow APY for the asset.
0.036097
871899
timestamp
The timestamp of the block.
1732536300000000000
address
The address on which the row is focused.
bc1qhyar38j6catjs8y30naptzrs8jhgudhzcv8s98
transaction_hash
Transaction hash.
e84b146c3f26545b525772a38425513f36a1738bfbb49a474aefe14a8c6d7903
transaction_id
Transaction ID.
334480d40ca84435bf440da99e9454cca25d06163996cd9a6ba4b517b9da1608
transaction_type
Transaction type. See information .
witness_v0_keyhash
transaction_index
The index of the transaction.
4695
internal_transaction_index
1
token_symbol
Symbol of the token or coin transferred
BTC
direction
Inflow or outflow from the user_address.
out
amount
Amount of asset transferred.
0.0022931
amount_usd
Amount of asset transferred in usd.
225.6601111753002
balance_after
Wallet balance for the user_address for this asset.
0
balance_after_usd
Wallet balance for the user_address for this asset in usd.
0
witness_unknown
witness_v0_keyhash
witness_v0_scripthash
witness_v1_taproot
nulldata
nonstandard
Always bitcoin.
bitcoin
sort
The sorting order for the results.
asc or desc
page_size
Number of results to return data for. (max: 5000).
See Pagination
100
start_time
Starting time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
end_time
Ending time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
transaction_hash
The transaction hash to filter on.
5ae688ab08139338e3024e150339ffa94c9d2ba23f38d0838025a41dc2fac3e6
user_address
The address to filter on.
bc1qm8ktha9m745u2gh54kprk72eu9t6n5xa2adckn
blockchain
Blockchain name.
bitcoin
block_number
curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
"https://eu.market-api.kaiko.io/v2/data/wallet.v1/audit?blockchain=bitcoin"##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
blockchain = "bitcoin"
# ---- Optional parameters ---- #
start_time = "2022-05-01T00:00:00.000Z"
end_time = "2022-30-01T00:00:00.000Z"
page_size = 100
sort = "desc"
transaction_hash = None
user_address = "1FfmbHfnpaZjKFvyi1okTjJJusN455paPH"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, blockchain: str, start_time: str, end_time: str, page_size: int, sort: str, transaction_hash: str, user_address: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/wallet.v1/audit'
params = {
"blockchain": blockchain,
"start_time": start_time,
"end_time": end_time,
"page_size": page_size,
"sort": sort,
"transaction_hash": transaction_hash,
"user_address": user_address
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, blockchain=blockchain, start_time=start_time, end_time=end_time, page_size=page_size, sort=sort, transaction_hash=transaction_hash, user_address=user_address)
print (df){
"query":
{
"live": "False",
"start_time": "2024-01-01T00:00:00.000Z",
"end_time": "2024-01-02T00:00:00.000Z",
"start_block": 0,
"end_block": 0,
"page_size": 100,
"sort": "0",
"data_version": "v1",
"commodity": "wallet_data",
"request_time": "2024-01-01T00:00:00.000Z"
},
"time": "2024-01-01T00:00:00.000Z",
"timestamp": 1732536300000,
"access":
{
"access_range":
{
"start_timestamp": 1073001600000,
"end_timestamp": "None"
},
"data_range":
{
"start_timestamp": "None",
"end_timestamp": "None"
}
},
"data":
[
{
"blockchain": "bitcoin",
"block_number": 871899,
"timestamp": 1732536300000000000,
"address": "bc1qt42fgv262u3d2qvpmwecpxdwfmxpjug6mxn532",
"transaction_hash": "e84b146c3f26545b525772a38425513f36a1738bfbb49a474aefe14a8c6d7903",
"transaction_id": "334480d40ca84435bf440da99e9454cca25d06163996cd9a6ba4b517b9da1608",
"transaction_type": "witness_v0_keyhash",
"transaction_index": 4695,
"internal_transaction_index": 0,
"token_symbol": "BTC",
"direction": "in",
"amount": 0.00228863,
"amount_usd": 225.22022599935772,
"balance_after": 1.06076911,
"balance_after_usd": 104388.50259209116
},
/* ... */
],
"continuation_token": "xxx",
"next_url": "https://us.market-api.kaiko.io/v2/data/wallet.v1/audit?continuation_token=xxx"
}
}minerReward
multisig
pubkey
pubkeyhash
scripthash
The height of the block.
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
continuation_token
No
See
limit_orders
No
poll_timestamp
The timestamp at which the raw data snapshot was taken.
poll_date
The date at which the raw data snapshot was taken.
timestamp
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/raw?page_size=10&limit_orders=2'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
limit_orders = 10
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int, limit_orders: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/snapshots/raw'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"limit_orders": limit_orders
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size), limit_orders=limit_orders)Raw data used to build your own custom level 2 aggregations.
region
Yes
Choose between eu and us.
exchange
Yes
continuation_token
No
See
limit_orders
No
poll_timestamp
The timestamp at which the raw data snapshot was taken.
poll_date
The date at which the raw data snapshot was taken.
timestamp
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/raw?page_size=10&limit_orders=2'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
limit_orders = 10
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int, limit_orders: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/snapshots/raw'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"limit_orders": limit_orders
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size), limit_orders=limit_orders)https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/snapshots/rawregion
Yes
Choose between eu and us.
exchange
{
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"slippage": 0,
"limit_orders": 2,
"slippage_ref": "mid_price",
"sort": "desc",
"metric": "raw",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:13:08.823Z"
},
"time": "2020-05-26T14:13:08.899Z",
"timestamp": 1590502388899,
"data": [
{
"poll_timestamp": 1590502335760,
"poll_date": "2020-05-26T14:12:15.760Z",
"timestamp": null,
"asks": [
{
"amount": "12",
"price": "8830"
},
{
"amount": "3.67",
"price": "8832.9"
}
],
"bids": [
{
"amount": "13.316",
"price": "8829.9"
},
{
"amount": "0.097",
"price": "8829.4"
}
]
}
/* ... */
],
"result": "success",
"continuation_token": "Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
"next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/raw?continuation_token=Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/snapshots/raw{
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"slippage": 0,
"limit_orders": 2,
"slippage_ref": "mid_price",
"sort": "desc",
"metric": "raw",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:13:08.823Z"
},
"time": "2020-05-26T14:13:08.899Z",
"timestamp": 1590502388899,
"data": [
{
"poll_timestamp": 1590502335760,
"poll_date": "2020-05-26T14:12:15.760Z",
"timestamp": null,
"asks": [
{
"amount": "12",
"price": "8830"
},
{
"amount": "3.67",
"price": "8832.9"
}
],
"bids": [
{
"amount": "13.316",
"price": "8829.9"
},
{
"amount": "0.097",
"price": "8829.4"
}
]
}
/* ... */
],
"result": "success",
"continuation_token": "Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
"next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/cbse/spot/btc-usd/snapshots/raw?continuation_token=Z8FjTagUoHd3UCqMvqmRJXlwzbTxSnSXpxxZpHWNCmrsrcnhSpMG2gdcmFKRPd88",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Level 1 & Level 2 Data [Level 2 Aggregations]
Level 1 & Level 2 Data [Level 2 Tick-Level]
CeFi Derivative ticker packs.
Level 1 & Level 2 Data [Level 2 Aggregations]
Level 1 & Level 2 Data [Level 2 Tick-Level]
CeFi Spot ticker packs.
This endpoint returns raw order book used to calculate our aggregations, alongside the aggregations:
Market Depth - provides insight into the "depth" of an exchange's order book by aggregating the volume of bids and asks within 0-10% of the best bid or ask, respectively. A higher volume of bids and asks at each level implies more liquidity.
Price Slippage - calculates the potential slippage for a market buy order if it were placed at the time the Order Book Snapshot was taken.
Bid-ask Spread - The bid-ask spread is the difference between the highest price that a buyer is willing to pay for an asset (the bid) and the lowest price that a seller is willing to accept (the ask). A smaller spread implies more liquidity.
This endpoint returns raw order book used to calculate our aggregations, alongside the aggregations:
Market Depth - provides insight into the "depth" of an exchange's order book by aggregating the volume of bids and asks within 0-10% of the best bid or ask, respectively. A higher volume of bids and asks at each level implies more liquidity.
Price Slippage - calculates the potential slippage for a market buy order if it were placed at the time the Order Book Snapshot was taken.
Bid-ask Spread - The bid-ask spread is the difference between the highest price that a buyer is willing to pay for an asset (the bid) and the lowest price that a seller is willing to accept (the ask). A smaller spread implies more liquidity.
Number of orders to return on bid and ask side per snapshot.
To retrieve the best bid/ask, set this parameter to 1
Default: 10
page_size
No
Number of snapshots to return data for.
Default: 10
Max: 100
See
Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
The timestamp provided by the exchange. null when not provided.
asks
The sell orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to sell, displayed in the base currency. price is displayed in the quote currency.
bids
The buy orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to buy, displayed in the base currency. price is displayed in the quote currency.
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
Number of orders to return on bid and ask side per snapshot.
To retrieve the best bid/ask, set this parameter to 1
Default: 10
page_size
No
Number of snapshots to return data for.
Default: 10
Max: 100
See
Automatically included in continuation tokens.
sort
No
Return the data in ascending (asc) or descending (desc) order.
Default: desc
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
The timestamp provided by the exchange. null when not provided.
asks
The sell orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to sell, displayed in the base currency. price is displayed in the quote currency.
bids
The buy orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to buy, displayed in the base currency. price is displayed in the quote currency.
https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/snapshots/fullregion
Yes
Choose between eu and us.
exchange
Yes
continuation_token
No
See
end_time
No
poll_timestamp
The timestamp at which the raw data snapshot was taken.
poll_date
The date at which the raw data snapshot was taken.
timestamp
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/full?slippage=100000&page_size=10&limit_orders=2&slippage_ref=best'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
limit_orders= 10
slippage= 0
slippage_ref= "mid_price"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int, limit_orders: int, slippage: int, slippage_ref: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/snapshots/full'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"limit_orders": limit_orders,
"slippage": slippage,
"slippage_ref": slippage_ref
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size), limit_orders=limit_orders, slippage=slippage, slippage_ref=slippage_ref){
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"slippage": 100000,
"limit_orders": 2,
"slippage_ref": "best",
"sort": "desc",
"metric": "full",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:10:06.320Z"
},
"time": "2020-05-26T14:10:06.418Z",
"timestamp": 1590502206418,
"data": [
{
"poll_timestamp": 1590502155757,
"poll_date": "2020-05-26T14:09:15.757Z",
"timestamp": null,
"bid_volume0_1": "46.595",
"bid_volume0_2": "110.570",
"bid_volume0_3": "167.920",
"bid_volume0_4": "198.416",
"bid_volume0_5": "243.554",
"bid_volume0_6": "346.467",
"bid_volume0_7": "354.090",
"bid_volume0_8": "359.058",
"bid_volume0_9": "381.422",
"bid_volume1": "384.066",
"bid_volume1_5": "467.014",
"bid_volume2": "522.441",
"bid_volume4": "918.911",
"bid_volume6": "1187.306",
"bid_volume8": "1187.306",
"bid_volume10": "1187.306",
"ask_volume0_1": "13.158",
"ask_volume0_2": "40.072",
"ask_volume0_3": "71.129",
"ask_volume0_4": "179.463",
"ask_volume0_5": "259.140",
"ask_volume0_6": "266.315",
"ask_volume0_7": "324.288",
"ask_volume0_8": "353.024",
"ask_volume0_9": "376.738",
"ask_volume1": "405.965",
"ask_volume1_5": "467.665",
"ask_volume2": "506.326",
"ask_volume4": "862.843",
"ask_volume6": "1322.553",
"ask_volume8": "1428.856",
"ask_volume10": "1428.856",
"spread": "0.1",
"mid_price": "8819.95",
"ask_slippage": "0.0002782477139043083900226757369614512",
"bid_slippage": "0.0",
"asks": [
{
"amount": "5.914",
"price": "8820"
},
{
"amount": "0.08",
"price": "8821"
}
],
"bids": [
{
"amount": "11.814",
"price": "8819.9"
},
{
"amount": "4.197",
"price": "8819.8"
}
]
},
/* ... */
],
"result": "success",
"continuation_token": "Ehad6pjoEpvpZSkvbtsyx8WxTj9vgc4s5VSow1USG8pXP1UGFSxSF7fTacxA54rYoqebnMTdCpE3ZxB3nSTM5CYNModkKRASDWMHymPFHNXnGL73RdkHSVUv6UYa4YwrRinH7JbwRqbB5HwmZdxWaonnaVkeZZc1wZiuK2oR4ePQdotGEnvKY8spPjYwnX8s3D6w1bCqZqL6ENaNH5Pa6b53MdbmyQBjE8F",
"next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/full?continuation_token=Ehad6pjoEpvpZSkvbtsyx8WxTjvgc4s5VSow1USG8pXP1UGFSxSF7fTacxA54rYoqebnMTdCpE3ZxB3nSTM5CYNModkKRASDWMHymPFHNXnGL73RdkHSVUv6UYa4YwrRinH7JbwRqbB5HwmZdxWaonnaVkeZZc1wZiuK2oR4ePQdotGEnvKY8spPjYwnX8s3D6w1bCqZqL6ENaNH5Pa6b53MdbmyQBjE8F",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/snapshots/fullregion
Yes
Choose between eu and us.
exchange
Yes
continuation_token
No
See
end_time
No
poll_timestamp
The timestamp at which the raw data snapshot was taken.
poll_date
The date at which the raw data snapshot was taken.
timestamp
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/full?slippage=100000&page_size=10&limit_orders=2&slippage_ref=best'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
limit_orders= 10
slippage= 0
slippage_ref= "mid_price"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int, limit_orders: int, slippage: int, slippage_ref: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/snapshots/full'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size,
"limit_orders": limit_orders,
"slippage": slippage,
"slippage_ref": slippage_ref
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size), limit_orders=limit_orders, slippage=slippage, slippage_ref=slippage_ref){
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"slippage": 100000,
"limit_orders": 2,
"slippage_ref": "best",
"sort": "desc",
"metric": "full",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:10:06.320Z"
},
"time": "2020-05-26T14:10:06.418Z",
"timestamp": 1590502206418,
"data": [
{
"poll_timestamp": 1590502155757,
"poll_date": "2020-05-26T14:09:15.757Z",
"timestamp": null,
"bid_volume0_1": "46.595",
"bid_volume0_2": "110.570",
"bid_volume0_3": "167.920",
"bid_volume0_4": "198.416",
"bid_volume0_5": "243.554",
"bid_volume0_6": "346.467",
"bid_volume0_7": "354.090",
"bid_volume0_8": "359.058",
"bid_volume0_9": "381.422",
"bid_volume1": "384.066",
"bid_volume1_5": "467.014",
"bid_volume2": "522.441",
"bid_volume4": "918.911",
"bid_volume6": "1187.306",
"bid_volume8": "1187.306",
"bid_volume10": "1187.306",
"ask_volume0_1": "13.158",
"ask_volume0_2": "40.072",
"ask_volume0_3": "71.129",
"ask_volume0_4": "179.463",
"ask_volume0_5": "259.140",
"ask_volume0_6": "266.315",
"ask_volume0_7": "324.288",
"ask_volume0_8": "353.024",
"ask_volume0_9": "376.738",
"ask_volume1": "405.965",
"ask_volume1_5": "467.665",
"ask_volume2": "506.326",
"ask_volume4": "862.843",
"ask_volume6": "1322.553",
"ask_volume8": "1428.856",
"ask_volume10": "1428.856",
"spread": "0.1",
"mid_price": "8819.95",
"ask_slippage": "0.0002782477139043083900226757369614512",
"bid_slippage": "0.0",
"asks": [
{
"amount": "5.914",
"price": "8820"
},
{
"amount": "0.08",
"price": "8821"
}
],
"bids": [
{
"amount": "11.814",
"price": "8819.9"
},
{
"amount": "4.197",
"price": "8819.8"
}
]
},
/* ... */
],
"result": "success",
"continuation_token": "Ehad6pjoEpvpZSkvbtsyx8WxTj9vgc4s5VSow1USG8pXP1UGFSxSF7fTacxA54rYoqebnMTdCpE3ZxB3nSTM5CYNModkKRASDWMHymPFHNXnGL73RdkHSVUv6UYa4YwrRinH7JbwRqbB5HwmZdxWaonnaVkeZZc1wZiuK2oR4ePQdotGEnvKY8spPjYwnX8s3D6w1bCqZqL6ENaNH5Pa6b53MdbmyQBjE8F",
"next_url": "https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/snapshots/full?continuation_token=Ehad6pjoEpvpZSkvbtsyx8WxTjvgc4s5VSow1USG8pXP1UGFSxSF7fTacxA54rYoqebnMTdCpE3ZxB3nSTM5CYNModkKRASDWMHymPFHNXnGL73RdkHSVUv6UYa4YwrRinH7JbwRqbB5HwmZdxWaonnaVkeZZc1wZiuK2oR4ePQdotGEnvKY8spPjYwnX8s3D6w1bCqZqL6ENaNH5Pa6b53MdbmyQBjE8F",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Level 1 & Level 2 Data [Level 2 Aggregations]
Level 1 & Level 2 Data [Level 2 Tick-Level]
CeFi Spot ticker packs.
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
limit_orders
No
Number of orders to return on bid and ask side per snapshot.
To retrieve the best bid/ask, set this parameter to 1
Default: 10
page_size
No
Number of snapshots to return (default: 10, max: 100). See Automatically included in continuation tokens.
sort
No
Return the data in ascending asc or descending desc order.
Default: desc.
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
slippage
No
Order size (in quote asset) for which to calculate the percentage of slippage.
Default: 0.
When null is returned, not enough volume is present on the order book to execute the order.
slippage_ref
No
Price point for which to calculate slippage from. Either from the mid-price (mid_price) or from the best bid/ask (best).
Default: mid_price.
The timestamp provided by the exchange. null when not provided.
bid_volume_x
The volume of bids placed within 0 and x% of the best bid. This is what we call "Market Depth"
ask_volume_x
The volume of asks placed within 0 and x% of the best ask. This is what we call "Market Depth"
spread
The difference between the best bid and the best ask at the time the snapshot was taken. This is what we call "Bid Ask Spread"
mid_price
The mid price between the best bid and the best ask.
ask_slippage
The percentage price slippage for a market buy order placed at the time that the order book snapshot was taken.
bid_slippage
The percentage price slippage for a market sell order placed at the time that the order book snapshot was taken.
asks
The sell orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to sell, displayed in the base currency. price is displayed in the quote currency.
bids
The buy orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to buy, displayed in the base currency. price is displayed in the quote currency.
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
limit_orders
No
Number of orders to return on bid and ask side per snapshot.
To retrieve the best bid/ask, set this parameter to 1
Default: 10
page_size
No
Number of snapshots to return (default: 10, max: 100). See Automatically included in continuation tokens.
sort
No
Return the data in ascending asc or descending desc order.
Default: desc.
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
slippage
No
Order size (in quote asset) for which to calculate the percentage of slippage.
Default: 0.
When null is returned, not enough volume is present on the order book to execute the order.
slippage_ref
No
Price point for which to calculate slippage from. Either from the mid-price (mid_price) or from the best bid/ask (best).
Default: mid_price.
The timestamp provided by the exchange. null when not provided.
bid_volume_x
The volume of bids placed within 0 and x% of the best bid. This is what we call "Market Depth"
ask_volume_x
The volume of asks placed within 0 and x% of the best ask. This is what we call "Market Depth"
spread
The difference between the best bid and the best ask at the time the snapshot was taken. This is what we call "Bid Ask Spread"
mid_price
The mid price between the best bid and the best ask.
ask_slippage
The percentage price slippage for a market buy order placed at the time that the order book snapshot was taken.
bid_slippage
The percentage price slippage for a market sell order placed at the time that the order book snapshot was taken.
asks
The sell orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to sell, displayed in the base currency. price is displayed in the quote currency.
bids
The buy orders in the snapshot. If the limit_orders parameter is used, this will be reflected here. amount is the quantity of asset to buy, displayed in the base currency. price is displayed in the quote currency.
The IV Metrics endpoint gives you a standardized, at-a-glance read on the shape and sentiment of the crypto options market. Feed the endpoint a currency and a value time, and you'll receive five scalar indices extracted from Kaiko's calibrated implied volatility surface for every existing maturities.
Read our Implied Volatility Methodology here.
https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_metricsUse this example to retrieve IV Metrics for BTC.
Use this example to retrieve IV Metrics for BTC.
Beta version for Beta users.
This endpoint provides details of the contracts, including base asset, quote asset, contract size, contract size unit, listing_timestamp, expiry, strike price, and underlying index.
This is a new beta endpoint only supporting the following Exchanges:
Binance, BitMEX, Bybit, Deribit, and Okex.
atmChange
The change in ATM implied volatility compared to the reference period.
7.405591456177248
riskReversal25
25% delta Risk Reversal: directional skew, measuring call vs. put demand.
IV(25Δ call) − IV(25Δ put)
-0.246372750488554
riskReversal25Change
The change in 25% delta risk reversal compared to the reference period.
0.3563815067575433
butterfly25
25% delta Butterfly: wing richness relative to ATM.
(IV(25Δ call) + IV(25Δ put)) − 2 * IV(50Δ call)
3.7045205302079864
butterfly25Change
The change in 25% delta butterfly spread compared to the reference period.
1.7633060997255683
riskReversal15
15% delta Risk Reversal: deeper directional skew, more sensitive to tail demand.
IV(15Δ call) − IV(15Δ put)
-0.095984415172001
riskReversal15Change
The change in 15% delta risk reversal compared to the reference period.
-0.224040582481023
butterfly15
15% delta Butterfly: wing richness relative to ATM.
(IV(15Δ call) + IV(15Δ put)) − 2 * IV(50Δ call)
7.202441581399597
butterfly15Change
The change in 15% delta butterfly spread compared to the reference period.
3.1331810644171725
riskReversal10
10% delta Risk Reversal: deeper directional skew, more sensitive to tail demand.
IV(10Δ call) − IV(10Δ put)
-0.105875985638655
riskReversal10Change
The change in 10% delta risk reversal compared to the reference period.
-0.224040592481023
butterfly10
10% delta Butterfly: deeper wing richness relative to ATM.
(IV(10Δ call) + IV(10Δ put)) − 2 * IV(50Δ call)
7.202441581399597
butterfly10Change
The change in 10% delta butterfly spread compared to the reference period.
3.1331810644171725
expirationTimestamp
Expiration date/time of the option series.
2026-05-21 00:00:00
base
Base asset of the option.
btc, eth, sol
quote
Quote currency.
usd, usdc
underlyingPrice
Underlying forward for the expiry.
71283.96315789474
underlyingPriceChange
The change in underlying price compared to the reference period.
3376.3573766447516
daysToExpiration
The number of days remaining until expiration (fractional).
1.4097222222222223
exchange
The exchange where the options are traded.
drbt
base
Yes
The desired base as the underlying of the options.
btc, eth, sol
quote
Yes
The quote currency of the options.
usd, usdc
exchange
No
The specific exchange. Default: drbt,okex
drbt
value_time
No
Timestamp for which implied volatilities metrics are computed. Default to the latest timestamp available when the request is made.
2026-04-21T00:00:00.000Z
days_back
No
Number of days between value_time and the previous timestamp used for comparison. For example, daysBack=7 compares the IV metrics at value_time with those from 7 days earlier. Default: 1
1, 3, 7, 30
atm
At the money (ATM) implied volatility.
IV(50Δ call)
40.53042509301596
curl --compressed \
-H 'Accept: application/json' \
-H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_metrics?base=btc&value_time=2026-03-31T00:00:00Z"e=usd&exchange=drbt&days_back=1'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
base = "btc"
quote= "usd"
value_time = "2026-04-21T00:00:00.000Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, base: str, value_time: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = 'https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_metrics'
params = {
"base": base,
"quote": quote,
"value_time": value_time,
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, base=base, value_time=value_time)
print(df){
"query": {
"base": "btc",
"quote": "usd",
"value_time": "2026-03-31T00:00:00Z",
"request_time": "2026-08-01T12:46:33.862Z"
},
"time": "2026-09-01T12:46:33.862Z",
"timestamp": 1788266794104,
"result": "success",
"data": [
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1774944000000,
"daysToExpiration": 0.3333333333333333,
"underlyingPrice": 66688.90096575381,
"underlyingPriceChange": 746.6977124771074,
"atm": 43.77971232461352,
"atmChange": -11.566902354396234,
"riskReversal25": -4.208081567534244,
"riskReversal25Change": 6.215623005597152,
"riskReversal15": -8.331911034901516,
"riskReversal15Change": 8.263036908955243,
"riskReversal10": -12.834455464482645,
"riskReversal10Change": 8.247198874245612,
"butterfly25": 3.091864209994597,
"butterfly25Change": -1.01927815227981,
"butterfly15": 8.110431741073839,
"butterfly15Change": -1.6652124768285717,
"butterfly10": 13.674823998927678,
"butterfly10Change": -1.3307918996063393
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1775030400000,
"daysToExpiration": 1.3333333333333333,
"underlyingPrice": 66739.28359973205,
"underlyingPriceChange": 795.4291626103368,
"atm": 52.909484596848536,
"atmChange": -2.9579913163117197,
"riskReversal25": -8.35704647717909,
"riskReversal25Change": 2.9681177602857147,
"riskReversal15": -14.455655627303933,
"riskReversal15Change": 2.7651645384988726,
"riskReversal10": -19.81852207580191,
"riskReversal10Change": 1.1631462312904688,
"butterfly25": 3.3895404845302863,
"butterfly25Change": -0.09461952899337689,
"butterfly15": 8.522481994884245,
"butterfly15Change": 0.1961983049254883,
"butterfly10": 13.739319112230788,
"butterfly10Change": 0.8461942439366652
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1775116800000,
"daysToExpiration": 2.3333333333333335,
"underlyingPrice": 66763.83584704799,
"underlyingPriceChange": 845.5919667066482,
"atm": 53.32208342451581,
"atmChange": -2.2720687755555247,
"riskReversal25": -10.245209898044408,
"riskReversal25Change": -0.7612864605666516,
"riskReversal15": -17.291723844887017,
"riskReversal15Change": -2.099269557406295,
"riskReversal10": -23.015969931943182,
"riskReversal10Change": -3.601574417312868,
"butterfly25": 4.7992563795218075,
"butterfly25Change": 0.9871256251819602,
"butterfly15": 11.663980062950188,
"butterfly15Change": 2.5751969958024716,
"butterfly10": 18.170075383246484,
"butterfly10Change": 4.187479048483993
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1775203200000,
"daysToExpiration": 3.3333333333333335,
"underlyingPrice": 66773.31321323414,
"underlyingPriceChange": 801.5324026079034,
"atm": 54.323771330035676,
"atmChange": 0.09296430856697668,
"riskReversal25": -9.88292348567667,
"riskReversal25Change": 0.3313015087994913,
"riskReversal15": -17.22339108067692,
"riskReversal15Change": -0.845673587563013,
"riskReversal10": -23.470751666873994,
"riskReversal10Change": -2.584312384927074,
"butterfly25": 5.544603300881889,
"butterfly25Change": 0.6189575146923119,
"butterfly15": 13.635872821994312,
"butterfly15Change": 1.8789098854322361,
"butterfly10": 21.412028418785653,
"butterfly10Change": 3.3225935151333346
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1775808000000,
"daysToExpiration": 10.333333333333334,
"underlyingPrice": 66751.51506573302,
"underlyingPriceChange": 790.7421954158781,
"atm": 53.355606314582595,
"atmChange": -0.17726155844774638,
"riskReversal25": -11.214382591116426,
"riskReversal25Change": -0.4129591272885662,
"riskReversal15": -17.6581197021927,
"riskReversal15Change": -1.0782800898028384,
"riskReversal10": -22.212551057972377,
"riskReversal10Change": -1.8218749009159794,
"butterfly25": 4.15687993309605,
"butterfly25Change": 0.6016776683697458,
"butterfly15": 9.857366007760064,
"butterfly15Change": 1.396449388260649,
"butterfly10": 15.10474158485708,
"butterfly10Change": 2.06879621590447
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1776412800000,
"daysToExpiration": 17.333333333333332,
"underlyingPrice": 66734.92109430616,
"underlyingPriceChange": 767.8198165054346,
"atm": 52.786529477022846,
"atmChange": 0.21946842500388897,
"riskReversal25": -10.183420916042486,
"riskReversal25Change": -0.524088790515961,
"riskReversal15": -16.023645060319673,
"riskReversal15Change": -0.7187633571963303,
"riskReversal10": -20.16130288231532,
"riskReversal10Change": -0.7708334669210899,
"butterfly25": 3.6613265613735706,
"butterfly25Change": 0.439709168035435,
"butterfly15": 8.686834201811209,
"butterfly15Change": 1.0403877108813049,
"butterfly10": 13.31970592550023,
"butterfly10Change": 1.5943835760817961
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1777017600000,
"daysToExpiration": 24.333333333333332,
"underlyingPrice": 66769.40935573772,
"underlyingPriceChange": 761.1547767822631,
"atm": 51.81466626029203,
"atmChange": 0.4671398153379869,
"riskReversal25": -9.81886052181921,
"riskReversal25Change": -0.22773739545914395,
"riskReversal15": -15.448616345777921,
"riskReversal15Change": -0.4514290955923883,
"riskReversal10": -19.422279632083175,
"riskReversal10Change": -0.6622663488734233,
"butterfly25": 3.8695790562186403,
"butterfly25Change": 0.2660326345940405,
"butterfly15": 9.196845964079628,
"butterfly15Change": 0.6359128980590896,
"butterfly10": 14.121460338927946,
"butterfly10Change": 0.9748421150958251
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1780041600000,
"daysToExpiration": 59.333333333333336,
"underlyingPrice": 66925.7663937458,
"underlyingPriceChange": 791.475743835792,
"atm": 50.57667695868516,
"atmChange": 0.018851817867428622,
"riskReversal25": -9.128186516132189,
"riskReversal25Change": 0.20870918528706994,
"riskReversal15": -14.429401624489536,
"riskReversal15Change": 0.17929378833321152,
"riskReversal10": -18.231661888110636,
"riskReversal10Change": 0.06427584368398698,
"butterfly25": 3.3983176684789385,
"butterfly25Change": 0.11585302990799562,
"butterfly15": 8.074554311991463,
"butterfly15Change": 0.28510090104344954,
"butterfly10": 12.393826639660759,
"butterfly10Change": 0.44296547857393875
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1782460800000,
"daysToExpiration": 87.33333333333333,
"underlyingPrice": 67101.21907748375,
"underlyingPriceChange": 815.8611620113079,
"atm": 49.81557568872005,
"atmChange": -0.018557064957683167,
"riskReversal25": -6.876053241793876,
"riskReversal25Change": 0.30867410397447514,
"riskReversal15": -11.916563632778455,
"riskReversal15Change": 0.40966590943714465,
"riskReversal10": -16.25941744845631,
"riskReversal10Change": 0.4214370049198237,
"butterfly25": 3.855925321005614,
"butterfly25Change": 0.06649553656491491,
"butterfly15": 9.486681211536492,
"butterfly15Change": 0.194360726633235,
"butterfly10": 14.96680778717824,
"butterfly10Change": 0.3477459211045044
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1790323200000,
"daysToExpiration": 178.33333333333334,
"underlyingPrice": 67614.21103627124,
"underlyingPriceChange": 839.7755951862346,
"atm": 50.7413566881773,
"atmChange": -0.3115526607052814,
"riskReversal25": -8.249123643654464,
"riskReversal25Change": 0.4492382082180839,
"riskReversal15": -12.940423298587575,
"riskReversal15Change": 0.5146875674412072,
"riskReversal10": -16.22479853930985,
"riskReversal10Change": 0.43615175111419546,
"butterfly25": 3.6718031027368028,
"butterfly25Change": 0.16680044436878916,
"butterfly15": 8.754088753189777,
"butterfly15Change": 0.3993083163852731,
"butterfly10": 13.480269548831203,
"butterfly10Change": 0.6045426450135523
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1798185600000,
"daysToExpiration": 269.3333333333333,
"underlyingPrice": 68296.68511462072,
"underlyingPriceChange": 816.1051804025628,
"atm": 51.00858930578338,
"atmChange": -0.14473501871818684,
"riskReversal25": -7.361576692874266,
"riskReversal25Change": 0.015469104004260714,
"riskReversal15": -11.535080725047642,
"riskReversal15Change": -0.007016876691409379,
"riskReversal10": -14.458811148937698,
"riskReversal10Change": -0.04475872738705533,
"butterfly25": 3.327124198422169,
"butterfly25Change": -0.011251136678012585,
"butterfly15": 7.935770510848769,
"butterfly15Change": -0.028033301790102882,
"butterfly10": 12.22740048881613,
"butterfly10Change": -0.04620298594664973
},
{
"base": "btc",
"quote": "usd",
"exchange": "drbt",
"expirationTimestamp": 1806048000000,
"daysToExpiration": 360.3333333333333,
"underlyingPrice": 68927.36411237593,
"underlyingPriceChange": 787.5765680319018,
"atm": 51.58353335060506,
"atmChange": 0.1200907170086225,
"riskReversal25": -6.054408876643393,
"riskReversal25Change": -0.2648394238791809,
"riskReversal15": -9.975199954276931,
"riskReversal15Change": -0.3459920923207278,
"riskReversal10": -13.077091571702319,
"riskReversal10Change": -0.349671557542095,
"butterfly25": 2.8383168392103357,
"butterfly25Change": 0.09041363740536212,
"butterfly15": 6.835599132518169,
"butterfly15Change": 0.19338494162127517,
"butterfly10": 10.612376834541877,
"butterfly10Change": 0.26676848701706035
}
],
"access": {
"access_range": {
"start_timestamp": 1763683200000,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}region
Yes
Choose between eu and us.
exchange
Yes
Should be one of the exchanges currently supported.
okex
exchange
The exchange where the specified instrument is being traded
drbt
instrument_class
exchange
The exchange where the specified instrument is being traded
drbt
instrument_class
exchange
The exchange where the specified instrument is being traded
drbt
instrument_class
exchange
The exchange where the specified instrument is being traded
drbt
instrument_class
Not the final Url.
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/https://nicole-preprod.k8s.kaiko.ovh/v3/data/derivatives/reference?exchange=drbt&instrument_class=perpetual-future&base_assets=btc"e_assets=usd&page_size=50'```pythonDepending on the Instrument class.
{
"result": "success",
"time": "2026-05-22T14:23:32Z",
"timestamp": 1779459812625,
"query": {
"base_assets": "btc",
"contract_type": "",
"end_time": "0001-01-01T00:00:00Z",
"exchange": "drbt",
"instrument_class": "perpetual-future",
"max_strike": "0",
"min_strike": "0",
"offset": "0",
"option_type": "",
"page_size": "1",
"request_time": "2026-05-22T14:23:32.25632683Z",
"start_time": "0001-01-01T00:00:00Z"
},
"data": [
{
"exchange": "drbt",
"instrument_class": "perpetual-future",
"instrument": "btc-usd",
"metadata": null,
"contract_details": {
"base": "btc",
"quote": "usd",
"settle_method": "cash",
"settle_timestamp": null,
"settle_currency": "btc",
"contract_type": "inverse",
"contract_periodicity": "perpetual",
"contract_size": "10",
"contract_size_unit": "usd",
"contract_multiplier": "1",
"funding_rate_frequency": "8h",
"listing_timestamp": "2018-08-14T10:24:47Z",
"underlying_type": "index",
"underlying_index": "btc_usd"
},
"status_details": {
"status": "tradable",
"last_updated": "2026-03-19T14:02:01Z",
"created_at": "2026-03-19T14:02:01Z"
}
}
],
"continuation_token": "2jtw7jtDEqGviMXUbzCyPMYCregKKZdhgxaB9DNJkoUPV3oYiFzkVi6V1YfyQx4vHaNtqWxE5rQq6yyj5SNp32T1etHnAn5ErCAkp6oyyqZ8PCZ2TsyFrQoCspu8R65fG",
"next_url": "https://nicole-preprod.k8s.kaiko.ovh/v3/data/derivatives/reference?continuation_token=2jtw7jtDEqGviMXUbzCyPMYCregKKZdhgxaB9DNJkoUPV3oYiFzkVi6V1YfyQx4vHaNtqWxE5rQq6yyj5SNp32T1etHnAn5ErCAkp6oyyqZ8PCZ2TsyFrQoCspu8R65fG",
"links": {
"next": "/v3/data/derivatives/reference?base_assets=btc&exchange=drbt&instrument_class=perpetual-future&offset=1&page_size=1&sort=desc"
},
"access": {
"access_range": {
"start_timestamp": 1688428800000,
"end_timestamp": 2177539199000
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}
{
"result": "success",
"time": "2026-05-22T14:25:05Z",
"timestamp": 1779459905388,
"query": {
"base_assets": "btc",
"contract_type": "",
"end_time": "0001-01-01T00:00:00Z",
"exchange": "drbt",
"instrument_class": "future",
"max_strike": "0",
"min_strike": "0",
"offset": "0",
"option_type": "",
"page_size": "1",
"request_time": "2026-05-22T14:25:05.042089802Z",
"start_time": "0001-01-01T00:00:00Z"
},
"data": [
{
"exchange": "drbt",
"instrument_class": "future",
"instrument": "btc3may26",
"metadata": null,
"contract_details": {
"base": "btc",
"quote": "usd",
"settle_method": "cash",
"settle_timestamp": "2026-05-03T08:00:00Z",
"settle_currency": "btc",
"contract_type": "inverse",
"contract_periodicity": "daily",
"contract_size": "10",
"contract_size_unit": "usd",
"contract_multiplier": "1",
"listing_timestamp": "2026-04-29T08:00:12Z",
"expiry": "2026-05-03T08:00:00Z",
"underlying_type": "index",
"underlying_index": "btc_usd"
},
"status_details": {
"status": "expired",
"last_updated": "2026-05-03T08:02:03Z",
"created_at": "2026-04-29T09:00:37Z"
}
}
],
"continuation_token": "81stiE1UXsBDQ7Rxs7pEGawJddeWa2hjK97BoKxHwGAHVPMq16hbtBwkpFg6XemnGNsbqDPWErKWYPikQS1PMXLQRrawD3SC9xnJEGKCmrvqzmBWGnn",
"next_url": "https://nicole-preprod.k8s.kaiko.ovh/v3/data/derivatives/reference?continuation_token=81stiE1UXsBDQ7Rxs7pEGawJddeWa2hjK97BoKxHwGAHVPMq16hbtBwkpFg6XemnGNsbqDPWErKWYPikQS1PMXLQRrawD3SC9xnJEGKCmrvqzmBWGnn",
"links": {
"next": "/v3/data/derivatives/reference?base_assets=btc&exchange=drbt&instrument_class=future&offset=1&page_size=1&sort=desc"
},
"access": {
"access_range": {
"start_timestamp": 1688428800000,
"end_timestamp": 2177539199000
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}
{
"result": "success",
"time": "2026-05-22T14:26:16Z",
"timestamp": 1779459976597,
"query": {
"base_assets": "btc",
"contract_type": "",
"end_time": "0001-01-01T00:00:00Z",
"exchange": "drbt",
"instrument_class": "option",
"max_strike": "0",
"min_strike": "0",
"offset": "0",
"option_type": "",
"page_size": "1",
"request_time": "2026-05-22T14:26:16.141321369Z",
"start_time": "0001-01-01T00:00:00Z"
},
"data": [
{
"exchange": "drbt",
"instrument_class": "option",
"instrument": "btcusdc21jan2686000c",
"metadata": null,
"contract_details": {
"base": "btc",
"quote": "usdc",
"settle_method": "cash",
"settle_timestamp": "2026-01-21T08:00:00Z",
"settle_currency": "usdc",
"contract_type": "linear",
"contract_periodicity": "daily",
"contract_size": "1",
"contract_size_unit": "btc",
"contract_multiplier": "1",
"listing_timestamp": "2026-01-20T15:09:00Z",
"expiry": "2026-01-21T08:00:00Z",
"underlying_type": "index",
"underlying_index": "btc_usdc",
"strike_price": "86000",
"kind": "call",
"option_type": "european"
},
"status_details": {
"status": "expired",
"last_updated": "2026-03-19T14:02:01Z",
"created_at": "2026-03-19T14:02:01Z"
}
}
],
"continuation_token": "81stiE1UXsBDQ7Rxs7pEGawJddeWa2hjK97BoKxHwGAHVPMq16hbtBwkpFg6XemnGgL6hNMUcpL8BGgvppEn6Xe6AygJabvj94KQ5Lsr39eX8wUX1Vk",
"next_url": "https://nicole-preprod.k8s.kaiko.ovh/v3/data/derivatives/reference?continuation_token=81stiE1UXsBDQ7Rxs7pEGawJddeWa2hjK97BoKxHwGAHVPMq16hbtBwkpFg6XemnGgL6hNMUcpL8BGgvppEn6Xe6AygJabvj94KQ5Lsr39eX8wUX1Vk",
"links": {
"next": "/v3/data/derivatives/reference?base_assets=btc&exchange=drbt&instrument_class=option&offset=1&page_size=1&sort=desc"
},
"access": {
"access_range": {
"start_timestamp": 1688428800000,
"end_timestamp": 2177539199000
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}
{
"result": "success",
"time": "2026-05-22T14:33:33Z",
"timestamp": 1779460413054,
"query": {
"base_assets": "btc",
"contract_type": "",
"end_time": "0001-01-01T00:00:00Z",
"exchange": "drbt",
"instrument_class": "future_combo",
"max_strike": "0",
"min_strike": "0",
"offset": "0",
"option_type": "",
"page_size": "2",
"request_time": "2026-05-22T14:33:32.674149702Z",
"start_time": "0001-01-01T00:00:00Z"
},
"data": [
{
"exchange": "drbt",
"instrument_class": "future_combo",
"instrument": "btcfs13apr2610apr26",
"metadata": null,
"contract_details": {
"base": "btc",
"quote": "usd",
"settle_method": "cash",
"settle_timestamp": "2026-04-10T08:00:00Z",
"settle_currency": "btc",
"contract_type": "inverse",
"contract_periodicity": "weekly",
"contract_size": "10",
"contract_size_unit": "usd",
"contract_multiplier": "1",
"listing_timestamp": "2026-04-09T08:00:12Z",
"expiry": "2026-04-10T08:00:00Z",
"underlying_type": "index",
"underlying_index": "btc_usd",
"combo_details": {
"combo_type": "spread",
"combo_structure": [
{
"leg_symbol": "BTC-13APR26",
"leg_side": "buy",
"leg_multiplier": "1"
},
{
"leg_symbol": "BTC-10APR26",
"leg_side": "sell",
"leg_multiplier": "1"
}
]
}
},
"status_details": {
"status": "expired",
"last_updated": "2026-04-10T08:01:42Z",
"created_at": "2026-04-09T09:00:22Z"
}
}
],
"continuation_token": "GRHx3R5pjLAU2SNRDiECw4PpBQh3RCLxb8uHK5kiWiXF9xVCssFzhqmWwEFGtv9XPNMJ8TKWvW6dtdWNjB2XXCevZKbauXn2ic1387zTNhaP2Y3KxKssjerr6ne",
"next_url": "https://nicole-preprod.k8s.kaiko.ovh/v3/data/derivatives/reference?continuation_token=GRHx3R5pjLAU2SNRDiECw4PpBQh3RCLxb8uHK5kiWiXF9xVCssFzhqmWwEFGtv9XPNMJ8TKWvW6dtdWNjB2XXCevZKbauXn2ic1387zTNhaP2Y3KxKssjerr6ne",
"links": {
"next": "/v3/data/derivatives/reference?base_assets=btc&exchange=drbt&instrument_class=future_combo&offset=1&page_size=2&sort=desc"
},
"access": {
"access_range": {
"start_timestamp": 1688428800000,
"end_timestamp": 2177539199000
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}
https://<eu|us>.market-api.kaiko.io/v3/data/derivatives/referenceLevel 1 & Level 2 Data [Level 1 Tick-Level Tier]
Level 1 & Level 2 Data [Level 2 Aggregations Tier]
Level 1 & Level 2 Data [Level 2 Tick-Level Tier]
Tick-level data is the most granular level of trading data and contains every single trade that occurs on centralized and decentralized exchanges. The data is normalized and timestamped and contains information such as the price and volume of each trade. For DEXs specifically, we also provide additional information on the user address, the blockchain, the pool address, and the transaction hash related to the trade.
https://{region}.market-api.kaiko.io/v3/data/trades.v1/exchanges/{exchange}/{instrument_class}/{instrument}/tradesregion
Yes
instrument_class
Yes
future, perpetual-future, option, future_combo or option_combo
future
contract_type
No
linear, inverse, or quanto
If not used, all per default
For finding either the Linear or Inverse contracts.
linear
instrument
No
Instrument code. (kaiko_legacy_code)
See
ethusd220624, btc*220624, *usdt, btc*may22*
base_assets
No
For finding the instruments with the certain base asset
btc, eth
quote_assets
No
For finding the instruments with the certain quote asset
usd, usdt
option_type
No
option only. For finding either only the call options or put options
C, P
min_strike
No
option only. Used to retrieve options whose strike price is above this minimum value (exclusive/inclusive)
10000
max_strike
No
option only. Used to retrieve options whose strike price is below this maximum value (exclusive/inclusive)
90000
start_time
No
future & option only. Used to retrieve futures and options that expire after this date and time (inclusive)
2022-06-23T00:01:00.000Z
end_time
No
future & option only. Used to retrieve futures and options that are listed before this date and time (exclusive)
2022-06-25T23:59:00.000Z
page_size
No
Number of snapshots to return data for. (default: 1000, min: 1, max: 10000). See
500
Shows the specified instrument class.
perpetual-future
instrument
The specified instrument
btc-usd
base
The base asset of the instrument
btc
quote
The unit in which the instrument is quoted
usd
settle_currency
Currency used for settlement
btc
settle_method
Always cash (for future use)
cash
contract_type
Type of the contract
inverse
contract_periodicity
Possible values: perpetual
perpetual
contract_size
Size of the contract
10
contract_size_unit
Unit in which contract is denominated
usd
contract_multiplier
1
listing_timestamp
(UTC) Date listed by exchange
2018-09-14T10:24:47Z
funding_rate_frequency
Interval at which the funding rate is calculated (paid) for payoff.
8h
status
Status of the Derivative Contract. Possible values:
listed, tradable, delisted
tradable
last_updated
Date and time of the last update.
2018-09-21T10:20:00Z
Shows the specified instrument class.
future
instrument
The specified instrument
btcusdc29may26
base
The base asset of the instrument
btc
quote
The unit in which the instrument is quoted
usdc
settle_currency
Currency used for settlement
usdc
settle_timestamp
Date and time of the settlement if provided by the Exchange (expiry per default)
2026-03-31T08:00:00Z
settle_method
For future use. Default = cash
cash
contract_type
Type of the contract
linear
contract_periodicity
Possible values: daily, monthly, quarterly
monthly
contract_size
Size of the contract
0.0001
contract_size_unit
Unit in which contract is denominated
btc
contract_multiplier
1
listing_timestamp
The timestamp (UTC) when the contract is listed on the exchange
2026-03-31T10:43:48Z
expiry
Expiration date of the contract
2026-03-31T08:00:00Z
status
Status of the Derivative Contract. Possible values:
listed, tradable, expired, delisted
delisted
last_updated
Date and time of the last update.
2026-03-31T11:01:20Z
Shows whether the specified instrument is
option
instrument
The specified instrument
btcusdc21jan2686000c
base
The base asset of the instrument
btc
quote
The unit in which the instrument is quoted
usdc
settle_currency
Currency used for settlement
usdc
settle_timestamp
Date and time of the settlement if provided by the Exchange (expiry per default)
2026-01-20T08:00:00Z
settle_method
Always cash (for future use)
cash
contract_type
Type of the contract
linear
contract_periodicity
Possible values: daily, monthly, quarterly
daily
contract_size
Size of the contract
1
contract_size_unit
Unit in which contract is denominated
btc
contract_multiplier
1
listing_timestamp
The (UTC) timestamp when a certain option instrument is listed on the exchange
2026-01-20T15:09:00Z
expiry
Expiration (UTC) date of the contract
2026-01-20T08:00:00Z
strike_price
The strike price of the contract in USD.
30000
kind
It explains what the option does, the direction of the right.
Note: it reflects the option_type from the Query parameters.
call
option_type
This defines when the option can be exercised. In other words, it is the exercise period. european american
european
underlying_type
For future use. Default = index
index
underlying_index
Name of the underlying asset
btc_usdc
status
Status of the Derivative Contract. Possible values:
listed, tradable, expired, delisted
expired
last_updated
Date and time of the last update.
2026-01-20T15:09:00Z
Shows whether the specified instrument is
option_combo
instrument
The specified instrument
btcps27mar263000020000
base
The base asset of the instrument
btc
quote
The unit in which the instrument is quoted
usdc
settle_currency
Currency used for settlement
usdc
settle_timestamp
Date and time of the settlement if provided by the Exchange (expiry per default)
2026-01-20T08:00:00Z
settle_method
Always cash (for future use)
cash
contract_type
Type of the contract
linear
contract_periodicity
Possible values: daily, monthly, quarterly
daily
contract_size
Size of the contract
1
contract_size_unit
Unit in which contract is denominated
btc
contract_multiplier
listing_timestamp
The (UTC) timestamp when a certain option instrument is listed on the exchange
2026-02-05T23:08:33Z
expiry
Expiration (UTC) date of the contract. The expiry should be the latest in time from the various legs.
2026-03-27T08:00:00Z
underlying_type
For future use. Default = index
index
underlying_index
Name of the underlying asset
btc_usdc
combo_type
type of the combo (strategy)
straddle
leg_symbol
Exchange contract (instrument) related to the leg
BTC-27MAR26-30000-P
leg_side
Side of the leg buy or sell
buy
leg_multiplier
Number of contract in involved in the related leg.
1
status
Status of the Derivative Contract. Possible values:
listed, tradable, expired, delisted
expired
last_updated
Date and time of the last update.
2026-01-20T15:09:00Z
Choose between eu and us.
exchange
Yes
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
end_time
No
timestamp
The timestamp provided by the exchange or the collection timestamp in Unix Timestamp (in milliseconds)
trade_id
Unique trade ID (unique to the exchange). In case the exchange does not provide an ID, we generate it ourselves.
price
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "cbse"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = "100"
start_time= "2023-01-01T00:00:00Z"
end_time= "2023-01-01T00:03:00Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/{exchange}/{instrument_class}/{pair}/trades'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size)){
"query": {
"page_size": 100,
"exchange": "bfnx",
"instrument_class": "spot",
"instrument": "btc-usd",
"sort": "desc",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:33:20.575Z"
},
"time": "2020-11-12T16:33:20.869Z",
"timestamp": 1605198800869,
"data": [
{
"timestamp": 1605198775855,
"trade_id": "522419198",
"price": "16026",
"amount": "0.025",
"taker_side_sell": true
},
{
"timestamp": 1605198775031,
"trade_id": "522419197",
"price": "16026",
"amount": "0.01",
"taker_side_sell": true
},
/* ... */
],
"result": "success",
"continuation_token": "rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?continuation_token=rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}{
"query": {
"page_size": 100,
"exchange": "bfnx",
"instrument_class": "spot",
"instrument": "btc-usd",
"sort": "desc",
"data_version": "v1",
"commodity": "trades",
"request_time": "2020-11-12T16:33:20.575Z"
},
"time": "2020-11-12T16:33:20.869Z",
"timestamp": 1605198800869,
"data": [
{
"timestamp": 1605198775855,
"trade_id": "522419198",
"price": "16026",
"amount": "0.025",
"taker_side_sell": true
},
{
"timestamp": 1605198775031,
"trade_id": "522419197",
"price": "16026",
"amount": "0.01",
"taker_side_sell": true
},
/* ... */
],
"result": "success",
"continuation_token": "rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"next_url": "https://us.market-api.kaiko.io/v2/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?continuation_token=rbd28vrmb1cwaxfykuJBKAABhNi1Bfv1EY55P3QPSnYnm8VuX1LqLhA2d3yVfYgMKtfBYxJg7sHrkTfkQGysW23Lm9Lp9rsVpVk2Esmgz9VQZvNE4xWN8hh3LgLrCa7ty4B3YGCwtH",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
page_size
No
See Pagination Automatically included in continuation tokens.
continuation_token
No
See Pagination
sort
No
Return the data in ascending (asc) or descending (desc) order. Default desc.
blockchain
No
Filter on a specific blockchain. (Default: ethereum).
pool_address
No
Filter on a specific pool address.
transaction_hash
No
Filter on a specific transaction hash. (Several trades can happen within a single transaction).
user_address
No
Filter on a specific address.
start_block
No
Starting block height (inclusive).
end_block
No
Ending block height (inclusive).
Price displayed in quote currency.
amount
Quantity of asset bought or sold (can be in base_asset, quote_asset or the number of contracts).
taker_side_sell
blockchain
The blockchain on which the trade happened.
transaction_hash
Transaction hash.
log_index
The log index of the transaction (in base 10).
pool_address
The address of the pool in which the trade happened.
user_address
Address that triggered the transaction.
Kaiko Portfolio Risk & Performance
This endpoints helps you calculate Value at Risk (VaR) and stressed VaR. Computed by a proprietary and thoroughly backtested methodology that accounts for the idiosyncrasies of crypto market structure. By convention, it's a forecasting VaR, i.e., the prediction of the potential loss for the next day. It includes a mixture parameter that can provide either the VaR, the stressed VaR, or a combination of the two (see the stress_parameter below).
https://us.market-api.kaiko.io/v2/data/analytics.v2/value_at_riskbases
Yes
List of portfolio base components. See
Total must match quantities below.
The order of bases and their respective quantities must match in the request.
quote
Yes
The fiat currency.
quantities
Yes
Quantities list of base asset in the portfolio.
Must match the number of bases.
The order of quantities and their respective bases must match in the request.
risk_level
Yes
The Value at Risk confidence level.
Min: 0.90 (included)
Max: 1 (excluded)
start_time
Yes
First fixing of the calculation in ISO 8601 (inclusive).
end_time
Yes
Last fixing of the calculation in ISO 8601 (inclusive).
stress_parameter
No
Float between 0 and 1 that controls the blend between VaR and Stressed VaR.
It is 0 for VaR and 1 for Stressed VaR. It equals 0 by default.
reporting_currency
No
This allows you to express the final risk metrics in a specific fiat currency.
By default, expressed in USD.
sources
No
boolean. If true, returns all pair prices which were used to compute the Value at Risk.
Default: false
var_time
The time at which the VaR is computed.
value_at_risk
Composed of two fields: value and risk_level (the Value at Risk estimator at the specified risk_level.)
pair
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/analytics.v2/value_at_risk?bases=eth,btc,ltc&quantities=3,2,5"e=usd&risk_level=0.95&start_time=2025-12-01T00:00:00.000Z&end_time=2025-12-05T00:00:00.000Z&stress_parameter=0.5'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
bases = "btc,eth"
quote = "usd"
quantities = "1,10"
risk_level = "0.95"
start_time = "2021-12-01T00:00:00.000Z"
end_time = "2022-01-31T00:00:00.000Z"
# ---- Optional parameters ---- #
sources = None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, bases: str, quote: str, quantities: str, risk_level: str, start_time: str, end_time: str, sources: bool = None):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/analytics.v2/value_at_risk'
params = {
"bases": bases,
"quote": quote,
"quantities": quantities,
"risk_level": risk_level,
"start_time": start_time,
"end_time": end_time,
"sources": sources
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, bases=bases, quote=quote, quantities=quantities, risk_level=risk_level, start_time=start_time, end_time=end_time, sources=sources)
print (df){
"query": {
"bases": "eth,btc,ltc",
"quote": "usd",
"quantities": [
3,
2,
5
],
"exchanges": "",
"risk_level": 0.95,
"sources": false,
"data_version": "v2",
"commodity": "analytics",
"request_time": "2026-04-01T14:02:10.954Z",
"reporting_currency": ""
},
"time": "2026-04-01T14:02:11.316Z",
"timestamp": 1775052131316,
"data": [
{
"var_time": 1764547200000,
"value_at_risk": {
"value": 14051.3051028357,
"risk_level": 0.95
}
},
{
"var_time": 1764633600000,
"value_at_risk": {
"value": 13896.656231419009,
"risk_level": 0.95
}
},
{
"var_time": 1764720000000,
"value_at_risk": {
"value": 14243.618215415132,
"risk_level": 0.95
}
},
{
"var_time": 1764806400000,
"value_at_risk": {
"value": 14366.155261745589,
"risk_level": 0.95
}
},
{
"var_time": 1764892800000,
"value_at_risk": {
"value": 14317.703400730708,
"risk_level": 0.95
}
}
],
"start_date": "2021-12-01T00:00:00.000Z",
"access": {
"access_range": {
"start_timestamp": 1763683200,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}The constituent pair. (showing only when sources is set to be true)
ref_price
The reference price per asset. (showing only when sources is set to be true)
date
The date of the reference price. (showing only when sources is set to be true)
Kaiko Derivatives Risk Indicators [Advanced Tier]
The IV surface endpoint lets you calculate volatility from options market prices. Feed the endpoint a set of maturity dates or timeframes for when options can be exercised, and you'll receive a volatility surface, which shows how volatility changes over different dates and prices.
You can get volatility estimates based on:
A specific set of strike prices
A forward-log-moneyness grid
A specific set of delta values
A delta grid
The calculation methodology leverages space and time interpolation.
Currently supported assets and exchanges:
BTC, ETH, SOL, and XRP on Deribit.
BTC, ETH on OKX.
BTC, ETH on Deribit & OKX (aggregated).
If you need data from other exchanges, we can add them on request.
Read our Implied Volatility Methodology .
Use this example to calculate IV Surface using Deltas.
Use this example to calculate IV Surface using forward log moneyness.
Use this example to calculate IV Surface using strikes.
Yes
The desired quote as the underlying of the options. See asset support above.
usd
exchanges
Yes
The desired exchange as source of options data. See exchange support above.
drbt
value_time
Yes
The time at which to compute implied volatilities The time t should be smaller than the lowest requested expiry.
2022-06-25T16:00:00.000Z
expiry_list
Yes, if the set of parameters (tte_min, tte_max, tte_step) is not used.
The expiries for which the implied volatilities are to be computed. Expiries can be listed or non-listed ones.
Expiries should be between minimum and maximum listed maturities on exchange. If not, a partial output will be returned.
Either expiry_list or (tte_min, tte_max, tte_step) should be filled.
expiry_list=2022-08-28T08:00:00.000Z, 2022-08-30T08:00:00.000Z
or tte_min=0.034288&tte_max=1&tte_step=0.02
tte_min
Yes, if expiry_list is not used. To be used along with tte_max, tte_step.
Minimum time-to-expiry on the time grid.
Strictly positive value allowed.
If the `tte_min` is below the time to expiry associated with the minimum listed maturity, partial output will be returned.
Either expiry_list or (tte_min, tte_max
0.034288
tte_max
Yes, if expiry_list is not used. To be used along with tte_min, tte_step.
Maximum time-to-expiry on the time grid.
Strictly positive value above the `tte_min`.
If the `tte_max` is above the time to expiry associated with the maximum listed maturity, partial output will be returned.
Either expiry_list or (tte_min, tte_max,tte_step) should be filled.
1
tte_step
Yes, if expiry_list is not used. To be used along with tte_min, tte_max.
Step between two time-to-expiries in time grid.
Strictly positive value allowed.
Either expiry_list or (tte_min, tte_max, tte_step) should be filled.
0.02
strike_list
Yes, if the set of parameters (f_log_min, f_log_max, f_log_step) or deltas or the set of parameters (delta_min, delta_max, delta_step) are not used.
The strike prices for which the implied volatilities are to be computed. Strike prices can be listed or non-listed ones.
Strictly positives values allowed.
Either strike_list , (f_log_m_min, f_log_m_max, f_log_m_step), deltas or
(delta_min
strike_list=25000, 29150, 29155, 29160
or f_log_m_min=-1.5&f_log_m_max=1.5&f_log_m_step=0.05
f_log_m_min
Yes, if strike_list or deltas or the set of parameters (delta_min, delta_max, delta_step) are not used.
To be used along with f_log_m_max, f_log_m_step.
Minimum forward log-moneyness on the space grid.
Either strike_list , (f_log_m_min, f_log_m_max, f_log_m_step), deltas or
(delta_min, delta_max, delta_step) should be filled.
-1.5
f_log_m_max
Yes, if strike_list or deltas or the set of parameters (delta_min, delta_max, delta_step) are not used.
To be used along with f_log_m_min, f_log_m_step.
Maximum forward log-moneyness on the space grid.
Either strike_list , (f_log_m_min, f_log_m_max, f_log_m_step), deltas or
(delta_min, delta_max, delta_step) should be filled.
1
f_log_m_step
Yes, if strike_list or deltas or the set of parameters (delta_min, delta_max, delta_step) are not used.
To be used along with f_log_m_min, f_log_m_max.
Step between two forward log moneyness in space grid.
Either strike_list , (f_log_m_min, f_log_m_max, f_log_m_step), deltas or
(delta_min, delta_max, delta_step) should be filled.
0.02
deltas
Yes, if strike_list or the sets of parameters (delta_min, delta_max, delta_step) or (f_log_m_min, f_log_m_max, f_log_m_step) are not used.
The delta levels (of a Call option) for which the implied volatilities are to be computed.
Only delta values between 0.01 and 0.99 are allowed.
Either strike_list , (f_log_m_min, f_log_m_max, f_log_m_step
deltas=0.25,0.5,0.75
delta_min
Yes, if strike_list or deltas or the set of parameters (f_log_m_min, f_log_m_max, f_log_m_step) are not used. To be used along with delta_max, delta_step.
Minimum delta (of a Call option) on the space grid.
Only delta values between 0.01 and 0.99 are allowed.
Either strike_list , (f_log_m_min, f_log_m_max, f_log_m_step
0.01
delta_max
Yes, if strike_list or deltas or the set of parameters (f_log_m_min, f_log_m_max, f_log_m_step) are not used. To be used along with delta_min, delta_step.
Maximum delta (of a Call option) on the space grid.
Only delta values between 0.01 and 0.99 are allowed.
Either strike_list , (f_log_m_min, f_log_m_max, f_log_m_step
0.99
delta_step
Yes, if strike_list or deltas or the set of parameters (f_log_m_min, f_log_m_max, f_log_m_step) are not used. To be used along with delta_min, delta_max.
Step between two deltas (of a Call option) on the space grid.
Either strike_list , (f_log_m_min, f_log_m_max, f_log_m_step), deltas or
(delta_min, delta_max, delta_step) should be filled.
expiry
The expiry at which the IV has been interpolated.
2022-08-28T08:00:00Z
time_to_expiry
The associated time-to-expiry (in year).
0.17442922374429223
strike
The strike at which the IV has been computed. Not provided when the input is a delta list.
265.88827409960714
forward_log_moneyness
The associated forward log-moneyness. Not provided when the input is a delta list.
-1.5
implied_volatility
The calibrated and interpolated implied volatilities.
1.8088997727784055
delta
The first derivative of the price (of a Call option) with regards to the underlying price
-0.009058250602524742
gamma
The second derivative of the price with regards to the underlying price
0.000027152549142705487
vega
The first derivative of the price with regards to implied volatility.
18.73162001892539
theta
The first derivative of the price with regards to the passage of time (or time to expiration).
-194.40147413397432
interest_rate
The implied interest rate.
0.14954983972466698
current_spot
The underlying spot price at the value timestamp.
71717
https://{eu/us}.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_surfaceregion
Yes
Choose between eu and us.
base
Yes
The desired base as the underlying of the options. See asset support above.
btc, eth
complete_output
This indicates whether the output covers the entire requested range within the listed expiries, or only the valid subset.
True
value_time
The time in parameter
https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_surface?base=btc"e=usd&exchanges=drbt%2Cokex&value_time=2024-09-12T10%3A00%3A00.000Z&expiry_list=2024-09-20T08%3A00%3A00.000Z%2C2024-09-27T08%3A00%3A00.000Z%2C2024-10-04T08%3A00%3A00.000Z%2C2024-10-25T08%3A00%3A00.000Z%2C2024-11-08T08%3A00%3A00.000Z&delta_min=0.1&delta_max=0.9&delta_step=0.1https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_surface?base=btc"e=usd&exchanges=drbt&value_time=2024-09-12T10%3A00%3A00.000Z&tte_min=0.01&tte_max=1.&tte_step=0.02&f_log_m_min=-0.5&f_log_m_max=0.5&f_log_m_step=0.5https://us.market-api.kaiko.io/v2/data/analytics.v2/implied_volatility_surface?base=btc"e=usd&exchanges=drbt&value_time=2024-09-12T10%3A00%3A00.000Z&tte_min=0.01&tte_max=1.&tte_step=0.02&strike_list=55000%2C56000%2C57000%2C58000%2C59000%2C60000{
"query":{
"base":"btc",
"quote":"usd",
"exchanges":[
"drbt",
"okex"
],
"value_time":"2024-09-12T10:00:00.000Z",
"data_version":"v2",
"commodity":"analytics",
"request_time":"2024-09-12T17:12:07.699Z"
},
"time":"2024-09-12T17:12:07.699Z",
"timestamp":1726161128874,
"complete_output":true,
"data":[
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-09-20T08:00:00.000Z",
"time_to_expiry":0.021689497716894976,
"implied_volatilities":[
{
"implied_volatility":0.55567045411767,
"delta":0.1,
"interest_rate":0.05222290146213202,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5304086533216835,
"delta":0.2,
"interest_rate":0.05222290146213202,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5204807466788227,
"delta":0.30000000000000004,
"interest_rate":0.05222290146213202,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5176080670107802,
"delta":0.4,
"interest_rate":0.05222290146213202,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5198235126846833,
"delta":0.5,
"interest_rate":0.05222290146213202,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5271474253673343,
"delta":0.6,
"interest_rate":0.05222290146213202,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5412722397557681,
"delta":0.7,
"interest_rate":0.05222290146213202,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5672860200574902,
"delta":0.7999999999999999,
"interest_rate":0.05222290146213202,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.6234279466167519,
"delta":0.8999999999999999,
"interest_rate":0.05222290146213202,
"current_spot":58033.01112255454
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-09-27T08:00:00.000Z",
"time_to_expiry":0.0408675799086758,
"implied_volatilities":[
{
"implied_volatility":0.5621097108504748,
"delta":0.1,
"interest_rate":0.052497499225334636,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5272061410113572,
"delta":0.2,
"interest_rate":0.052497499225334636,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5131506051610666,
"delta":0.30000000000000004,
"interest_rate":0.052497499225334636,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5082456534252546,
"delta":0.4,
"interest_rate":0.052497499225334636,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5095651826004636,
"delta":0.5,
"interest_rate":0.052497499225334636,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.51677777797711,
"delta":0.6,
"interest_rate":0.052497499225334636,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5314642342464321,
"delta":0.7,
"interest_rate":0.052497499225334636,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5587288797341338,
"delta":0.7999999999999999,
"interest_rate":0.052497499225334636,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.6167183766301421,
"delta":0.8999999999999999,
"interest_rate":0.052497499225334636,
"current_spot":58033.01112255454
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-10-04T08:00:00.000Z",
"time_to_expiry":0.06004566210045662,
"implied_volatilities":[
{
"implied_volatility":0.5666208561497174,
"delta":0.1,
"interest_rate":0.06524195117082478,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5323692982650756,
"delta":0.2,
"interest_rate":0.06524195117082478,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5186955773995799,
"delta":0.30000000000000004,
"interest_rate":0.06524195117082478,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5138985541028067,
"delta":0.4,
"interest_rate":0.06524195117082478,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5150201900956664,
"delta":0.5,
"interest_rate":0.06524195117082478,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5216164561118771,
"delta":0.6,
"interest_rate":0.06524195117082478,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5349940736116142,
"delta":0.7,
"interest_rate":0.06524195117082478,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5595467577751186,
"delta":0.7999999999999999,
"interest_rate":0.06524195117082478,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.6109550611499716,
"delta":0.8999999999999999,
"interest_rate":0.06524195117082478,
"current_spot":58033.01112255454
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-10-25T08:00:00.000Z",
"time_to_expiry":0.11757990867579908,
"implied_volatilities":[
{
"implied_volatility":0.5922138420961504,
"delta":0.1,
"interest_rate":0.06444166091264596,
"current_spot":58033.0026110549
},
{
"implied_volatility":0.5520922097809197,
"delta":0.2,
"interest_rate":0.06444166091264596,
"current_spot":58033.0026110549
},
{
"implied_volatility":0.5329630080551225,
"delta":0.30000000000000004,
"interest_rate":0.06444166091264596,
"current_spot":58033.0026110549
},
{
"implied_volatility":0.5231218680220053,
"delta":0.4,
"interest_rate":0.06444166091264596,
"current_spot":58033.0026110549
},
{
"implied_volatility":0.5194493140150083,
"delta":0.5,
"interest_rate":0.06444166091264596,
"current_spot":58033.0026110549
},
{
"implied_volatility":0.5213876755567547,
"delta":0.6,
"interest_rate":0.06444166091264596,
"current_spot":58033.0026110549
},
{
"implied_volatility":0.5302377211015243,
"delta":0.7,
"interest_rate":0.06444166091264596,
"current_spot":58033.0026110549
},
{
"implied_volatility":0.550749699660159,
"delta":0.7999999999999999,
"interest_rate":0.06444166091264596,
"current_spot":58033.0026110549
},
{
"implied_volatility":0.6010333506232379,
"delta":0.8999999999999999,
"interest_rate":0.06444166091264596,
"current_spot":58033.0026110549
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-11-08T08:00:00.000Z",
"time_to_expiry":0.15593607305936072,
"implied_volatilities":[
{
"implied_volatility":0.6624300907047234,
"delta":0.1,
"interest_rate":0.06396819887540026,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.6181620638701805,
"delta":0.2,
"interest_rate":0.06396819887540026,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5977210831388879,
"delta":0.30000000000000004,
"interest_rate":0.06396819887540026,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5873014915704046,
"delta":0.4,
"interest_rate":0.06396819887540026,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5831399288267296,
"delta":0.5,
"interest_rate":0.06396819887540026,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5842407024308494,
"delta":0.6,
"interest_rate":0.06396819887540026,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.5912675169813805,
"delta":0.7,
"interest_rate":0.06396819887540026,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.6074281344387386,
"delta":0.7999999999999999,
"interest_rate":0.06396819887540026,
"current_spot":58033.01112255454
},
{
"implied_volatility":0.6449624313701908,
"delta":0.8999999999999999,
"interest_rate":0.06396819887540026,
"current_spot":58033.01112255454
}
]
}
],
"result":"success",
"access":{
"access_range":{
"start_timestamp":1262304000000,
"end_timestamp":1924991999000
},
"data_range":{
"start_timestamp":1262304000000,
"end_timestamp":1924991999000
}
}
}{
"query":{
"base":"btc",
"quote":"usd",
"exchanges":[
"drbt"
],
"value_time":"2024-09-12T10:00:00.000Z",
"data_version":"v2",
"commodity":"analytics",
"request_time":"2024-09-13T10:22:26.108Z"
},
"time":"2024-09-13T10:22:26.108Z",
"timestamp":1726222946604,
"complete_output":false,
"data":[
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-09-16T01:36:00.000Z",
"time_to_expiry":0.01,
"implied_volatilities":[
{
"strike":35205.07731688165,
"forward_log_moneyness":-0.5,
"implied_volatility":1.219961822819801,
"delta":0.9999840518413259,
"gamma":9.862878922173833e-09,
"interest_rate":0.029882129261974883,
"current_spot":58026.01780838781
},
{
"strike":58043.35980898536,
"forward_log_moneyness":0,
"implied_volatility":0.47173352808037106,
"delta":0.5094088500573186,
"gamma":0.00014570314379410554,
"interest_rate":0.029882129261974883,
"current_spot":58026.01780838781
},
{
"strike":95697.3219399751,
"forward_log_moneyness":0.5,
"implied_volatility":0.9995009904225983,
"delta":3.662902785528388e-07,
"gamma":3.2466205143302194e-10,
"interest_rate":0.029882129261974883,
"current_spot":58026.01780838781
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-09-23T08:48:00.000Z",
"time_to_expiry":0.03,
"implied_volatilities":[
{
"strike":35258.65197953432,
"forward_log_moneyness":-0.5,
"implied_volatility":1.0227076131194504,
"delta":0.998199924676951,
"gamma":5.605337511004371e-07,
"interest_rate":0.06064841675926235,
"current_spot":58026.01780838785
},
{
"strike":58131.68949487142,
"forward_log_moneyness":0,
"implied_volatility":0.5150355416768742,
"delta":0.517788278262302,
"gamma":7.69939568408782e-05,
"interest_rate":0.06064841675926235,
"current_spot":58026.01780838785
},
{
"strike":95842.95297192968,
"forward_log_moneyness":0.5,
"implied_volatility":0.8521845389437603,
"delta":0.00046039932852065535,
"gamma":1.922319739897016e-07,
"interest_rate":0.06064841675926235,
"current_spot":58026.01780838785
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-09-30T16:00:00.000Z",
"time_to_expiry":0.05,
"implied_volatilities":[
{
"strike":35306.34125006645,
"forward_log_moneyness":-0.5,
"implied_volatility":0.9000176772559828,
"delta":0.9951324086246934,
"gamma":1.2089704742589137e-06,
"interest_rate":0.06342187503569374,
"current_spot":58026.01780838792
},
{
"strike":58210.3158095819,
"forward_log_moneyness":0,
"implied_volatility":0.51382233838562,
"delta":0.522905471292496,
"gamma":5.9740914598632886e-05,
"interest_rate":0.06342187503569374,
"current_spot":58026.01780838792
},
{
"strike":95972.58584942963,
"forward_log_moneyness":0.5,
"implied_volatility":0.7922110861857629,
"delta":0.0031285593939101575,
"gamma":9.243683297678397e-07,
"interest_rate":0.06342187503569374,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-10-07T23:12:00.000Z",
"time_to_expiry":0.07,
"implied_volatilities":[
{
"strike":35360.71890845669,
"forward_log_moneyness":-0.5,
"implied_volatility":0.828127141031331,
"delta":0.9916123215219155,
"gamma":1.7972889965676697e-06,
"interest_rate":0.06728679739793171,
"current_spot":58026.01780838783
},
{
"strike":58299.96941162078,
"forward_log_moneyness":0,
"implied_volatility":0.5164706953874756,
"delta":0.5272356033058659,
"gamma":5.0197042263844037e-05,
"interest_rate":0.06728679739793171,
"current_spot":58026.01780838783
},
{
"strike":96120.39965010602,
"forward_log_moneyness":0.5,
"implied_volatility":0.7464559932842119,
"delta":0.0074875726771543305,
"gamma":1.8044884826225764e-06,
"interest_rate":0.06728679739793171,
"current_spot":58026.01780838783
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-10-15T06:24:00.000Z",
"time_to_expiry":0.09000000000000001,
"implied_volatilities":[
{
"strike":35408.60142607324,
"forward_log_moneyness":-0.5,
"implied_volatility":0.7910724424510162,
"delta":0.986976336148381,
"gamma":2.4347028120210604e-06,
"interest_rate":0.06736973218397824,
"current_spot":58026.01780838783
},
{
"strike":58378.914336909846,
"forward_log_moneyness":0,
"implied_volatility":0.517020500780755,
"delta":0.5309082147347206,
"gamma":4.4192790606748824e-05,
"interest_rate":0.06736973218397824,
"current_spot":58026.01780838783
},
{
"strike":96250.55782764393,
"forward_log_moneyness":0.5,
"implied_volatility":0.7137227872343034,
"delta":0.012936414946896013,
"gamma":2.6829260079941945e-06,
"interest_rate":0.06736973218397824,
"current_spot":58026.01780838783
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-10-22T13:36:00.000Z",
"time_to_expiry":0.11000000000000001,
"implied_volatilities":[
{
"strike":35456.666405622804,
"forward_log_moneyness":-0.5,
"implied_volatility":0.7665601461136989,
"delta":0.9818598165540046,
"gamma":3.020625727200306e-06,
"interest_rate":0.06745266697002476,
"current_spot":58026.01780838783
},
{
"strike":58458.16009106899,
"forward_log_moneyness":0,
"implied_volatility":0.5173700727313382,
"delta":0.5341857547297713,
"gamma":3.9919988877804825e-05,
"interest_rate":0.06745266697002476,
"current_spot":58026.01780838783
},
{
"strike":96381.21198813876,
"forward_log_moneyness":0.5,
"implied_volatility":0.6920869662211807,
"delta":0.019532251867923345,
"gamma":3.5628982792173914e-06,
"interest_rate":0.06745266697002476,
"current_spot":58026.01780838783
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-10-29T20:48:00.000Z",
"time_to_expiry":0.13,
"implied_volatilities":[
{
"strike":35508.422803157875,
"forward_log_moneyness":-0.5,
"implied_volatility":0.746694177498397,
"delta":0.9768034365375131,
"gamma":3.5131108017826186e-06,
"interest_rate":0.06829567333489632,
"current_spot":58026.01780838791
},
{
"strike":58543.491964579865,
"forward_log_moneyness":0,
"implied_volatility":0.5441431140622193,
"delta":0.5390722837426289,
"gamma":3.4874826454214145e-05,
"interest_rate":0.06829567333489632,
"current_spot":58026.01780838791
},
{
"strike":96521.90046306486,
"forward_log_moneyness":0.5,
"implied_volatility":0.6973828419830258,
"delta":0.031246311790620984,
"gamma":4.823365346327674e-06,
"interest_rate":0.06829567333489632,
"current_spot":58026.01780838791
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-11-06T04:00:00.000Z",
"time_to_expiry":0.15,
"implied_volatilities":[
{
"strike":35563.92832597037,
"forward_log_moneyness":-0.5,
"implied_volatility":0.7304703931953009,
"delta":0.9718561610549586,
"gamma":3.930583791623972e-06,
"interest_rate":0.06960254691331551,
"current_spot":58026.01780838791
},
{
"strike":58635.005100682145,
"forward_log_moneyness":0,
"implied_volatility":0.5760490651462036,
"delta":0.544410454345521,
"gamma":3.0625222152157556e-05,
"interest_rate":0.06960254691331551,
"current_spot":58026.01780838791
},
{
"strike":96672.78011710517,
"forward_log_moneyness":0.5,
"implied_volatility":0.7118768487498811,
"delta":0.04690301547513481,
"gamma":6.125288885966162e-06,
"interest_rate":0.06960254691331551,
"current_spot":58026.01780838791
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-11-13T11:12:00.000Z",
"time_to_expiry":0.16999999999999998,
"implied_volatilities":[
{
"strike":35623.626386079304,
"forward_log_moneyness":-0.5,
"implied_volatility":0.721718174050619,
"delta":0.9663040517680004,
"gamma":4.33754130982732e-06,
"interest_rate":0.07127992585463479,
"current_spot":58026.01780838777
},
{
"strike":58733.43056220328,
"forward_log_moneyness":0,
"implied_volatility":0.5835725414364753,
"delta":0.5478798467004804,
"gamma":2.8367707863728314e-05,
"interest_rate":0.07127992585463479,
"current_spot":58026.01780838777
},
{
"strike":96835.05626909353,
"forward_log_moneyness":0.5,
"implied_volatility":0.7074557803269064,
"delta":0.05840625886740114,
"gamma":6.890948711664006e-06,
"interest_rate":0.07127992585463479,
"current_spot":58026.01780838777
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-11-20T18:24:00.000Z",
"time_to_expiry":0.18999999999999997,
"implied_volatilities":[
{
"strike":35686.87925583984,
"forward_log_moneyness":-0.5,
"implied_volatility":0.7162150934457168,
"delta":0.9605989719092229,
"gamma":4.698978158615397e-06,
"interest_rate":0.07311368692964569,
"current_spot":58026.01780838777
},
{
"strike":58837.7169140103,
"forward_log_moneyness":0,
"implied_volatility":0.5834532939997044,
"delta":0.5505933941119975,
"gamma":2.6815897656471405e-05,
"interest_rate":0.07311368692964569,
"current_spot":58026.01780838777
},
{
"strike":97006.99539556148,
"forward_log_moneyness":0.5,
"implied_volatility":0.6980481728670079,
"delta":0.06796372312397003,
"gamma":7.4336889324488815e-06,
"interest_rate":0.07311368692964569,
"current_spot":58026.01780838777
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-11-28T01:36:00.000Z",
"time_to_expiry":0.20999999999999996,
"implied_volatilities":[
{
"strike":35752.86682905489,
"forward_log_moneyness":-0.5,
"implied_volatility":0.7117290547935944,
"delta":0.9550655806596073,
"gamma":5.0025339575499e-06,
"interest_rate":0.07494744800465658,
"current_spot":58026.01780838777
},
{
"strike":58946.51202957184,
"forward_log_moneyness":0,
"implied_volatility":0.5833567425067311,
"delta":0.553165792670529,
"gamma":2.548960158194958e-05,
"interest_rate":0.07494744800465658,
"current_spot":58026.01780838777
},
{
"strike":97186.36821673607,
"forward_log_moneyness":0.5,
"implied_volatility":0.6903385981988979,
"delta":0.07746421798228281,
"gamma":7.903447063197836e-06,
"interest_rate":0.07494744800465658,
"current_spot":58026.01780838777
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-12-05T08:48:00.000Z",
"time_to_expiry":0.22999999999999995,
"implied_volatilities":[
{
"strike":35812.19117271369,
"forward_log_moneyness":-0.5,
"implied_volatility":0.7003313174745773,
"delta":0.9512015953587601,
"gamma":5.190199441737905e-06,
"interest_rate":0.0756386005296464,
"current_spot":58026.017808387885
},
{
"strike":59044.32133683242,
"forward_log_moneyness":0,
"implied_volatility":0.5832516696271334,
"delta":0.5556142376297987,
"gamma":2.4339914970530187e-05,
"interest_rate":0.0756386005296464,
"current_spot":58026.017808387885
},
{
"strike":97347.62850208905,
"forward_log_moneyness":0.5,
"implied_volatility":0.6847615396060961,
"delta":0.0871790227762283,
"gamma":8.32207559076525e-06,
"interest_rate":0.0756386005296464,
"current_spot":58026.017808387885
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-12-12T16:00:00.000Z",
"time_to_expiry":0.24999999999999994,
"implied_volatilities":[
{
"strike":35870.454419064496,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6890995916966378,
"delta":0.9477527318136644,
"gamma":5.3422925542408805e-06,
"interest_rate":0.076089868386676,
"current_spot":58026.017808387885
},
{
"strike":59140.38119039104,
"forward_log_moneyness":0,
"implied_volatility":0.5831585060645141,
"delta":0.5579562673771701,
"gamma":2.332998570562908e-05,
"interest_rate":0.076089868386676,
"current_spot":58026.017808387885
},
{
"strike":97506.00442591147,
"forward_log_moneyness":0.5,
"implied_volatility":0.6802080704226982,
"delta":0.09678568327529857,
"gamma":8.68254579910703e-06,
"interest_rate":0.076089868386676,
"current_spot":58026.017808387885
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-12-19T23:12:00.000Z",
"time_to_expiry":0.26999999999999996,
"implied_volatilities":[
{
"strike":35929.46100111083,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6793853817266143,
"delta":0.9444046325229148,
"gamma":5.476954016936011e-06,
"interest_rate":0.07654113624370561,
"current_spot":58026.017808387885
},
{
"strike":59237.666597322146,
"forward_log_moneyness":0,
"implied_volatility":0.5830791327701744,
"delta":0.5602047706056178,
"gamma":2.2433334744525613e-05,
"interest_rate":0.07654113624370561,
"current_spot":58026.017808387885
},
{
"strike":97666.4009456475,
"forward_log_moneyness":0.5,
"implied_volatility":0.6763050082388905,
"delta":0.10618110384420681,
"gamma":8.98967405231349e-06,
"interest_rate":0.07654113624370561,
"current_spot":58026.017808387885
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2024-12-27T06:24:00.000Z",
"time_to_expiry":0.29,
"implied_volatilities":[
{
"strike":35989.21427362662,
"forward_log_moneyness":-0.5,
"implied_volatility":0.670898179511778,
"delta":0.9411587869242752,
"gamma":5.595987585552628e-06,
"interest_rate":0.07699240410073521,
"current_spot":58026.017808387885
},
{
"strike":59336.18308871287,
"forward_log_moneyness":0,
"implied_volatility":0.5830106988432193,
"delta":0.562369866190329,
"gamma":2.163016442831909e-05,
"interest_rate":0.07699240410073521,
"current_spot":58026.017808387885
},
{
"strike":97828.82718051813,
"forward_log_moneyness":0.5,
"implied_volatility":0.672922129747721,
"delta":0.11534592709962938,
"gamma":9.250622938852245e-06,
"interest_rate":0.07699240410073521,
"current_spot":58026.017808387885
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-01-03T13:36:00.000Z",
"time_to_expiry":0.31,
"implied_volatilities":[
{
"strike":36048.92648425896,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6679678626792047,
"delta":0.9370374303516131,
"gamma":5.7317087485274615e-06,
"interest_rate":0.07737287709195237,
"current_spot":58026.01780838792
},
{
"strike":59434.63188050294,
"forward_log_moneyness":0,
"implied_volatility":0.5859817537938207,
"delta":0.5647921240926812,
"gamma":2.0794233277177758e-05,
"interest_rate":0.07737287709195237,
"current_spot":58026.01780838792
},
{
"strike":97991.14179761717,
"forward_log_moneyness":0.5,
"implied_volatility":0.6700214502235391,
"delta":0.12429742545143802,
"gamma":9.472272436634292e-06,
"interest_rate":0.07737287709195237,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-01-10T20:48:00.000Z",
"time_to_expiry":0.33,
"implied_volatilities":[
{
"strike":36109.279532657514,
"forward_log_moneyness":-0.5,
"implied_volatility":0.665421495511619,
"delta":0.933083062177843,
"gamma":5.846592519268601e-06,
"interest_rate":0.07775269759592703,
"current_spot":58026.01780838792
},
{
"strike":59534.137235149225,
"forward_log_moneyness":0,
"implied_volatility":0.5886063557855834,
"delta":0.5671269691023384,
"gamma":2.004462300938605e-05,
"interest_rate":0.07775269759592703,
"current_spot":58026.01780838792
},
{
"strike":98155.19839237105,
"forward_log_moneyness":0.5,
"implied_volatility":0.6674624799068604,
"delta":0.13300206105083862,
"gamma":9.659172856765809e-06,
"interest_rate":0.07775269759592703,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-01-18T04:00:00.000Z",
"time_to_expiry":0.35000000000000003,
"implied_volatilities":[
{
"strike":36170.28314845455,
"forward_log_moneyness":-0.5,
"implied_volatility":0.663157976626766,
"delta":0.9293008214530067,
"gamma":5.943148361810485e-06,
"interest_rate":0.07813251809990168,
"current_spot":58026.01780838792
},
{
"strike":59634.715194103424,
"forward_log_moneyness":0,
"implied_volatility":0.5909212683245534,
"delta":0.5693803754632355,
"gamma":1.936814930861872e-05,
"interest_rate":0.07813251809990168,
"current_spot":58026.01780838792
},
{
"strike":98321.02341266243,
"forward_log_moneyness":0.5,
"implied_volatility":0.6651877423695867,
"delta":0.1414595798208534,
"gamma":9.815998071595665e-06,
"interest_rate":0.07813251809990168,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-01-25T11:12:00.000Z",
"time_to_expiry":0.37000000000000005,
"implied_volatilities":[
{
"strike":36231.940285943245,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6611326243186885,
"delta":0.9256851893716047,
"gamma":6.023814573471915e-06,
"interest_rate":0.07851233860387634,
"current_spot":58026.01780838792
},
{
"strike":59736.37062817149,
"forward_log_moneyness":0,
"implied_volatility":0.5929782956406244,
"delta":0.5715600409220507,
"gamma":1.8753574858502585e-05,
"interest_rate":0.07851233860387634,
"current_spot":58026.01780838792
},
{
"strike":98488.62488909272,
"forward_log_moneyness":0.5,
"implied_volatility":0.6631523393765039,
"delta":0.14967305594856423,
"gamma":9.946767024463076e-06,
"interest_rate":0.07851233860387634,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-02-01T18:24:00.000Z",
"time_to_expiry":0.39000000000000007,
"implied_volatilities":[
{
"strike":36294.253934242304,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6593097032020858,
"delta":0.9222298621699195,
"gamma":6.0906856436348864e-06,
"interest_rate":0.078892159107851,
"current_spot":58026.01780838792
},
{
"strike":59839.1084655771,
"forward_log_moneyness":0,
"implied_volatility":0.5948182891227818,
"delta":0.5736725146086658,
"gamma":1.8191942175051474e-05,
"interest_rate":0.078892159107851,
"current_spot":58026.01780838792
},
{
"strike":98658.01094692905,
"forward_log_moneyness":0.5,
"implied_volatility":0.66132036197531,
"delta":0.15764765226901595,
"gamma":1.0054928929661422e-05,
"interest_rate":0.078892159107851,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-02-09T01:36:00.000Z",
"time_to_expiry":0.4100000000000001,
"implied_volatilities":[
{
"strike":36357.22711753722,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6576602906296823,
"delta":0.9189281108901203,
"gamma":6.1455615675798424e-06,
"interest_rate":0.07927197961182565,
"current_spot":58026.01780838792
},
{
"strike":59942.93369235912,
"forward_log_moneyness":0,
"implied_volatility":0.5964738987014115,
"delta":0.575723423789942,
"gamma":1.7676011260266423e-05,
"interest_rate":0.07927197961182565,
"current_spot":58026.01780838792
},
{
"strike":98829.18980675985,
"forward_log_moneyness":0.5,
"implied_volatility":0.6596627467523394,
"delta":0.16538991558862898,
"gamma":1.0143445719822414e-05,
"interest_rate":0.07927197961182565,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-02-16T08:48:00.000Z",
"time_to_expiry":0.4300000000000001,
"implied_volatilities":[
{
"strike":36420.862895324484,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6561607262105765,
"delta":0.9157730321464483,
"gamma":6.189991001937826e-06,
"interest_rate":0.07965180011580031,
"current_spot":58026.01780838792
},
{
"strike":60047.851352774516,
"forward_log_moneyness":0,
"implied_volatility":0.5979715339788125,
"delta":0.5777176461052483,
"gamma":1.7199858018997315e-05,
"interest_rate":0.07965180011580031,
"current_spot":58026.01780838792
},
{
"strike":99002.16978515883,
"forward_log_moneyness":0.5,
"implied_volatility":0.6581557179455457,
"delta":0.1729072679589228,
"gamma":1.0214863966935872e-05,
"interest_rate":0.07965180011580031,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-02-23T16:00:00.000Z",
"time_to_expiry":0.4500000000000001,
"implied_volatilities":[
{
"strike":36485.16436265892,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6547914665280272,
"delta":0.9127577211883326,
"gamma":6.2253084481009406e-06,
"interest_rate":0.08003162061977497,
"current_spot":58026.01780838792
},
{
"strike":60153.86654970605,
"forward_log_moneyness":0,
"implied_volatility":0.5993327879770832,
"delta":0.5796594424988346,
"gamma":1.675858179880843e-05,
"interest_rate":0.08003162061977497,
"current_spot":58026.01780838792
},
{
"strike":99176.95929535729,
"forward_log_moneyness":0.5,
"implied_volatility":0.6567796366780594,
"delta":0.18020764009820367,
"gamma":1.0271376702403038e-05,
"interest_rate":0.08003162061977497,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-03-02T23:12:00.000Z",
"time_to_expiry":0.47000000000000014,
"implied_volatilities":[
{
"strike":36550.13465040425,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6535362266196858,
"delta":0.9098753894923948,
"gamma":6.252665991544482e-06,
"interest_rate":0.08041144112374962,
"current_spot":58026.01780838792
},
{
"strike":60260.984445075286,
"forward_log_moneyness":0,
"implied_volatility":0.6005754878888658,
"delta":0.5815525612864333,
"gamma":1.6348088653525164e-05,
"interest_rate":0.08041144112374962,
"current_spot":58026.01780838792
},
{
"strike":99353.56684792519,
"forward_log_moneyness":0.5,
"implied_volatility":0.6555181383175726,
"delta":0.18729920827677043,
"gamma":1.031487608695086e-05,
"interest_rate":0.08041144112374962,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-03-10T06:24:00.000Z",
"time_to_expiry":0.49000000000000016,
"implied_volatilities":[
{
"strike":36615.776925486694,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6523813277758325,
"delta":0.9071194427368175,
"gamma":6.273060245473111e-06,
"interest_rate":0.08079126162772428,
"current_spot":58026.01780838792
},
{
"strike":60369.210260260865,
"forward_log_moneyness":0,
"implied_volatility":0.6017144821238312,
"delta":0.583400320667559,
"gamma":1.5964928197398504e-05,
"interest_rate":0.08079126162772428,
"current_spot":58026.01780838792
},
{
"strike":99532.00105146051,
"forward_log_moneyness":0.5,
"implied_volatility":0.6543574771371616,
"delta":0.1941902067286228,
"gamma":1.0346998054360535e-05,
"interest_rate":0.08079126162772428,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-03-17T13:36:00.000Z",
"time_to_expiry":0.5100000000000001,
"implied_volatilities":[
{
"strike":36682.09439115184,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6513151960169534,
"delta":0.9044835305051513,
"gamma":6.287355155072169e-06,
"interest_rate":0.08117108213169894,
"current_spot":58026.01780838792
},
{
"strike":60478.54927652192,
"forward_log_moneyness":0,
"implied_volatility":0.6027622377978934,
"delta":0.5852056749019943,
"gamma":1.5606169060981268e-05,
"interest_rate":0.08117108213169894,
"current_spot":58026.01780838792
},
{
"strike":99712.27061328752,
"forward_log_moneyness":0.5,
"implied_volatility":0.6532860223753855,
"delta":0.2008887953224186,
"gamma":1.0369160048689091e-05,
"interest_rate":0.08117108213169894,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-03-24T20:48:00.000Z",
"time_to_expiry":0.5300000000000001,
"implied_volatilities":[
{
"strike":36749.09028722471,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6503279721292464,
"delta":0.9019615758689511,
"gamma":6.296301273094999e-06,
"interest_rate":0.08155090263567359,
"current_spot":58026.01780838792
},
{
"strike":60589.006835426866,
"forward_log_moneyness":0,
"implied_volatility":0.6037292998953473,
"delta":0.586971267938301,
"gamma":1.5269302598076197e-05,
"interest_rate":0.08155090263567359,
"current_spot":58026.01780838792
},
{
"strike":99894.38434016371,
"forward_log_moneyness":0.5,
"implied_volatility":0.6522938663885004,
"delta":0.20740296772284422,
"gamma":1.038259288783101e-05,
"interest_rate":0.08155090263567359,
"current_spot":58026.01780838792
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-04-01T04:00:00.000Z",
"time_to_expiry":0.5500000000000002,
"implied_volatilities":[
{
"strike":36809.60921966647,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6490684971001264,
"delta":0.8996219124555145,
"gamma":6.30048417032778e-06,
"interest_rate":0.08157716058576774,
"current_spot":58026.017808387805
},
{
"strike":60688.78568662366,
"forward_log_moneyness":0,
"implied_volatility":0.6049428293550925,
"delta":0.5887453775459217,
"gamma":1.4943907780518931e-05,
"interest_rate":0.08157716058576774,
"current_spot":58026.017808387805
},
{
"strike":100058.89185449791,
"forward_log_moneyness":0.5,
"implied_volatility":0.6521575799088905,
"delta":0.21418835264707525,
"gamma":1.0388513057777013e-05,
"interest_rate":0.08157716058576774,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-04-08T11:12:00.000Z",
"time_to_expiry":0.5700000000000002,
"implied_volatilities":[
{
"strike":36863.54740678996,
"forward_log_moneyness":-0.5,
"implied_volatility":0.64759546683631,
"delta":0.8974431026219174,
"gamma":6.300823350990473e-06,
"interest_rate":0.0812836750088743,
"current_spot":58026.017808387805
},
{
"strike":60777.714723037156,
"forward_log_moneyness":0,
"implied_volatility":0.606346016857856,
"delta":0.5905230273552948,
"gamma":1.4630257665894388e-05,
"interest_rate":0.0812836750088743,
"current_spot":58026.017808387805
},
{
"strike":100205.5110484157,
"forward_log_moneyness":0.5,
"implied_volatility":0.6527152522301968,
"delta":0.22117289968756865,
"gamma":1.0386452374519812e-05,
"interest_rate":0.0812836750088743,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-04-15T18:24:00.000Z",
"time_to_expiry":0.5900000000000002,
"implied_volatilities":[
{
"strike":36917.1312427359,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6462192790718065,
"delta":0.8953508761040165,
"gamma":6.297918867785276e-06,
"interest_rate":0.08099018943198087,
"current_spot":58026.017808387805
},
{
"strike":60866.059533126936,
"forward_log_moneyness":0,
"implied_volatility":0.6076511548413593,
"delta":0.5922640547697162,
"gamma":1.4334405083399179e-05,
"interest_rate":0.08099018943198087,
"current_spot":58026.017808387805
},
{
"strike":100351.16701596668,
"forward_log_moneyness":0.5,
"implied_volatility":0.6532346874905771,
"delta":0.22795012326304553,
"gamma":1.0376959894678083e-05,
"interest_rate":0.08099018943198087,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-04-23T01:36:00.000Z",
"time_to_expiry":0.6100000000000002,
"implied_volatilities":[
{
"strike":36970.35895343557,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6449306790806686,
"delta":0.8933411185184987,
"gamma":6.2921394594514046e-06,
"interest_rate":0.08069670385508745,
"current_spot":58026.017808387805
},
{
"strike":60953.81719194817,
"forward_log_moneyness":0,
"implied_volatility":0.6088681815475112,
"delta":0.5939704987428261,
"gamma":1.4054709872270769e-05,
"interest_rate":0.08069670385508745,
"current_spot":58026.017808387805
},
{
"strike":100495.85493473208,
"forward_log_moneyness":0.5,
"implied_volatility":0.6537196883970442,
"delta":0.23453002315141752,
"gamma":1.0361048449078726e-05,
"interest_rate":0.08069670385508745,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-04-30T08:48:00.000Z",
"time_to_expiry":0.6300000000000002,
"implied_volatilities":[
{
"strike":37023.22877480308,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6437215559192604,
"delta":0.891409932987744,
"gamma":6.283811248537111e-06,
"interest_rate":0.08040321827819402,
"current_spot":58026.017808387805
},
{
"strike":61040.98479101488,
"forward_log_moneyness":0,
"implied_volatility":0.6100057349755975,
"delta":0.5956442136783187,
"gamma":1.378973638032665e-05,
"interest_rate":0.08040321827819402,
"current_spot":58026.017808387805
},
{
"strike":100639.57000942926,
"forward_log_moneyness":0.5,
"implied_volatility":0.6541735695387509,
"delta":0.24092208068616,
"gamma":1.033959165727875e-05,
"interest_rate":0.08040321827819402,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-05-07T16:00:00.000Z",
"time_to_expiry":0.6500000000000002,
"implied_volatilities":[
{
"strike":37075.7389528326,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6425847708932765,
"delta":0.8895536319029893,
"gamma":6.273223151306557e-06,
"interest_rate":0.08010973270130059,
"current_spot":58026.017808387805
},
{
"strike":61127.559438460405,
"forward_log_moneyness":0,
"implied_volatility":0.611071358945577,
"delta":0.5972868920481528,
"gamma":1.353822178517538e-05,
"interest_rate":0.08010973270130059,
"current_spot":58026.017808387805
},
{
"strike":100782.30747217605,
"forward_log_moneyness":0.5,
"implied_volatility":0.6545992332787502,
"delta":0.24713526484222675,
"gamma":1.031334487396154e-05,
"interest_rate":0.08010973270130059,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-05-14T23:12:00.000Z",
"time_to_expiry":0.6700000000000003,
"implied_volatilities":[
{
"strike":37127.88774369526,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6415140160163469,
"delta":0.8877687277943976,
"gamma":6.260631535694374e-06,
"interest_rate":0.07981624712440716,
"current_spot":58026.017808387805
},
{
"strike":61213.53825919696,
"forward_log_moneyness":0,
"implied_volatility":0.612071671149257,
"delta":0.5989000835645941,
"gamma":1.3299050215267482e-05,
"interest_rate":0.07981624712440716,
"current_spot":58026.017808387805
},
{
"strike":100924.06258275412,
"forward_log_moneyness":0.5,
"implied_volatility":0.65499923191197,
"delta":0.25317804599616633,
"gamma":1.0282962689178526e-05,
"interest_rate":0.07981624712440716,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-05-22T06:24:00.000Z",
"time_to_expiry":0.6900000000000003,
"implied_volatilities":[
{
"strike":37179.67341383548,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6405036965118509,
"delta":0.8860519237238551,
"gamma":6.246264239749656e-06,
"interest_rate":0.07952276154751373,
"current_spot":58026.017808387805
},
{
"strike":61298.918395074594,
"forward_log_moneyness":0,
"implied_volatility":0.6130125011315778,
"delta":0.6004852115270767,
"gamma":1.3071231456072592e-05,
"interest_rate":0.07952276154751373,
"current_spot":58026.017808387805
},
{
"strike":101064.83062887086,
"forward_log_moneyness":0.5,
"implied_volatility":0.6553758189043412,
"delta":0.2590584146129957,
"gamma":1.0249013592927193e-05,
"interest_rate":0.07952276154751373,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-05-29T13:36:00.000Z",
"time_to_expiry":0.7100000000000003,
"implied_volatilities":[
{
"strike":37231.0942400669,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6395488327214849,
"delta":0.8844001035011674,
"gamma":6.230324045352499e-06,
"interest_rate":0.0792292759706203,
"current_spot":58026.017808387805
},
{
"strike":61383.69700503932,
"forward_log_moneyness":0,
"implied_volatility":0.6138990043014603,
"delta":0.6020435868367855,
"gamma":1.2853883311090034e-05,
"interest_rate":0.0792292759706203,
"current_spot":58026.017808387805
},
{
"strike":101204.60692642008,
"forward_log_moneyness":0.5,
"implied_volatility":0.6557309913873326,
"delta":0.26478390290780807,
"gamma":1.0211992300442549e-05,
"interest_rate":0.0792292759706203,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-06-05T20:48:00.000Z",
"time_to_expiry":0.7300000000000003,
"implied_volatilities":[
{
"strike":37282.14850966782,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6386449777790982,
"delta":0.8828103219385111,
"gamma":6.212991687141015e-06,
"interest_rate":0.07893579039372686,
"current_spot":58026.017808387805
},
{
"strike":61467.87126529042,
"forward_log_moneyness":0,
"implied_volatility":0.6147357566966473,
"delta":0.6035764200733317,
"gamma":1.2646216898623222e-05,
"interest_rate":0.07893579039372686,
"current_spot":58026.017808387805
},
{
"strike":101343.38681974151,
"forward_log_moneyness":0.5,
"implied_volatility":0.6560665256009832,
"delta":0.27036160810226006,
"gamma":1.0172330142380753e-05,
"interest_rate":0.07893579039372686,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-06-13T04:00:00.000Z",
"time_to_expiry":0.7500000000000003,
"implied_volatilities":[
{
"strike":37332.83452047616,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6377881481692333,
"delta":0.8812797952940707,
"gamma":6.1944284641286705e-06,
"interest_rate":0.07864230481683343,
"current_spot":58026.017808387805
},
{
"strike":61551.43836943706,
"forward_log_moneyness":0,
"implied_volatility":0.6155268341913215,
"delta":0.6050848319514089,
"gamma":1.244752432371126e-05,
"interest_rate":0.07864230481683343,
"current_spot":58026.017808387805
},
{
"strike":101481.16568187889,
"forward_log_moneyness":0.5,
"implied_volatility":0.656384006613938,
"delta":0.27579821630855184,
"gamma":1.0130403849647117e-05,
"interest_rate":0.07864230481683343,
"current_spot":58026.017808387805
}
]
},
{
"value_time":"2024-09-12T10:00:00.000Z",
"expiry":"2025-06-20T11:12:00.000Z",
"time_to_expiry":0.7700000000000004,
"implied_volatilities":[
{
"strike":37383.15058098387,
"forward_log_moneyness":-0.5,
"implied_volatility":0.6369747648763131,
"delta":0.8798058920082439,
"gamma":6.174778511045466e-06,
"interest_rate":0.07834881923994,
"current_spot":58026.017808387805
},
{
"strike":61634.39552865396,
"forward_log_moneyness":0,
"implied_volatility":0.6162758790483663,
"delta":0.6065698624154641,
"gamma":1.2257168284623043e-05,
"interest_rate":0.07834881923994,
"current_spot":58026.017808387805
},
{
"strike":101617.93891483666,
"forward_log_moneyness":0.5,
"implied_volatility":0.6566848533704227,
"delta":0.2811000263712149,
"gamma":1.0086543002522495e-05,
"interest_rate":0.07834881923994,
"current_spot":58026.017808387805
}
]
}
],
"result":"success",
"access":{
"access_range":{
"start_timestamp":1262304000000,
"end_timestamp":1924991999000
},
"data_range":{
"start_timestamp":1262304000000,
"end_timestamp":1924991999000
}
}
}Short listed-maturities (e.g. 7 days time-to-maturity) are only available for individual exchanges.
Time extrapolation is not permitted. I.e. the shortest requested expiry should be after the exchange's shortest expiry, and the furthest requested expiry must be before the exchange's latest expiry. If these conditions are not met, only a partial surface will be returned within the available expiry range. The completeness of the output is indicated in the complete_output field.
Strikes and forward-log-moneynesses are only available when retrieving implied volatilities by strikes or forward-log-moneynesses (not by delta).
quote
2022-06-25T16:00:00Z
tte_stepdelta_maxdelta_stepdeltasdelta_mindelta_maxdelta_stepdeltasdelta_mindelta_maxdelta_stepdeltasdelta_mindelta_maxdelta_step⬅️ ⬅️ ⬅️
Level 1 & Level 2 Data [Level 2 Aggregations Tier]
Level 1 & Level 2 Data [Level 2 Tick-Level Tier]
CeFi Spot ticker packs.
This endpoint returns the following metrics, averaged for the requested period.
Bid volume
Ask volume
Bid-ask spread
Price Slippage
https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/spot/{instrument}/ob_aggregations/fullregion
Yes
Choose between eu and us.
exchange
Yes
end_time
No
Ending time in ISO 8601 (exclusive). Automatically included in continuation tokens.
continuation_token
No
poll_timestamp
The timestamp at which the interval begins.
bid_volume_x
The average volume of bids placed within 0 and x% of the best bid over a specified interval.
ask_volume_x
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/krkn/spot/btc-usd/ob_aggregations/full?page_size=10&slippage=100000&interval=1h&start_time=2019-12-04T00:00:00Z&end_time=2019-12-06T00:00:00Z'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
exchange = "krkn"
instrument_class = "spot"
pair = "btc-usd" #called "instrument" in the documentation
# ---- Optional parameters ---- #
sort = "desc"
page_size = 100
start_time= "2025-03-03T00:00:00Z"
end_time= "2025-03-05T00:00:00Z"
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, exchange: str, pair: str, instrument_class: str, start_time: str, end_time: str, sort: str, page_size: int):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/order_book_snapshots.v1/exchanges/{exchange}/{instrument_class}/{pair}/snapshots/slippage'
params = {
"start_time": start_time,
"end_time": end_time,
"sort": sort,
"page_size": page_size
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, exchange=exchange, pair=pair, instrument_class=instrument_class, start_time=start_time, end_time=end_time ,sort=sort, page_size=int(page_size)){
"query": {
"page_size": 10,
"exchange": "krkn",
"instrument_class": "spot",
"instrument": "btc-usd",
"interval": "1h",
"slippage": 100000,
"slippage_ref": "mid_price",
"sort": "desc",
"aggregation": "full",
"data_version": "v1",
"commodity": "order_book_snapshots",
"request_time": "2020-05-26T14:46:00.561Z"
},
"time": "2020-05-26T14:46:03.776Z",
"timestamp": 1590504363776,
"data": [
{
"poll_timestamp": 1590501600000,
"ask_slippage": "0.00032766083806437735",
"bid_slippage": "0.0002206511273162024",
"bid_volume0_1": "31.751239130434783",
"bid_volume0_2": "87.33763043478261",
"bid_volume0_3": "139.32403260869566",
"bid_volume0_4": "177.62314130434783",
"bid_volume0_5": "206.71984782608695",
"bid_volume0_6": "251.4888043478261",
"bid_volume0_7": "287.1503043478261",
"bid_volume0_8": "317.3515869565217",
"bid_volume0_9": "335.79671739130436",
"bid_volume1": "352.03117391304346",
"bid_volume1_5": "419.0988260869565",
"bid_volume2": "470.6285",
"bid_volume4": "859.7884347826086",
"bid_volume6": "1134.0595760869564",
"bid_volume8": "1134.4657173913045",
"bid_volume10": "1134.4657173913045",
"ask_volume0_1": "21.558043478260867",
"ask_volume0_2": "37.20532608695652",
"ask_volume0_3": "78.02648913043478",
"ask_volume0_4": "143.83753260869565",
"ask_volume0_5": "192.98572826086954",
"ask_volume0_6": "235.31961956521738",
"ask_volume0_7": "280.5659565217391",
"ask_volume0_8": "309.4857717391304",
"ask_volume0_9": "327.8923152173913",
"ask_volume1": "341.79707608695657",
"ask_volume1_5": "411.3568043478261",
"ask_volume2": "475.6048586956521",
"ask_volume4": "885.1007826086956",
"ask_volume6": "1263.1216413043478",
"ask_volume8": "1364.2838369565218",
"ask_volume10": "1364.2838369565218",
"mid_price": "8830.427717391303",
"spread": "1.175"
}
/* ... */
],
"result": "success",
"access": {
"access_range": {
"start_timestamp": null,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}We are unable to collect the full 10% snapshot from all exchanges we cover. Thus, for some exchanges, 'Market Depth' does not accurately portray the exchange's order book volume.
Exchange code.
See
instrument_class
Yes
Instrument class.
See
instrument
Yes
Instrument code.
See
See
interval
No
The interval parameter is suffixed with s, m, h or d to specify seconds, minutes, 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 s (second), m (minute), h (hour) and d (day).
Default 1h.
page_size
No
Number of snapshots to return data for. (default: 10, max: 100). See Automatically included in continuation tokens.
sort
No
Return the data in ascending asc or descending desc order. Default desc
Automatically included in continuation tokens.
start_time
No
Starting time in ISO 8601 (inclusive). Automatically included in continuation tokens.
slippage
No
Order size (in quote asset) for which to calculate the percentage of slippage. Default: 0. When null is returned, not enough volume is present on the order book to execute the order.
slippage_ref
No
Price point for which to calculate slippage from. Either from the mid price (mid_price) or from the best bid/ask (best). Default: mid_price.
The average volume of asks placed within 0 and x% of the best ask over a specified interval.
spread
The average difference between the best bid and the best ask over a specified interval.
mid_price
The average mid price between the best bid and the best ask over a specified interval
ask_slippage
The average percentage of price slippage for a market buy order over a specified interval.
bid_slippage
The average percentage of price slippage for a market sell order over a specified interval.
Kaiko Blockchain Monitoring
When Ethereum is your chosen blockchain.
This endpoint offers in-depth insights into Ethereum wallets including transfers and wallet balances over time.
Blockchain Monitoring can also be accessed through Google BigQuery. See for more information.
https://us.market-api.kaiko.io/v2/data/wallet.v1/auditblockchain
Always ethereum.
ethereum
sort
The sorting order for the results.
asc or desc
page_size
Number of results to return data for. (max: 5000).
See
100
start_time
Starting time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
end_time
Ending time in ISO 8601 (inclusive).
2022-05-01T00:00:00.000Z
transaction_hash
Filter by transaction hash.
0xf7825247b9a9355c0fb45ec0d008fe638ce5bae9cb877c6a28a91d9ea5f17341
user_address
Filter by user address.
0x000000fee13a103a10d593b9ae06b3e05f2e7e1c
token_address
Filter by token address.
For ETH, include the token_address field with an empty value.
0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
token_symbol
Filter by token symbol.
LINK
chain
Blockchain name.
ethereum
block_number
curl --compressed -H "Accept: application/json" -H "X-Api-Key: <client-api-key>" \
"https://eu.market-api.kaiko.io/v2/data/wallet.v1/audit?blockchain=ethereum"##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
blockchain = "ethereum"
# ---- Optional parameters ---- #
start_time = "2025-03-05T00:00:00Z"
end_time = "2025-03-05T00:02:00Z"
page_size = 100
sort = "desc"
transaction_hash = None
user_address = None
token_address = None
# ---- API key configuration ---- #
api_key = "YOUR_API_KEY"
##### 3. Get the data #####
# ---- Function to run an API call ---- #
# Get the data in a dataframe --------- #
def get_kaiko_data(api_key: str, blockchain: str, start_time: str, end_time: str, page_size: int, sort: str, transaction_hash: str, user_address: str, token_address: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://us.market-api.kaiko.io/v2/data/wallet.v1/audit'
params = {
"blockchain": blockchain,
"start_time": start_time,
"end_time": end_time,
"page_size": page_size,
"sort": sort,
"transaction_hash": transaction_hash,
"user_address": user_address,
"token_address": token_address
}
try:
res = requests.get(url, headers=headers, params=params)
res.raise_for_status()
data = res.json()
if 'data' not in data:
print("No data returned.")
return pd.DataFrame()
df = pd.DataFrame(data['data'])
# Handle pagination with continuation token
while 'next_url' in data:
next_url = data['next_url']
if next_url is None:
break
res = requests.get(next_url, headers=headers)
res.raise_for_status()
data = res.json()
if 'data' in data:
df = pd.concat([df, pd.DataFrame(data['data'])], ignore_index=True)
return df
except requests.exceptions.RequestException as e:
print(f"API request error: {e}")
return pd.DataFrame()
# ---- Get the data ---- #
df = get_kaiko_data(api_key=api_key, blockchain=blockchain, start_time=start_time, end_time=end_time, page_size=page_size, sort=sort, transaction_hash=transaction_hash, user_address=user_address, token_address=token_address)
print (df){
"query":
{
"live": "False",
"start_time": "2024-01-01T00:00:00.000Z",
"end_time": "2024-01-02T00:00:00.000Z",
"start_block": 0,
"end_block": 0,
"page_size": 100,
"sort": "0",
"data_version": "v1",
"commodity": "wallet_data",
"request_time": "2024-01-01T00:00:00.000Z"
},
"time": "2024-01-01T00:00:00.000Z",
"timestamp": 1732530743000,
"access":
{
"access_range":
{
"start_timestamp": 1073001600000,
"end_timestamp": "None"
},
"data_range":
{
"start_timestamp": "None",
"end_timestamp": "None"
}
},
"data":
[
{
"chain": "ethereum",
"block_number": 21264197,
"timestamp": 1732530743000000000,
"user_address": "0xd2674da94285660c9b2353131bef2d8211369a4b",
"transaction_hash": "0x4ae1bc32d34a7b66fd23c6527a46cf9bb3158452044eea43762e351aa2fdabca",
"transaction_type": "coin_transfer",
"transaction_index": 188,
"ordinal": 0,
"sender_address": "0xd2674da94285660c9b2353131bef2d8211369a4b",
"receiver_address": "0x90cdc2572f170178ac5027af0dcf141870a962e3",
"initiator_address": "0xd2674da94285660c9b2353131bef2d8211369a4b",
"token_symbol": "ETH",
"token_address": "0",
"direction": "out",
"amount": 0.00237201,
"amount_usd": 8.217764039189689,
"balance_after": 6966.056486974737,
"balance_after_usd": 24133712.966482032
},
/* ... */
],
"continuation_token": "xxx",
"next_url": "https://us.market-api.kaiko.io/v2/data/wallet.v1/audit?continuation_token=xxx"
}
}coin_transfer
Native ETH transfer.
tx_value
Native ETH transfer happening in a transaction.
token_transfer
The height of the block.
7005997
timestamp
The timestamp of the block.
1546560004
user_address
The address on which the row is focused.
0xc8c939539efb7f5ba903fc99b61656979c46c045
transaction_hash
Transaction hash.
0x5a9e11432e5c7e2fccf598606858619cbd72f1de40db625fc4749ec1b032e144
transaction_type
Event type. See more information .
token_transfer
transaction_index
The index of the transaction.
0
ordinal
Generated number that gives the order of each balance impact, for one file. Based on call index and log indexes.
2
sender_address
The address that sends tokens or coins.
0xc8c939539efb7f5ba903fc99b61656979c46c045
receiver_address
The address that receives tokens or coins.
0x5a0b54d5dc17e0aadc383d2db43b0a0d3e029c4c
initiator_address
The address that signed the transaction.
0xc8c939539efb7f5ba903fc99b61656979c46c045
token_symbol
Symbol of the token or coin transferred
ETH
token_address
The address of the token or coin transferred.
0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
direction
Inflow or outflow from the user_address.
out
amount
Amount of asset transferred.
0.16
amount_usd
Amount of asset transferred in usd.
23.863262042004745
balance_after
Wallet balance for the user_address for this asset.
0.4814735188
balance_after_usd
Wallet balance for the user_address for this asset in usd.
71.80955465881561
This operation involves the transfer of (ERC20) tokens.
block_rewards
Rewards granted to the miner who mined a block before the Merge.
uncle_rewards
Rewards granted to the miner who mined an uncle block before the Merge.
uncle_inclusion_rewards
Rewards granted to the miner who included an uncle block into a mined block before the Merge.
genesis_balance
Refers to the balance attributed to addresses during the genesis block.
dao_adjust_balance
Refers to any adjustment made to an account’s balance in relation to DAO-related hard-fork or operations.
reward_transaction_fee
Reward earned by the miner for including the transaction in the block.
burnt_transaction_fee
Burnt amount of ETH transaction fees, post EIP-1559.
token_burn
Burn of a ERC20 token.
token_mint
Mint of a ERC20 token.
staking_deposit
Deposit of stake for validators.
staking_withdrawal
Withdrawal of rewards or stake for validators.
wrap_coin
Wrapping ETH into WETH.
unwrap_coin
Unwrapping WETH back to ETH.