> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Debug beacon state by state_id

> Returns full BeaconState object for given stateId. This is a comprehensive debug endpoint that provides the complete state of the beacon chain at a specific point, including all validator information, balances, and other state details. Depending on Accept header it can be returned either as JSON or as bytes serialized by SSZ.

The `/eth/v2/debug/beacon/states/{state_id}` method is a debug API endpoint in the Ethereum Beacon Chain that provides the complete BeaconState object for a given state identifier. This endpoint is essential for developers, validators, and network engineers who need to inspect the full state of the beacon chain for debugging, analysis, or monitoring purposes. The BeaconState contains comprehensive information about all validators, their balances, attestations, and other critical chain state data.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `{state_id}`: This parameter specifies the identifier of the beacon state to retrieve. The state identifier can be:
  * `head` — the canonical head in the node's view (most recent state)
  * `genesis` — the initial state at chain genesis
  * `finalized` — the most recent finalized state
  * `justified` — the most recent justified state
  * A specific slot number (e.g., `1000`)
  * A hex-encoded state root with 0x prefix (e.g., `0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2`)

## Response

The response includes comprehensive state information:

* `version` — the consensus version of the state (phase0, altair, bellatrix, capella, deneb, or electra)
* `execution_optimistic` — boolean indicating if the response references an unverified execution payload
* `finalized` — boolean indicating if the response references the finalized history of the chain
* `data` — the complete BeaconState object containing:
  * `genesis_time` — Unix timestamp of chain genesis
  * `genesis_validators_root` — root hash of genesis validators
  * `slot` — current slot number
  * `fork` — fork version information
  * `latest_block_header` — most recent block header
  * `block_roots` — array of recent block roots
  * `state_roots` — array of recent state roots
  * `validators` — complete array of all validators with their properties
  * `balances` — array of all validator balances
  * `eth1_data` — Eth1 chain reference data
  * `eth1_data_votes` — pending Eth1 data votes
  * `eth1_deposit_index` — current deposit index from Eth1
  * `previous_justified_checkpoint` — previous justified checkpoint
  * `current_justified_checkpoint` — current justified checkpoint
  * `finalized_checkpoint` — most recent finalized checkpoint

## Usage notes

The `/eth/v2/debug/beacon/states/{state_id}` method is a powerful debugging tool that provides complete visibility into the beacon chain state. This endpoint returns extensive data and should be used judiciously as responses can be very large, especially for mainnet states with hundreds of thousands of validators.

The endpoint supports both JSON and SSZ (Simple Serialize) response formats. To receive SSZ-encoded data, set the `Accept` header to `application/octet-stream`. SSZ format is more efficient for large state transfers.

This is a debug endpoint and may not be available on all beacon nodes. It requires significant computational resources to serialize the complete state, so response times may be longer than standard API calls.


## OpenAPI

````yaml /openapi/ethereum_beacon_chain_api/debug/getDebugBeaconStateV2.json GET /beacon/2f6d649e68c2f861fecd5b8a9e35139e/eth/v2/debug/beacon/states/{state_id}
openapi: 3.0.0
info:
  title: Ethereum Beacon Debug State API
  version: 2.0.0
servers:
  - url: https://ethereum-mainnet.core.chainstack.com
security: []
paths:
  /beacon/2f6d649e68c2f861fecd5b8a9e35139e/eth/v2/debug/beacon/states/{state_id}:
    get:
      tags:
        - Debug
      summary: Get full BeaconState object
      description: >-
        Returns full BeaconState object for given stateId. This is a
        comprehensive debug endpoint that provides the complete state of the
        beacon chain at a specific point, including all validator information,
        balances, and other state details. Depending on Accept header it can be
        returned either as JSON or as bytes serialized by SSZ.
      operationId: getDebugBeaconStateV2
      parameters:
        - name: state_id
          in: path
          description: >-
            State identifier. Can be one of: 'head' (canonical head in node's
            view), 'genesis', 'finalized', 'justified', <slot>, <hex encoded
            stateRoot with 0x prefix>.
          required: true
          schema:
            type: string
            default: head
      responses:
        '200':
          description: Success - Full BeaconState object retrieved
          headers:
            Eth-Consensus-Version:
              description: >-
                The active consensus version to which the data belongs. Required
                in response so client can deserialize returned JSON or SSZ data
                more effectively.
              required: true
              schema:
                type: string
                enum:
                  - phase0
                  - altair
                  - bellatrix
                  - capella
                  - deneb
                  - electra
                example: deneb
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetStateV2Response'
            application/octet-stream:
              schema:
                type: string
                format: binary
                description: SSZ serialized BeaconState object
        '400':
          description: Invalid state ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: State not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    GetStateV2Response:
      type: object
      required:
        - version
        - execution_optimistic
        - finalized
        - data
      properties:
        version:
          type: string
          enum:
            - phase0
            - altair
            - bellatrix
            - capella
            - deneb
            - electra
          example: deneb
          description: The consensus version of the state
        execution_optimistic:
          type: boolean
          example: false
          description: >-
            True if the response references an unverified execution payload.
            Optimistic information may be invalidated at a later time.
        finalized:
          type: boolean
          example: false
          description: >-
            True if the response references the finalized history of the chain,
            as determined by fork choice.
        data:
          type: object
          description: >-
            The full BeaconState object. The structure varies based on the
            consensus version.
          properties:
            genesis_time:
              type: string
              example: '1606824023'
              description: Unix timestamp of the chain genesis
            genesis_validators_root:
              type: string
              format: hex
              example: >-
                0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95
              pattern: ^0x[a-fA-F0-9]{64}$
              description: Root hash of the genesis validators
            slot:
              type: string
              example: '1'
              description: Current slot number
            fork:
              type: object
              description: Fork information
              properties:
                previous_version:
                  type: string
                  format: hex
                  pattern: ^0x[a-fA-F0-9]{8}$
                current_version:
                  type: string
                  format: hex
                  pattern: ^0x[a-fA-F0-9]{8}$
                epoch:
                  type: string
                  example: '1'
            latest_block_header:
              type: object
              description: Latest block header information
            block_roots:
              type: array
              description: Array of recent block roots
              items:
                type: string
                format: hex
                pattern: ^0x[a-fA-F0-9]{64}$
            state_roots:
              type: array
              description: Array of recent state roots
              items:
                type: string
                format: hex
                pattern: ^0x[a-fA-F0-9]{64}$
            validators:
              type: array
              description: Array of all validators
              items:
                type: object
                properties:
                  pubkey:
                    type: string
                    format: hex
                    pattern: ^0x[a-fA-F0-9]{96}$
                  withdrawal_credentials:
                    type: string
                    format: hex
                    pattern: ^0x[a-fA-F0-9]{64}$
                  effective_balance:
                    type: string
                  slashed:
                    type: boolean
                  activation_eligibility_epoch:
                    type: string
                  activation_epoch:
                    type: string
                  exit_epoch:
                    type: string
                  withdrawable_epoch:
                    type: string
            balances:
              type: array
              description: Validator balances
              items:
                type: string
            eth1_data:
              type: object
              description: Eth1 chain data
            eth1_data_votes:
              type: array
              description: Votes for Eth1 data
              items:
                type: object
            eth1_deposit_index:
              type: string
              description: Eth1 deposit index
            previous_justified_checkpoint:
              type: object
              description: Previous justified checkpoint
            current_justified_checkpoint:
              type: object
              description: Current justified checkpoint
            finalized_checkpoint:
              type: object
              description: Finalized checkpoint
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          example: 404
        message:
          type: string
          example: State not found

````