Beacon API
/eth/v1/beacon/states/{state_id}/validators
Get validators from state
GET
/
eth
/
v1
/
beacon
/
states
/
{state_id}
/
validators
Get validators from state
curl --request GET \
--url 'https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators'import requests
url = "https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators', 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://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"execution_optimistic": false,
"data": [
{
"index": "1",
"balance": "1",
"status": "active_ongoing",
"validator": {
"pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
"withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"effective_balance": "1",
"slashed": false,
"activation_eligibility_epoch": "1",
"activation_epoch": "1",
"exit_epoch": "1",
"withdrawable_epoch": "1"
}
}
]
}{
"code": 400,
"message": "Invalid state ID: current"
}{
"code": 404,
"message": "State not found"
}{
"code": 500,
"message": "Internal server error"
}curl -X GET \
"https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/head/validators?status=active" \
-H "Content-Type: application/json"
curl -X GET \
"https://sepolia.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/head/validators?status=active" \
-H "Content-Type: application/json"
Path Parameters
State identifier. Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", <slot>, <hex encoded stateRoot with 0x prefix>.
Query Parameters
Either hex encoded public key (any bytes48 with 0x prefix) or validator index
Maximum array length:
30Either hex encoded public key (any bytes48 with 0x prefix) or validator index
Possible statuses:
- pending_initialized - When the first deposit is processed, but not enough funds are available (or not yet the end of the first epoch) to get validator into the activation queue.
- pending_queued - When validator is waiting to get activated, and have enough funds etc. while in the queue, validator activation epoch keeps changing until it gets to the front and make it through (finalization is a requirement here too).
- active_ongoing - When validator must be attesting, and have not initiated any exit.
- active_exiting - When validator is still active, but filed a voluntary request to exit.
- active_slashed - When validator is still active, but have a slashed status and is scheduled to exit.
- exited_unslashed - When validator has reached reguler exit epoch, not being slashed, and doesn't have to attest any more, but cannot withdraw yet.
- exited_slashed - When validator has reached reguler exit epoch, but was slashed, have to wait for a longer withdrawal period.
- withdrawal_possible - After validator has exited, a while later is permitted to move funds, and is truly out of the system.
- withdrawal_done - (not possible in phase0, except slashing full balance) - actually having moved funds away
Get validators from state
curl --request GET \
--url 'https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators'import requests
url = "https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators', 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://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.ethereum.validationcloud.io/v1/<YOUR_API_KEY_HERE>/eth/v1/beacon/states/{state_id}/validators")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"execution_optimistic": false,
"data": [
{
"index": "1",
"balance": "1",
"status": "active_ongoing",
"validator": {
"pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
"withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"effective_balance": "1",
"slashed": false,
"activation_eligibility_epoch": "1",
"activation_epoch": "1",
"exit_epoch": "1",
"withdrawable_epoch": "1"
}
}
]
}{
"code": 400,
"message": "Invalid state ID: current"
}{
"code": 404,
"message": "State not found"
}{
"code": 500,
"message": "Internal server error"
}