curl --request GET \
--url 'https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key='import requests
url = "https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"asset": "btc",
"time": "2021-01-01T15:30:00.000000000Z",
"chains_count": "2",
"blocks_count_at_tip": "1",
"reorg": "true",
"reorg_depth": "1",
"chains": [
[
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033aa",
"height": "679917",
"time": "2021-01-01T15:00:00.000000000Z"
},
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033ac",
"height": "679918",
"time": "2021-01-01T15:20:00.000000000Z"
},
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033ad",
"height": "679919",
"time": "2021-01-01T15:30:00.000000000Z"
}
],
[
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033aa",
"height": "679917",
"time": "2021-01-01T15:00:00.000000000Z"
},
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033ab",
"height": "679918",
"time": "2021-01-01T15:10:00.000000000Z"
}
]
]
}
],
"next_page_token": "0.MjAyMS0wNC0yMFQxNTozODozNS4zNzgwOTBa",
"next_page_url": "https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=<your_key>&pretty=true&assets=btc&page_size=3&next_page_token=0.MjAyMS0wNC0yMFQxNTozODozNS4zNzgwOTBa"
}Asset chains (experimental)
Returns the chains of blocks for the specified assets.
Lists all the chains that were active in the blockchain during the time that’s enough to produce the number of blocks considered as an industry-standard number of confirmations.
A new entry is created when we detect any new block anywhere in the chain.
This endpoint is useful for those who want to quickly detect reorganizations or visualize currently active chains.
If there are two or more active chains, then the response will contain the chain fragments starting from their common ancestor block. Otherwise, if there is a single active chain - only the blockchain tip is returned.
The reorganization depth is measured as a number of consecutive blocks that were disconnected from the common ancestor block.
Results are ordered by tuple (asset, time).
To fetch the next page of results use next_page_url JSON response field.
curl --request GET \
--url 'https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key='import requests
url = "https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key="
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": [
{
"asset": "btc",
"time": "2021-01-01T15:30:00.000000000Z",
"chains_count": "2",
"blocks_count_at_tip": "1",
"reorg": "true",
"reorg_depth": "1",
"chains": [
[
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033aa",
"height": "679917",
"time": "2021-01-01T15:00:00.000000000Z"
},
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033ac",
"height": "679918",
"time": "2021-01-01T15:20:00.000000000Z"
},
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033ad",
"height": "679919",
"time": "2021-01-01T15:30:00.000000000Z"
}
],
[
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033aa",
"height": "679917",
"time": "2021-01-01T15:00:00.000000000Z"
},
{
"hash": "000000000000000000004035d600016c2005b4238acb2750625126542b8033ab",
"height": "679918",
"time": "2021-01-01T15:10:00.000000000Z"
}
]
]
}
],
"next_page_token": "0.MjAyMS0wNC0yMFQxNTozODozNS4zNzgwOTBa",
"next_page_url": "https://api.coinmetrics.io/v4/timeseries/asset-chains?api_key=<your_key>&pretty=true&assets=btc&page_size=3&next_page_token=0.MjAyMS0wNC0yMFQxNTozODozNS4zNzgwOTBa"
}Authorizations
Query Parameters
Start of the time interval.
This field refers to the time field in the response.
Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789Z, 2006-01-20, 20060120.
Inclusive by default.
UTC timezone by default. Z suffix is optional and timezone parameter has a priority over it.
If start_time is omitted, response will include time series from the earliest time available.
End of the time interval.
This field refers to the time field in the response.
Multiple formats of ISO 8601 are supported: 2006-01-20T00:00:00Z, 2006-01-20T00:00:00.000Z, 2006-01-20T00:00:00.123456Z, 2006-01-20T00:00:00.123456789Z, 2006-01-20, 20060120.
Inclusive by default.
UTC timezone by default. Z suffix is optional and timezone parameter has a priority over it.
If end_time is omitted, response will include time series up to the latest time available.
Timezone name for start_time and end_time timestamps.
This parameter does not modify the output times, which are always UTC.
Format is defined by TZ database.
"America/New_York"

