> ## 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.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/getforkinformation",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Fork version by state ID

> Query the Beacon Chain fork version and epoch for any state using the eth/v1/beacon/states/{state_id}/fork endpoint to track consensus layer upgrades.

`get https\://beacon-nd-422-757-666.p2pify.com/0a9d79d93fb2f4a4b1e04695da2b77a7/eth/v1/beacon/states/\{state\_id}/fork
`

<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` — the identifier for the state for which fork information is being requested. The `state_id` can be:

  * `head` — represents the latest canonical state in the node's view.
  * `genesis` — refers to the state at the genesis or the start of the Beacon Chain.
  * `finalized` — the state that is finalized and accepted by the network with minimal likelihood of reorganization.
  * `justified` — a state that has recently achieved justification, which is a precursor to finalization in the Ethereum 2.0 proof of stake mechanism.
  * `<slot>` — specific slot number in the Ethereum 2.0 protocol timeline.
  * `<hex encoded stateroot with 0x prefix>` — the specific state root of interest, encoded in hexadecimal format.

### Path Params

<ParamField path="state_id" type="string" required={true} default="head">
  State identifier which can be a slot number, an epoch number, a block root, or special values like 'genesis' or 'head'.
</ParamField>

## Response

The response is an object containing the following fields:

* `execution_optimistic` — a boolean indicating if the response is based on an unverified execution payload. If `true`implies that the payload might be invalidated later. The absence of this field implies a default value of `false`.

* `finalized` — a boolean indicating if the response pertains to the finalized history of the chain. If absent, it suggests the need for additional calls to determine the epoch’s relation to the finalized checkpoint.

* `data` — an object containing:

  * `previous_version` — a hexadecimal string representing the fork version of the state before the current fork.
  * `current_version` — a hexadecimal string indicating the fork version of the current state.
  * `epoch` — the epoch number at which the current version was adopted.

### 200

Successful response with fork information

<ResponseField name="epoch" type="string">
  The epoch number at which the current version was applied.
</ResponseField>

<ResponseField name="previous_version" type="string">
  The previous fork version.
</ResponseField>

<ResponseField name="current_version" type="string">
  The current fork version.
</ResponseField>

### 400

Invalid state identifier value

<ResponseField name="code" type="integer" />

<ResponseField name="message" type="string" />

<ResponseField name="stacktraces" type="string[]" />

<ResponseExample>
  ```json 200 theme={"system"}
  {
    "epoch": "string",
    "previous_version": "string",
    "current_version": "string"
  }
  ```

  ```json 400 theme={"system"}
  {
    "code": 0,
    "message": "string",
    "stacktraces": [
      "string"
    ]
  }
  ```
</ResponseExample>
