Market capitalization and circulating supply (BETA)
What is this endpoint for?
This API provides circulating supply and market capitalization data for over 250 crypto assets. The data is an indicative value aggregated from multiple sources on a daily basis, starting from the asset’s deployment to the present day. Market capitalization is provided only when a reliable price for the day can be ensured.
Endpoint
https://eu.market-api.kaiko.io/v2/data/supply.v1/{ASSET}Path parameters
asset
The asset you'd like information on.
Query parameters
start_time
Yes
Start time.
2020-01-01T00:00:00.000Z
end_time
No
End time.
2023-11-08T00:00:00.000Z
page_size
No
Response page size. Default: 10.
100
sort
No
Sort results in asc or desc order.
desc
Fields
timestamp
Timestamp of the block.
1670976000
asset
Ticker of the asset.
btc
circulating_supply
Circulating supply of the asset.
19248126.084439
market_cap
Market cap = Circulating supply x USD price.
345082843135.89093
Request examples
curl --compressed -H 'Accept: application/json' -H 'X-Api-Key: <client-api-key>' \
'https://eu.market-api.kaiko.io/v2/data/supply.v1/btc?start_time=2010-01-01T00:00:00.000Z&page_size=100'##### 1. Import dependencies #####
import requests
import pandas as pd
##### 2. Choose the value of the query's parameters #####
# ---- Required parameters ---- #
asset = "btc"
# ---- Optional parameters ---- #
start_time = "2020-01-01T00:00:00.000Z"
end_time = None
page_size = 100
sort = "desc"
# ---- 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, start_time: str, end_time: str, page_size: int, sort: str):
headers = {'Accept': 'application/json', 'X-Api-Key': api_key}
url = f'https://eu.market-api.kaiko.io/v2/data/supply.v1/{asset}'
params = {
"start_time": start_time,
"end_time": end_time,
"page_size": page_size,
"sort": sort
}
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, start_time=start_time, end_time=end_time, page_size=page_size, sort=sort)
print (df)Response example
{
"query": {
"start_time": "2010-08-01T00:00:00.000Z",
"end_time": "2024-03-28T10:22:32.118Z",
"page_size": 100,
"asset": "btc",
"interval": "1d",
"sort": "asc",
"request_time": "2024-03-28T10:22:32.118Z",
"start_timestamp": 1280620800000,
"end_timestamp": 1711621352118
},
"time": "2024-03-28T10:22:32.133Z",
"timestamp": 1711621352133,
"data": [
{
"timestamp": 1280620800,
"asset": "btc",
"circulating_supply": 3585995.2815962303,
"market_cap": 224238.7131408345
},
{
"timestamp": 1280707200,
"asset": "btc",
"circulating_supply": 3599253.320858871,
"market_cap": 221216.1495251203
}
],
"result": "success",
"continuation_token": "***",
"next_url": "https://eu.market-api.kaiko.io/v2/data/supply.v1/btc?continuation_token=***",
"access": {
"access_range": {
"start_timestamp": 1073001600000,
"end_timestamp": null
},
"data_range": {
"start_timestamp": null,
"end_timestamp": null
}
}
}
Last updated
Was this helpful?
