# zone_finalizedBeaconHeight

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

POST https://zerointerop-mainnet.g.alchemy.com/v2/{apiKey}

Returns the last finalized beacon chain height that the node has followed, together with the Interop Zone's committed and settled block heights at that beacon height. All three values come from one snapshot, so they're consistent with each other.

The method takes no parameters. Passing any parameter returns an "invalid params" error.

Reference: https://www.alchemy.com/docs/chains/zero/zero-api-endpoints/zone-finalized-beacon-height

## Result

**Finalized beacon height** (object): The last finalized beacon height and the zone heights recorded in it.

## Example

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "beaconHeight": "0xd8a75",
    "committedHeight": "0x9fbf",
    "settledHeight": "0x9fbf"
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "zone_finalizedBeaconHeight"
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'zone_finalizedBeaconHeight'})
};

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

### Python

```python
import requests

url = "https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "zone_finalizedBeaconHeight"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

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

func main() {

	url := "https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"zone_finalizedBeaconHeight\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"zone_finalizedBeaconHeight\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"zone_finalizedBeaconHeight\"\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: zone_finalizedBeaconHeight
summary: Returns the last finalized beacon height and the zone's committed and settled heights at that point.
description: |-
  Returns the last finalized beacon chain height that the node has followed, together with the Interop Zone's committed and settled block heights at that beacon height. All three values come from one snapshot, so they're consistent with each other.

  The method takes no parameters. Passing any parameter returns an "invalid params" error.
x-compute-units: 20
params: []
result:
  name: Finalized beacon height
  description: The last finalized beacon height and the zone heights recorded in it.
  schema:
    title: Finalized beacon height
    type: object
    required:
      - beaconHeight
      - committedHeight
      - settledHeight
    properties:
      beaconHeight:
        title: Beacon height
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: The last finalized beacon chain height the node has followed.
      committedHeight:
        title: Committed height
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: The highest zone block height committed as of `beaconHeight`.
      settledHeight:
        title: Settled height
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: The highest zone block height settled as of `beaconHeight`.
examples:
  - name: zone_finalizedBeaconHeight example
    params: []
    result:
      name: Finalized beacon height
      value:
        beaconHeight: '0xd8a75'
        committedHeight: '0x9fbf'
        settledHeight: '0x9fbf'
errors:
  - code: -32602
    message: Invalid params (the method takes no parameters)
```
