curl --request GET \
--url https://api.tokenterminal.com/v2/assets/{asset_id}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenterminal.com/v2/assets/{asset_id}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tokenterminal.com/v2/assets/{asset_id}/metrics', 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.tokenterminal.com/v2/assets/{asset_id}/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tokenterminal.com/v2/assets/{asset_id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tokenterminal.com/v2/assets/{asset_id}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenterminal.com/v2/assets/{asset_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"timestamp": "<string>",
"asset_id": "<string>",
"metric_id": "<string>",
"value": "<string>"
}
]
}Get historical metrics for an asset
Use this endpoint to retrieve historical data for an asset.
This endpoint supports partial success - if some of the requested metric, chain, or product IDs are not found, the endpoint will return data for the valid entities and include an errors array with details about the invalid ones.
curl --request GET \
--url https://api.tokenterminal.com/v2/assets/{asset_id}/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenterminal.com/v2/assets/{asset_id}/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tokenterminal.com/v2/assets/{asset_id}/metrics', 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.tokenterminal.com/v2/assets/{asset_id}/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tokenterminal.com/v2/assets/{asset_id}/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tokenterminal.com/v2/assets/{asset_id}/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenterminal.com/v2/assets/{asset_id}/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"timestamp": "<string>",
"asset_id": "<string>",
"metric_id": "<string>",
"value": "<string>"
}
]
}Authorizations
Path Parameters
Query Parameters
Level of granularity
This feature enables more detailed queries of specific metrics. For instance, you can examine an asset's metrics by individual chain.
However, it's important to note that this level of granularity is not applicable to all metrics.
The only supported value is chain.
chain Timestamp ordering
Allows you to define how the response is sorted. The response is always sorted by timestamp, and by selecting desc the response starts from the most recent entry, and vice versa for asc.
If no order_direction is selected, the response defaults to desc.
asc, desc