# /v1/debug/fork_choice

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

GET https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/debug/fork_choice

Retrieves the current fork choice context of the beacon node. This debug endpoint exposes internal fork choice data and is intended for advanced inspection and troubleshooting.


Reference: https://www.alchemy.com/docs/chains/ethereum/ethereum-beacon-api-endpoints/ethereum-beacon-api-endpoints/v-1-debug-fork-choice

## Code Examples

### cURL

```bash
curl --request GET \
  --url https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/debug/fork_choice
```

### JavaScript

```javascript
const options = {method: 'GET'};

fetch('https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/debug/fork_choice', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/debug/fork_choice"

response = requests.get(url)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/debug/fork_choice"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.get("https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/debug/fork_choice")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://eth-mainnetbeacon.g.alchemy.com/v2/docs-demo/eth/v1/debug/fork_choice");
var client = new RestClient(options);
var request = new RestRequest("");
var response = await client.GetAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /eth/v1/debug/fork_choice
method: GET
operation:
  summary: /v1/debug/fork_choice
  description: |
    Retrieves the current fork choice context of the beacon node. This debug endpoint exposes internal fork choice data and is intended for advanced inspection and troubleshooting.
  tags:
    - Ethereum Beacon API Endpoints
  security:
    - apiKey: []
  responses:
    '200':
      description: Fork choice data retrieved successfully.
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: object
                description: Fork choice context (debug).
                additionalProperties: true
```
