Skip to main content
GET
/
{chain_id}
/
api
/
v2
/
stats
Retrieve blockchain network statistics and metrics
curl --request GET \
  --url https://api.blockscout.com/{chain_id}/api/v2/stats \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.blockscout.com/{chain_id}/api/v2/stats"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.blockscout.com/{chain_id}/api/v2/stats', 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.blockscout.com/{chain_id}/api/v2/stats",
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.blockscout.com/{chain_id}/api/v2/stats"

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.blockscout.com/{chain_id}/api/v2/stats")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.blockscout.com/{chain_id}/api/v2/stats")

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
{
  "average_block_time": 123,
  "coin_image": "<string>",
  "coin_price": "<string>",
  "coin_price_change_percentage": 123,
  "gas_price_updated_at": "2023-11-07T05:31:56Z",
  "gas_prices": {},
  "gas_prices_update_in": 123,
  "gas_used_today": "<string>",
  "market_cap": "<string>",
  "network_utilization_percentage": 123,
  "secondary_coin_image": "<string>",
  "secondary_coin_price": "<string>",
  "static_gas_price": "<string>",
  "total_addresses": "<string>",
  "total_blocks": "<string>",
  "total_gas_used": "<string>",
  "total_transactions": "<string>",
  "transactions_today": "<string>",
  "tvl": "<string>"
}
{
"errors": [
{
"detail": "null value where string expected",
"source": {
"pointer": "/data/attributes/petName"
},
"title": "Invalid value"
}
]
}

Authorizations

Authorization
string
header
required

API key passed as a Bearer token in the Authorization header.

Path Parameters

chain_id
string
required

The ID of the blockchain

Response

Blockchain network statistics.

Stats response

average_block_time
number<float>
coin_image
string | null
coin_price
string | null
Pattern: ^([1-9][0-9]*|0)(\.[0-9]+)?$
coin_price_change_percentage
number<float> | null
gas_price_updated_at
string<date-time> | null
gas_prices
object | null
gas_prices_update_in
integer | null
gas_used_today
Pattern: ^-?([1-9][0-9]*|0)$
market_cap
string
Pattern: ^([1-9][0-9]*|0)(\.[0-9]+)?$
network_utilization_percentage
number | null
secondary_coin_image
string | null
secondary_coin_price
string | null
Pattern: ^([1-9][0-9]*|0)(\.[0-9]+)?$
static_gas_price
string | null
Pattern: ^-?([1-9][0-9]*|0)$
total_addresses
string
Pattern: ^-?([1-9][0-9]*|0)$
total_blocks
string
Pattern: ^-?([1-9][0-9]*|0)$
total_gas_used
string
Pattern: ^-?([1-9][0-9]*|0)$
total_transactions
string
Pattern: ^-?([1-9][0-9]*|0)$
transactions_today
string
Pattern: ^-?([1-9][0-9]*|0)$
tvl
string | null
Pattern: ^-?([1-9][0-9]*|0)$