---
updatedAt: 2025-09-18T22:06:45.000Z
agentTools:
  projectIndex: https://nodereal.readme.io/llms.txt
---

# Get validator from state by id

Returns validator specified by state and id or public key along with status and balance.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Eth Beacon Node API",
    "description": "API specification for the beacon node, which enables users to query and participate in Ethereum 2.0 phase 0 beacon chain.\n\nAll requests by default send and receive JSON, and as such should have either or both of the \"Content-Type: application/json\"\nand \"Accept: application/json\" headers.  In addition, some requests can return data in the SSZ format.  To indicate that SSZ\ndata is required in response to a request the header \"Accept: application/octet-stream\" should be sent.  Note that only a subset\nof requests can respond with data in SSZ format; these are noted in each individual request.\n\nAPI endpoints are individually versioned.  As such, there is no direct relationship between all v1 endpoints, all v2 endpoints,\n_etc._ and no such relationship should be inferred.  All JSON responses return the requested data under a `data` key in the top\nlevel of their response.  Additional metadata may or may not be present in other keys at the top level of the response, dependent\non the endpoint.  The rules that require an increase in version number are as follows:\n\n  - no field that is listed in an endpoint shall be removed without an increase in the version number\n  - no field that is listed in an endpoint shall be altered in terms of format (_e.g._ from a string to an array) without an\n    increase in the version number\n\nNote that it is possible for a field to be added to an endpoint's data or metadata without an increase in the version number.\n",
    "version": "v2.3.0 - Eth2Spec v1.1.0",
    "contact": {
      "name": "Ethereum Github",
      "url": "https://github.com/ethereum/beacon-apis/issues"
    },
    "license": {
      "name": "CC0-1.0",
      "url": "https://creativecommons.org/publicdomain/zero/1.0/"
    }
  },
  "servers": [
    {
      "url": "{server_url}/{api_key}",
      "variables": {
        "server_url": {
          "description": "Beacon node API url",
          "default": "eth2-beacon-mainnet.nodereal.io/v1"
        },
        "api_key": {
          "description": "Beacon node API key",
          "default": "api_key"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Beacon",
      "description": "Set of endpoints to query beacon chain."
    },
    {
      "name": "ValidatorRequiredApi",
      "description": "Minimal set of endpoints to enable a working validator implementation.\n\n[Checkout validator flow](./validator-flow.md) to learn how to use this api.\n"
    }
  ],
  "paths": {
    "/eth/v1/beacon/states/{state_id}/validators/{validator_id}": {
      "get": {
        "operationId": "getStateValidator",
        "summary": "Get validator from state by id",
        "description": "Returns validator specified by state and id or public key along with status and balance.",
        "tags": [
          "Beacon",
          "ValidatorRequiredApi"
        ],
        "parameters": [
          {
            "name": "state_id",
            "in": "path",
            "required": true,
            "example": "head",
            "schema": {
              "type": "string"
            },
            "description": "State identifier.\nCan be one of: \"head\" (canonical head in node's view), \"genesis\", \"finalized\", \"justified\", \\<slot\\>, \\<hex encoded stateRoot with 0x prefix\\>.\n"
          },
          {
            "name": "validator_id",
            "description": "Either hex encoded public key (any bytes48 with 0x prefix) or validator index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "title": "GetStateValidatorResponse",
                  "type": "object",
                  "properties": {
                    "execution_optimistic": {
                      "allOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "example": false
                        },
                        {
                          "description": "True if the response references an unverified execution payload. Optimistic information may be invalidated at a later time. If the field is not present, assume the False value."
                        }
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "allOf": [
                            {
                              "type": "string",
                              "example": "1"
                            },
                            {
                              "description": "Index of validator in validator registry."
                            }
                          ]
                        },
                        "balance": {
                          "allOf": [
                            {
                              "type": "string",
                              "example": "1"
                            },
                            {
                              "description": "Current validator balance in gwei."
                            }
                          ]
                        },
                        "status": {
                          "description": "Possible statuses:\n- **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.\n- **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).\n- **active_ongoing** - When validator must be attesting, and have not initiated any exit.\n- **active_exiting** - When validator is still active, but filed a voluntary request to exit.\n- **active_slashed** - When validator is still active, but have a slashed status and is scheduled to exit.\n- **exited_unslashed** - When validator has reached reguler exit epoch, not being slashed, and doesn't have to attest any more, but cannot withdraw yet.\n- **exited_slashed** - When validator has reached reguler exit epoch, but was slashed, have to wait for a longer withdrawal period.\n- **withdrawal_possible** - After validator has exited, a while later is permitted to move funds, and is truly out of the system.\n- **withdrawal_done** - (not possible in phase0, except slashing full balance) - actually having moved funds away\n\n[Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)\n",
                          "enum": [
                            "pending_initialized",
                            "pending_queued",
                            "active_ongoing",
                            "active_exiting",
                            "active_slashed",
                            "exited_unslashed",
                            "exited_slashed",
                            "withdrawal_possible",
                            "withdrawal_done"
                          ],
                          "example": "active_ongoing"
                        },
                        "validator": {
                          "type": "object",
                          "properties": {
                            "pubkey": {
                              "type": "string",
                              "pattern": "^0x[a-fA-F0-9]{96}$",
                              "description": "The validator's BLS public key, uniquely identifying them. _48-bytes, hex encoded with 0x prefix, case insensitive._",
                              "example": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"
                            },
                            "withdrawal_credentials": {
                              "allOf": [
                                {
                                  "type": "string",
                                  "example": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
                                  "pattern": "^0x[a-fA-F0-9]{64}$"
                                },
                                {
                                  "description": "Root of withdrawal credentials"
                                }
                              ]
                            },
                            "effective_balance": {
                              "allOf": [
                                {
                                  "type": "string",
                                  "example": "1"
                                },
                                {
                                  "description": "Balance at stake in Gwei."
                                }
                              ]
                            },
                            "slashed": {
                              "type": "boolean",
                              "example": false,
                              "description": "Was validator slashed (not longer active)."
                            },
                            "activation_eligibility_epoch": {
                              "allOf": [
                                {
                                  "type": "string",
                                  "example": "1"
                                },
                                {
                                  "description": "When criteria for activation were met."
                                }
                              ]
                            },
                            "activation_epoch": {
                              "allOf": [
                                {
                                  "type": "string",
                                  "example": "1"
                                },
                                {
                                  "description": "Epoch when validator activated. 'FAR_FUTURE_EPOCH' if not activated"
                                }
                              ]
                            },
                            "exit_epoch": {
                              "allOf": [
                                {
                                  "type": "string",
                                  "example": "1"
                                },
                                {
                                  "description": "Epoch when validator exited. 'FAR_FUTURE_EPOCH' if not exited."
                                }
                              ]
                            },
                            "withdrawable_epoch": {
                              "allOf": [
                                {
                                  "type": "string",
                                  "example": "1"
                                },
                                {
                                  "description": "When validator can withdraw or transfer funds. 'FAR_FUTURE_EPOCH' if not defined"
                                }
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid state or validator ID",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "properties": {
                        "code": {
                          "description": "Either specific error code in case of invalid request or http status code",
                          "type": "number",
                          "example": 404
                        },
                        "message": {
                          "description": "Message describing error",
                          "type": "string"
                        },
                        "stacktraces": {
                          "description": "Optional stacktraces, sent when node is in debug mode",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    {
                      "example": {
                        "code": 400,
                        "message": "Invalid state ID: current"
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "description": "Either specific error code in case of invalid request or http status code",
                      "type": "number",
                      "example": 404
                    },
                    "message": {
                      "description": "Message describing error",
                      "type": "string"
                    },
                    "stacktraces": {
                      "description": "Optional stacktraces, sent when node is in debug mode",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "examples": {
                  "StateNotFound": {
                    "value": {
                      "code": 404,
                      "message": "State not found"
                    }
                  },
                  "ValidatorNotFound": {
                    "value": {
                      "code": 404,
                      "message": "Validator not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Beacon node internal error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "description": "Either specific error code in case of invalid request or http status code",
                      "type": "number",
                      "example": 404
                    },
                    "message": {
                      "description": "Message describing error",
                      "type": "string"
                    },
                    "stacktraces": {
                      "description": "Optional stacktraces, sent when node is in debug mode",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "code": 500,
                  "message": "Internal server error"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```