Supply
Last updated
Was this helpful?
Was this helpful?
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"
}
}
}