curl --request POST \
--url https://beaconcha.in/api/v2/ethereum/state \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "mainnet"
}
'import requests
url = "https://beaconcha.in/api/v2/ethereum/state"
payload = { "chain": "mainnet" }
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({chain: 'mainnet'})
};
fetch('https://beaconcha.in/api/v2/ethereum/state', 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://beaconcha.in/api/v2/ethereum/state",
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([
'chain' => 'mainnet'
]),
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://beaconcha.in/api/v2/ethereum/state"
payload := strings.NewReader("{\n \"chain\": \"mainnet\"\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://beaconcha.in/api/v2/ethereum/state")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"mainnet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://beaconcha.in/api/v2/ethereum/state")
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 \"chain\": \"mainnet\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"chain_health": {
"is_finalizing": true
},
"chain_view": {
"head": {
"consensus_reference": {
"slot": 1,
"block_root": "<string>"
},
"execution_reference": {
"block": 1,
"hash": "<string>"
}
},
"justified": {
"consensus_reference": {
"slot": 1,
"block_root": "<string>"
},
"execution_reference": {
"block": 1,
"hash": "<string>"
}
},
"finalized": {
"consensus_reference": {
"slot": 1,
"block_root": "<string>"
},
"execution_reference": {
"block": 1,
"hash": "<string>"
}
},
"sync_committee_period": {
"period": 1,
"range": {
"slot": {
"start": 1,
"end": 1
},
"epoch": {
"start": 1,
"end": 1
},
"timestamp": {
"start": 1,
"end": 1
}
}
}
},
"data_freshness": {
"slot_lag": 123,
"finality_slot_lag": 123,
"slot": 1,
"finality_slot": 1
}
}
}{
"error": "Bad request. Please check your input and try again."
}{
"error": "Unauthorized. Please provide a valid API key."
}{
"error": "endpoint not allowed for your subscription tier. upgrade your subscription at https://beaconcha.in/pricing."
}{
"error": "The requested resource was not found."
}{
"error": "method not allowed: GET. all public API endpoints use POST."
}{
"error": "Rate limit exceeded. Please try again later."
}{
"error": "internal server error. please try again later."
}{
"error": "An unexpected error occurred."
}👀 Explorer State
Returns the explorer’s current view of the Ethereum chain, including network health, validator counts, balances, and finality status.
Unlike most API endpoints where processing lag is invisible, this endpoint explicitly exposes how far behind the explorer is relative to the actual chain head (see data_freshness). Use it to determine whether the data you’re querying from other endpoints is sufficiently up-to-date for your use case.
curl --request POST \
--url https://beaconcha.in/api/v2/ethereum/state \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chain": "mainnet"
}
'import requests
url = "https://beaconcha.in/api/v2/ethereum/state"
payload = { "chain": "mainnet" }
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({chain: 'mainnet'})
};
fetch('https://beaconcha.in/api/v2/ethereum/state', 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://beaconcha.in/api/v2/ethereum/state",
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([
'chain' => 'mainnet'
]),
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://beaconcha.in/api/v2/ethereum/state"
payload := strings.NewReader("{\n \"chain\": \"mainnet\"\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://beaconcha.in/api/v2/ethereum/state")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"mainnet\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://beaconcha.in/api/v2/ethereum/state")
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 \"chain\": \"mainnet\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"chain_health": {
"is_finalizing": true
},
"chain_view": {
"head": {
"consensus_reference": {
"slot": 1,
"block_root": "<string>"
},
"execution_reference": {
"block": 1,
"hash": "<string>"
}
},
"justified": {
"consensus_reference": {
"slot": 1,
"block_root": "<string>"
},
"execution_reference": {
"block": 1,
"hash": "<string>"
}
},
"finalized": {
"consensus_reference": {
"slot": 1,
"block_root": "<string>"
},
"execution_reference": {
"block": 1,
"hash": "<string>"
}
},
"sync_committee_period": {
"period": 1,
"range": {
"slot": {
"start": 1,
"end": 1
},
"epoch": {
"start": 1,
"end": 1
},
"timestamp": {
"start": 1,
"end": 1
}
}
}
},
"data_freshness": {
"slot_lag": 123,
"finality_slot_lag": 123,
"slot": 1,
"finality_slot": 1
}
}
}{
"error": "Bad request. Please check your input and try again."
}{
"error": "Unauthorized. Please provide a valid API key."
}{
"error": "endpoint not allowed for your subscription tier. upgrade your subscription at https://beaconcha.in/pricing."
}{
"error": "The requested resource was not found."
}{
"error": "method not allowed: GET. all public API endpoints use POST."
}{
"error": "Rate limit exceeded. Please try again later."
}{
"error": "internal server error. please try again later."
}{
"error": "An unexpected error occurred."
}Authorizations
Body
The Ethereum chain to query.
mainnet, hoodi Response
Successful response.
Response containing the current state of the chain.
The explorer's current view of the Ethereum chain, including network health, finality status, and chain progression.
This is the explorer's processed view, which may lag slightly behind the actual chain head.
See data_freshness to determine how up-to-date this information is relative to the real chain state.
Show child attributes
Show child attributes
Was this page helpful?

