curl --request POST \
--url https://api.tokenterminal.com/v2/metric-breakdown \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metric_ids": [
"<string>"
],
"project_ids": [
"<string>"
],
"product_ids": [
"<string>"
],
"chain_ids": [
"<string>"
],
"market_sector_ids": [
"blockchains-l1",
"lending"
],
"interval": "7d",
"start": "2023-12-25",
"end": "2023-12-25"
}
'import requests
url = "https://api.tokenterminal.com/v2/metric-breakdown"
payload = {
"metric_ids": ["<string>"],
"project_ids": ["<string>"],
"product_ids": ["<string>"],
"chain_ids": ["<string>"],
"market_sector_ids": ["blockchains-l1", "lending"],
"interval": "7d",
"start": "2023-12-25",
"end": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric_ids: ['<string>'],
project_ids: ['<string>'],
product_ids: ['<string>'],
chain_ids: ['<string>'],
market_sector_ids: ['blockchains-l1', 'lending'],
interval: '7d',
start: '2023-12-25',
end: '2023-12-25'
})
};
fetch('https://api.tokenterminal.com/v2/metric-breakdown', 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/metric-breakdown",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metric_ids' => [
'<string>'
],
'project_ids' => [
'<string>'
],
'product_ids' => [
'<string>'
],
'chain_ids' => [
'<string>'
],
'market_sector_ids' => [
'blockchains-l1',
'lending'
],
'interval' => '7d',
'start' => '2023-12-25',
'end' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenterminal.com/v2/metric-breakdown"
payload := strings.NewReader("{\n \"metric_ids\": [\n \"<string>\"\n ],\n \"project_ids\": [\n \"<string>\"\n ],\n \"product_ids\": [\n \"<string>\"\n ],\n \"chain_ids\": [\n \"<string>\"\n ],\n \"market_sector_ids\": [\n \"blockchains-l1\",\n \"lending\"\n ],\n \"interval\": \"7d\",\n \"start\": \"2023-12-25\",\n \"end\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tokenterminal.com/v2/metric-breakdown")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metric_ids\": [\n \"<string>\"\n ],\n \"project_ids\": [\n \"<string>\"\n ],\n \"product_ids\": [\n \"<string>\"\n ],\n \"chain_ids\": [\n \"<string>\"\n ],\n \"market_sector_ids\": [\n \"blockchains-l1\",\n \"lending\"\n ],\n \"interval\": \"7d\",\n \"start\": \"2023-12-25\",\n \"end\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenterminal.com/v2/metric-breakdown")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metric_ids\": [\n \"<string>\"\n ],\n \"project_ids\": [\n \"<string>\"\n ],\n \"product_ids\": [\n \"<string>\"\n ],\n \"chain_ids\": [\n \"<string>\"\n ],\n \"market_sector_ids\": [\n \"blockchains-l1\",\n \"lending\"\n ],\n \"interval\": \"7d\",\n \"start\": \"2023-12-25\",\n \"end\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"data_id": "usual",
"chain_id": "usual",
"product_id": "usual",
"metrics": {}
}
],
"errors": [
{
"code": "NOT_FOUND",
"field": "project_ids",
"value": "invalid-project"
}
]
}Get metric breakdown aggregation for multiple projects, chains, or products
Use this endpoint to retrieve metric breakdown aggregation for multiple projects including avg, change, sum, trend, and latest values over a given interval or date range. When looking at cumulative metrics such as fees, reference sums for the total aggregate, and when looking at static metrics such as total value locked, reference latest values for the latest running total. See the response reference below for more details.
This endpoint supports partial success - if some of the requested metric, project, 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 POST \
--url https://api.tokenterminal.com/v2/metric-breakdown \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metric_ids": [
"<string>"
],
"project_ids": [
"<string>"
],
"product_ids": [
"<string>"
],
"chain_ids": [
"<string>"
],
"market_sector_ids": [
"blockchains-l1",
"lending"
],
"interval": "7d",
"start": "2023-12-25",
"end": "2023-12-25"
}
'import requests
url = "https://api.tokenterminal.com/v2/metric-breakdown"
payload = {
"metric_ids": ["<string>"],
"project_ids": ["<string>"],
"product_ids": ["<string>"],
"chain_ids": ["<string>"],
"market_sector_ids": ["blockchains-l1", "lending"],
"interval": "7d",
"start": "2023-12-25",
"end": "2023-12-25"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric_ids: ['<string>'],
project_ids: ['<string>'],
product_ids: ['<string>'],
chain_ids: ['<string>'],
market_sector_ids: ['blockchains-l1', 'lending'],
interval: '7d',
start: '2023-12-25',
end: '2023-12-25'
})
};
fetch('https://api.tokenterminal.com/v2/metric-breakdown', 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/metric-breakdown",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'metric_ids' => [
'<string>'
],
'project_ids' => [
'<string>'
],
'product_ids' => [
'<string>'
],
'chain_ids' => [
'<string>'
],
'market_sector_ids' => [
'blockchains-l1',
'lending'
],
'interval' => '7d',
'start' => '2023-12-25',
'end' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenterminal.com/v2/metric-breakdown"
payload := strings.NewReader("{\n \"metric_ids\": [\n \"<string>\"\n ],\n \"project_ids\": [\n \"<string>\"\n ],\n \"product_ids\": [\n \"<string>\"\n ],\n \"chain_ids\": [\n \"<string>\"\n ],\n \"market_sector_ids\": [\n \"blockchains-l1\",\n \"lending\"\n ],\n \"interval\": \"7d\",\n \"start\": \"2023-12-25\",\n \"end\": \"2023-12-25\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tokenterminal.com/v2/metric-breakdown")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metric_ids\": [\n \"<string>\"\n ],\n \"project_ids\": [\n \"<string>\"\n ],\n \"product_ids\": [\n \"<string>\"\n ],\n \"chain_ids\": [\n \"<string>\"\n ],\n \"market_sector_ids\": [\n \"blockchains-l1\",\n \"lending\"\n ],\n \"interval\": \"7d\",\n \"start\": \"2023-12-25\",\n \"end\": \"2023-12-25\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenterminal.com/v2/metric-breakdown")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metric_ids\": [\n \"<string>\"\n ],\n \"project_ids\": [\n \"<string>\"\n ],\n \"product_ids\": [\n \"<string>\"\n ],\n \"chain_ids\": [\n \"<string>\"\n ],\n \"market_sector_ids\": [\n \"blockchains-l1\",\n \"lending\"\n ],\n \"interval\": \"7d\",\n \"start\": \"2023-12-25\",\n \"end\": \"2023-12-25\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"data_id": "usual",
"chain_id": "usual",
"product_id": "usual",
"metrics": {}
}
],
"errors": [
{
"code": "NOT_FOUND",
"field": "project_ids",
"value": "invalid-project"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Array of metric IDs to retrieve data for
How to group the results
projects, chains, chain-project, chain-product, chain-market-sector, market-sector, product Optional array of project IDs to filter by
Optional array of product IDs to filter by
Optional array of chain IDs to filter by
Optional list of market sector IDs to filter by
["blockchains-l1", "lending"]
Length of the aggregation window. Defaults to 7d. The window ends at the latest available date, or the day before end if given.
Ignored when both start and end are given; the window is then the date range [start, end).
24h, 7d, 30d, 90d, 180d, 365d, 1095d, 1825d, ytd, max First date of the aggregation window, inclusive (YYYY-MM-DD).
With end, the window is the half-open range [start, end) and interval is ignored. Without end, the window spans interval days starting on start.
End of the aggregation window, exclusive (YYYY-MM-DD). Data for this date is not included; must be after start, otherwise the request is rejected with a 400.
For a full calendar month use the first day of the next month, e.g. start=2026-08-01, end=2026-09-01. Without start, the window spans interval days ending the day before end. If omitted entirely, the window ends at the latest date for which data is available. If the day before end has no data yet, the window ends at the latest available date before it.
Response
OK