Ethereum Beacon
Available for Premium users only.
Ethereum Beacon API is available on Web3 API platform (opens in a new tab) upon switching on the Beacon toggle.
The Beacon Chain is a consensus layer that introduced a proof-of-stake (opens in a new tab) to Ethereum. The Beacon Chain mechanism is responsible for creating new blocks, making sure those new blocks are valid, and rewarding validators with ETH for keeping the network secure.
In order for your Web3 application to interact with the Beacon Chain — either by reading blockchain data or sending transactions to the network — it must connect to a Beacon node. Developers interact with the blockchain using the methods provided by the API.
Beacon API uses the REST interface for querying, responses come in JSON format (opens in a new tab).
Methods supported
Beacon:
GET /eth/v1/beacon/genesis
— retrieves the details of the chain's genesis.GET /eth/v1/beacon/states/{state_id}/root
— retrieves the state SSZ HashTreeRoot.GET /eth/v1/beacon/states/{state_id}/fork
— retrieves the Fork object for a requested state.GET /eth/v1/beacon/states/{state_id}/finality_checkpoints
— retrieves state finality checkpoints.GET /eth/v1/beacon/states/{state_id}/validators
— retrieves validators from state.POST /eth/v1/beacon/states/{state_id}/validators
— retrieves validators from state.GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}
— retrieves the validator from state by ID.GET /eth/v1/beacon/states/{state_id}/validator_balances
— retrieves validator balances from state.GET /eth/v1/beacon/states/{state_id}/committees
— retrieves all committees for a state.GET /eth/v1/beacon/states/{state_id}/sync_committees
— retrieves sync committees for a state.GET /eth/v1/beacon/headers
— retrieves block headers.GET /eth/v1/beacon/headers/{block_id}
— retrieves a block header.POST /eth/v1/beacon/blocks
— publishes a signed block.POST /eth/v1/beacon/blinded_blocks
— publishes a signed block.GET /eth/v2/beacon/blocks/{block_id}
— retrieves a block.GET /eth/v1/beacon/blocks/{block_id}/root
— retrieves a block root.GET /eth/v1/beacon/blocks/{block_id}/attestations
— retrieves block attestations.GET /eth/v1/beacon/pool/attestations
— retrieves attestations from the operations pool.POST /eth/v1/beacon/pool/attestations
— submits attestation objects to the node.GET /eth/v1/beacon/pool/attester_slashings
— retrieves attester slashings from the operations pool.POST /eth/v1/beacon/pool/attester_slashings
— submits the AttesterSlashing object to the node's pool.GET /eth/v1/beacon/pool/proposer_slashings
— retrieves proposer slashings from the operations pool.POST /eth/v1/beacon/pool/proposer_slashings
— submits the ProposerSlashing object to the node's pool.POST /eth/v1/beacon/pool/sync_committees
— submits sync committee signatures to the node.GET /eth/v1/beacon/pool/voluntary_exits
— retrieves SignedVoluntaryExit from the operations pool.POST /eth/v1/beacon/pool/voluntary_exits
— submits the SignedVoluntaryExit object to the node's pool.
Builder:
GET /eth/v1/builder/states/{state_id}/expected_withdrawals
— retrieves the withdrawals that are to be included for the block built on the specified state.
Config:
GET /eth/v1/config/fork_schedule
— retrieves scheduled upcoming forks.GET /eth/v1/config/spec
— retrieves spec parameters.GET /eth/v1/config/deposit_contract
— retrieves a deposit contract address.
Debug:
GET /eth/v2/debug/beacon/states/{state_id}
— retrieves the full BeaconState object.GET /eth/v2/debug/beacon/heads
— retrieves fork choice leaves.GET /eth/v1/debug/fork_choice
— retrieves fork choice array.
Events:
GET /eth/v1/events
— subscribes to Beacon node events.
Node:
GET /eth/v1/node/identity
— retrieves node network identity.GET /eth/v1/node/peers
— retrieves node network peers.GET /eth/v1/node/peers/{peer_id}
— retrieves a peer.GET /eth/v1/node/peer_count
— retrieves peer count.GET /eth/v1/node/version
— retrieves a version string of the running Beacon node.GET /eth/v1/node/syncing
— retrieves a node syncing status.GET /eth/v1/node/health
— retrieves health check.
Validator:
POST /eth/v1/validator/duties/attester/{epoch}
— retrieves attester duties.GET /eth/v1/validator/duties/proposer/{epoch}
— retrieves block proposer duties.POST /eth/v1/validator/duties/sync/{epoch}
— retrieves sync committee duties.GET /eth/v3/validator/blocks/{slot}
— produces a new block, without signature.GET /eth/v1/validator/attestation_data
— produces attestation data.GET /eth/v1/validator/aggregate_attestation
— retrieves aggregated attestation.POST /eth/v1/validator/aggregate_and_proofs
— publishes multiple aggregate and proofs.POST /eth/v1/validator/beacon_committee_subscriptions
— signals the Beacon node to prepare for a committee subnet.POST /eth/v1/validator/sync_committee_subscriptions
— subscribes to sync committee subnets.POST /eth/v1/validator/beacon_committee_selections
— determines if a distributed validator has been selected to aggregate attestations.GET /eth/v1/validator/sync_committee_contribution
— produces a sync committee contribution.POST /eth/v1/validator/sync_committee_selections
— determines if a distributed validator has been selected to make a sync committee contribution.POST /eth/v1/validator/contribution_and_proofs
— publishes multiple contribution and proofs.POST /eth/v1/validator/prepare_beacon_proposer
— provides the Beacon node with proposals for the given validators.POST /eth/v1/validator/register_validator
— provides the Beacon node with registrations for the given validators to the external builder network.POST /eth/v1/validator/liveness/{epoch}
— indicates if a validator has been observed on the network.
ValidatorRequiredApi:
GET /eth/v1/beacon/genesis
— retrieves details of the chain's genesis.GET /eth/v1/beacon/states/{state_id}/fork
— retrieves the Fork object for a requested state.GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}
— retrieves the validator from state by ID.POST /eth/v1/beacon/blocks
— publishes a signed block.POST /eth/v2/beacon/blocks
— publishes a signed block.POST /eth/v1/beacon/blinded_blocks
— publishes a signed block.POST /eth/v2/beacon/blinded_blocks
— publishes a signed block.POST /eth/v1/beacon/pool/attestations
— submits attestation objects to the node.POST /eth/v1/beacon/pool/sync_committees
— submits sync committee signatures to the node.GET /eth/v1/node/syncing
— retrieves a node syncing status.GET /eth/v1/config/spec
— retrieves spec parameters.POST /eth/v1/validator/duties/attester/{epoch}
— retrieves attester duties.GET /eth/v1/validator/duties/proposer/{epoch}
— retrieves block proposer duties.POST /eth/v1/validator/duties/sync/{epoch}
— retrieves sync committee duties.GET /eth/v3/validator/blocks/{slot}
— produces a new block, without signature.GET /eth/v1/validator/attestation_data
— produces attestation data.GET /eth/v1/validator/aggregate_attestation
— retrieves aggregated attestation.POST /eth/v1/validator/aggregate_and_proofs
— publishes multiple aggregate and proofs.POST /eth/v1/validator/beacon_committee_subscriptions
— signals the Beacon node to prepare for a committee subnet.POST /eth/v1/validator/sync_committee_subscriptions
— subscribes to sync committee subnets.GET /eth/v1/validator/sync_committee_contribution
— produces a sync committee contribution.POST /eth/v1/validator/contribution_and_proofs
— publishes multiple contribution and proofs.POST /eth/v1/validator/prepare_beacon_proposer
— provides the Beacon node with proposals for the given validators.GET /eth/v1/events
— subscribes to Beacon node events.
Rewards:
POST /eth/v1/beacon/rewards/sync_committee/{block_id}
— retrieves sync committee rewards.GET /eth/v1/beacon/rewards/blocks/{block_id}
— retrieves sync committee rewards.POST /eth/v1/beacon/rewards/attestations/{epoch}
— retrieves attestations rewards.
Beacon
GET /eth/v1/beacon/genesis
Retrieves the details of the chain's genesis.
Returns the details of the chain's genesis which can be used to identify chain.
Parameters
None.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/genesis" \
-H "Accept: application/json"
Responses
200
: Success.
{
"data": {
"genesis_time": "1590832934",
"genesis_validators_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"genesis_fork_version": "0x00000000"
}
}
400
: Chain genesis info is not yet known.
{
"code": 404,
"message": "Chain genesis info is not yet known"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/states/{state_id}/root
Retrieves the state SSZ HashTreeRoot.
Calculates HashTreeRoot for state with given 'stateId'. If stateId is root, same value will be returned.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.
Example:head
.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/states/{state_id}/root" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": false,
"data": {
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
400
: Invalid state ID.
{
"code": 400,
"message": "Invalid state ID: current"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/states/{state_id}/fork
Retrieves the Fork object for a requested state.
Retrieves the Fork (opens in a new tab) object for state with given 'stateId'.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/states/{state_id}/fork" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"data": {
"previous_version": "0x00000000",
"current_version": "0x00000000",
"epoch": "1"
}
}
400
: Invalid state ID.
{
"code": 400,
"message": "Invalid state ID: current"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/states/{state_id}/finality_checkpoints
Retrieves state finality checkpoints.
Returns finality checkpoints for state with given 'stateId'. In case finality is not yet achieved, checkpoint should return epoch 0 and ZERO_HASH as root.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/states/{state_id}/finality_checkpoints" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": false,
"data": {
"previous_justified": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"current_justified": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"finalized": {
"epoch": "1",
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
}
400
: Invalid state ID.
{
"code": 400,
"message": "Invalid state ID: current"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/states/{state_id}/validators
Retrieves validators from state.
Returns filterable list of validators with their balance, status, and index.
Information will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no information will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; both the index and public key are returned for each validator, and can be used to confirm for which inputs a response has been returned.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.id
(array[string]; query): either a hex encoded public key (any bytes48 with 0x prefix) or validator index.status
(array; query): see the validator status specification (opens in a new tab).
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your-token}/eth/v1/beacon/states/{state_id}/validators" \
-H "Accept: application/json"
Responses
200
: Success
{
"execution_optimistic": false,
"finalized": 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"
}
}
]
}
400
: Invalid state or validator ID, or status.
{
"code": 400,
"message": "Invalid state ID: current"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
414
: Too many validator IDs.
{
"code": 414,
"message": "Too many validator IDs in request"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
POST /eth/v1/beacon/states/{state_id}/validators
Retrieves validators from state.
Returns filterable list of validators with their balance, status and index.
Information will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no information will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; both the index and public key are returned for each validator, and can be used to confirm for which inputs a response has been returned.
The POST
variant of this endpoint has the same semantics as the GET endpoint but passes the lists of IDs and statuses via a POST
body in order to enable larger requests.
-
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
. -
<request body>
(required): The lists of validator IDs and statuses to filter on. Either or both may benull
to signal that no filtering on that attribute is desired.
{
"ids": [
"string"
],
"statuses": [
"active_ongoing"
]
}
Request example
curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/{your-token}/eth/v1/beacon/states/{state_id}/validators" \
-H "Accept: application/json"
-d '{
"ids": [
"string"
],
"statuses": [
"active_ongoing"
]
}'
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": 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"
}
}
]
}
400
: Invalid state or validator ID, or status.
{
"code": 400,
"message": "Invalid state ID: current"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/states/{state_id}/validators/{validator_id}
Retrieves the validator from state by ID.
Returns validator specified by state and id or public key along with status and balance.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.validator_id
(string; path; required): either a hex encoded public key (any bytes48 with 0x prefix) or validator index.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/states/{state_id}/validators/{validator_id}" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": 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"
}
}
}
400
: Invalid state or validator ID, or status.
{
"code": 400,
"message": "Invalid state ID: current"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/states/{state_id}/validator_balances
Retrieves validator balances from state.
Returns filterable list of validators balances.
Balances will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no balance will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; the index and is returned for each balance, and can be used to confirm for which inputs a response has been returned.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.id
(array[string]; query): either a hex encoded public key (any bytes48 with 0x prefix) or validator index.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/states/{state_id}/validator_balances" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": false,
"data": [
{
"index": "1",
"balance": "1"
}
]
}
400
: Invalid state or validator ID, or status.
{
"code": 400,
"message": "Invalid state ID: current"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
414
: Too many validator IDs.
{
"code": 414,
"message": "Too many validator IDs in request"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
POST /eth/v1/beacon/states/{state_id}/validator_balances
Retrieves validator balances from state.
Returns filterable list of validators balances.
Balances will be returned for all indices or public key that match known validators. If an index or public key does not match any known validator, no balance will be returned but this will not cause an error. There are no guarantees for the returned data in terms of ordering; the index is returned for each balance, and can be used to confirm for which inputs a response has been returned.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.<request body>
: an array of either hex encoded public key (any bytes48 with 0x prefix) or validator index.
[
"string"
]
Request example
curl -X POST "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/states/{state_id}/validator_balances" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '[
"string"
]'
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": false,
"data": [
{
"index": "1",
"balance": "1"
}
]
}
400
: Invalid state or validator ID, or status.
{
"code": 400,
"message": "Invalid state ID: current"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/states/{state_id}/committees
Retrieves all committees for a state.
Retrieves the committees for the given state.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.epoch
(string; query): fetches committees for the given epoch; if not present then the committees for the epoch of the state will be obtained.index
(string; query): restricts returned values to those matching the supplied committee index.slot
(string; query): restricts returned values to those matching the supplied slot.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/states/{state_id}/committees" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": false,
"data": [
{
"index": "1",
"slot": "1",
"validators": [
"1"
]
}
]
}
400
: Invalid state ID, index, epoch, slot, or combination thereof.
{
"code": 400,
"message": "Slot does not belong in epoch"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/states/{state_id}/sync_committees
Retrieves sync committees for a state.
Retrieves the current sync committee for the given state. Also returns the subcommittee assignments.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.epoch
(string; query): fetches sync committees for the given epoch; if not present then the sync committees for the epoch of the state will be obtained.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/states/{state_id}/sync_committees" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": false,
"data": {
"validators": [
"1"
],
"validator_aggregates": [
[
"1"
]
]
}
}
400
: Invalid state ID, index, epoch, slot, or combination thereof.
{
"code": 400,
"message": "Slot does not belong in epoch"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/states/{state_id}/randao
Retrieves the RANDAO mix for some epoch in a specified state.
Fetch the RANDAO mix for the requested epoch from the state identified by state_id
.
If an epoch is not specified then the RANDAO mix for the state's current epoch will be returned.
By adjusting the state_id
parameter you can query for any historic value of the RANDAO mix. Ordinarily states from the same epoch will mutate the RANDAO mix for that epoch as blocks are applied.
Parameters
state_id
(string; path; required): state identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,justified
,<slot>
,<hex encoded stateRoot with 0x prefix>
.epoch
(string; query): fetches sync committees for the given epoch; if not present then the sync committees for the epoch of the state will be obtained.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/states/{state_id}/randao" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": false,
"data": {
"randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}
}
400
: Invalid state ID or epoch.
{
"code": 400,
"message": "Epoch is out of range for the `randao_mixes` of the state"
}
404
: State not found.
{
"code": 404,
"message": "State not found"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/headers
Retrieves block headers.
Retrieves block headers matching given query. By default, it will fetch current head slot blocks.
Parameters
slot
(string; query): a slot.parent_root
(string, hex; query): a parent root.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/headers" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": false,
"data": [
{
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"canonical": true,
"header": {
"message": {
"slot": "1",
"proposer_index": "1",
"parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
}
]
}
400
: The block ID supplied could not be parsed.
{
"code": 400,
"message": "Invalid block ID: current"
}
500
: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}
GET /eth/v1/beacon/headers/{block_id}
Retrieves a block header.
Retrieves a block header for a given block ID.
Parameters
block_id
(string; path; required): a block identifier. Can be one of:head
(canonical head in node's view),genesis
,finalized
,<slot>
,<hex encoded blockRoot with 0x prefix>
.
Request example
curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/{your_token}/eth/v1/beacon/headers/{block_id}" \
-H "Accept: application/json"
Responses
200
: Success.
{
"execution_optimistic": false,
"finalized": false,
"data": {
"root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"canonical": true,
"header": {
"message": {
"slot": "1",
"proposer_index": "1",
"parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
},
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}
}
}
400
: The block ID supplied could not be parsed.
{
"code": 400,
"message": "Invalid block ID: current"
}
404
: Block not found.
{
"code": 404,
"message": "Block not found"
}
500
: Beacon node internal error.