Get metric aggregations for multiple projects
curl --request GET \
--url https://api.tokenterminal.com/v2/metric-aggregations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenterminal.com/v2/metric-aggregations"
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/metric-aggregations', 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-aggregations",
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/metric-aggregations"
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/metric-aggregations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenterminal.com/v2/metric-aggregations")
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": [
{
"project_name": "<string>",
"project_id": "<string>",
"metric_id": "<string>",
"metric_aggregation_name": "<string>",
"value": "<string>"
}
],
"errors": [
{
"code": "NOT_FOUND",
"field": "project_ids",
"value": "invalid-project"
}
]
}Metrics
Get metric aggregations for multiple projects
Use this endpoint to retrieve metric aggregations for multiple projects.
You can get all aggregations for all projects by omitting project_ids and metric_ids parameters. Fetching all projects or metrics you can omit the parameter or using parameter value all.
This endpoint supports partial success - if some of the requested project or metric IDs are not found, the endpoint will return data for the valid entities and include an errors array with details about the invalid ones.
GET
/
v2
/
metric-aggregations
Get metric aggregations for multiple projects
curl --request GET \
--url https://api.tokenterminal.com/v2/metric-aggregations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tokenterminal.com/v2/metric-aggregations"
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/metric-aggregations', 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-aggregations",
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/metric-aggregations"
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/metric-aggregations")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenterminal.com/v2/metric-aggregations")
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": [
{
"project_name": "<string>",
"project_id": "<string>",
"metric_id": "<string>",
"metric_aggregation_name": "<string>",
"value": "<string>"
}
],
"errors": [
{
"code": "NOT_FOUND",
"field": "project_ids",
"value": "invalid-project"
}
]
}Authorizations
Query Parameters
Response
200 - application/json
OK