For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Ethereum Beacon — Builder, Config, Debug, Events, Node, Validator (2/3)

API reference for Ethereum Beacon. All methods ->

Part 2 of 3: 1 · 2 · 3

Node

Endpoints to query node related information.

GET /eth/v1/node/identity

Retrieves node network identity.

Retrieves data about the node's network presence.

Parameters

None.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/identity" \
-H "Accept: application/json"

Responses

  • 200: Success.
{
"data": {
"peer_id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
"enr": "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8",
"p2p_addresses": [
"/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
],
"discovery_addresses": [
"/ip4/7.7.7.7/udp/30303/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N"
],
"metadata": {
"seq_number": "1",
"attnets": "0x0000000000000000",
"syncnets": "0x0f"
}
}
}
  • 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

GET /eth/v1/node/peers

Retrieves node network peers.

Retrieves data about the node's network peers. By default, this returns all peers. Multiple query params are combined using AND conditions.

Parameters

  • state (array[string]; query): available values : disconnected, connecting, connected, disconnecting.
  • direction (array[string]; query): available values : inbound, outbound.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/peers" \
-H "Accept: application/json"

Responses

  • Code 200: Success.
{
"data": [
{
"peer_id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
"enr": "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8",
"last_seen_p2p_address": "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
"state": "disconnected",
"direction": "inbound"
}
],
"meta": {
"count": 1
}
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

GET /eth/v1/node/peers/{peer_id}

Retrieves a peer.

Retrieves data about the given peer.

Parameters

  • peer_id (string; path; required): a peer ID; example: QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/peers/{peer_id}" \
-H "Accept: application/json"

Responses

  • Code 200: Success.
{
"data": {
"peer_id": "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
"enr": "enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8",
"last_seen_p2p_address": "/ip4/7.7.7.7/tcp/4242/p2p/QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N",
"state": "disconnected",
"direction": "inbound"
}
}
  • Code 400: The peer ID supplied could not be parsed.
{
"code": 400,
"message": "Invalid peer ID: localhost"
}
  • Code 404: Peer not found.
{
"code": 404,
"message": "Peer not found"
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

GET /eth/v1/node/peer_count

Retrieves peer count.

Retrieves number of known peers.

Parameters

None.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/peer_count" \
-H "Accept: application/json"

Responses

  • Code 200: Success.
{
"data": {
"disconnected": "12",
"connecting": "34",
"connected": "56",
"disconnecting": "5"
}
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

GET /eth/v1/node/version

Retrieves a version string of the running Beacon node.

Requests that the beacon node identify information about its implementation in a format similar to an HTTP User-Agent field.

Parameters

None.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/version" \
-H "Accept: application/json"

Responses

  • Code 200: Success.
{
"data": {
"version": "Lighthouse/v0.1.5 (Linux x86_64)"
}
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

GET /eth/v1/node/syncing

Retrieves a node syncing status.

Requests the beacon node to describe if it's currently syncing or not, and if it is, what block it is up to.

Parameters

None.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/syncing" \
-H "Accept: application/json"

Responses

  • Code 200: Success.
{
"data": {
"head_slot": "1",
"sync_distance": "1",
"is_syncing": true,
"is_optimistic": true,
"el_offline": true
}
}
  • Code 500: Beacon node internal error.
{
"code": 500,
"message": "Internal server error"
}

GET /eth/v1/node/health

Retrieves health check.

Returns node health status in http status codes. Useful for load balancers.

Parameters

None.

Request example

curl -X GET "https://rpc.ankr.com/premium-http/eth_beacon/YOUR_ANKR_API_KEY/eth/v1/node/health"

Responses

  • Code 200: Node is ready.
  • Code 206: Node is syncing but can serve incomplete data.
  • Code 400: Invalid syncing status code.
  • Code 503: Node not initialized or having issues.