# eth_getFinalizedHeader

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

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

Returns the latest finalized execution payload header. The finality threshold is selected via `verifiedValidatorNum`; negative values are shortcuts: `-1` (≥ 1/2 validators), `-2` (≥ 2/3 validators), `-3` (all validators). The method returns the block header at the height equal to `max(fastFinalizedHeight, probabilisticFinalizedHeight)`.

Reference: https://www.alchemy.com/docs/chains/bnb-smart-chain/bnb-smart-chain-api-endpoints/eth-get-finalized-header

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| verifiedValidatorNum | integer | Yes | Number of validators required to verify the block for probabilistic finality. Must be in `[1, len(currentValidators)]` or one of the shortcut values: `-1` (≥ 1/2 validators), `-2` (≥ 2/3 validators), `-3` (all validators). |

## Result

**Finalized Header** (object): The finalized execution block header.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "eth_getFinalizedHeader",
  "params": [
    -3
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "baseFeePerGas": "0x0",
    "blobGasUsed": "0x0",
    "difficulty": "0x2",
    "excessBlobGas": "0x0",
    "extraData": "0xda8301060788643233646130343588676f312e32342e30836c696e004d518ce1f8b5831dffffb860b8c7390a8a9be245067620f30a4abd6f53290868da89fa6dbec51cf4168e03e1cd468da4302a7f45ce6492654c3f9ad3105a94e74f17e804ca6552306a314faca45222569612e7078c599e44a39eb93b6da80a903951b0cb4823bf5bd7732f46f84c84056f9bc5a04bc9b5101c179acd90c83a2ac1ff4685ed2b3576ccf24f2e8fd3870b1724efe784056f9bc6a028942e7a678e3f57ca057f6e58a69d0809247ae1bbf1d20b23eb8c72b6abdfa080b28358139305554bd08572388924d7249814fec1931c2ba25e646e3aab6e4a3935ae814c324138005140b593ef0c010f77e576d37c48389e78c282e7cabce75b01",
    "gasLimit": "0x3473bc0",
    "gasUsed": "0xb498a1",
    "hash": "0xdef001fe94c26896c92b875b97558a674824d0a643409edc616a845833578f2c",
    "logsBloom": "0xbe791bc23204004153e2505dc28ca82d012a9ea080584296c53824821112010fb48e148959285e0a7820f0802f020085179f30102654b5a02eb00236d52f08884510b613c5689d8d859818398001602338539d5090c4093b001c081730533d082f2800680a8a44b098c062ad0656482429405a4060068fc96d208ed18d7e244046a1d2acf82a0d6091852902240807f699749fc7804ed00a810453408013c564420ca1690112103339558996076d8c40d3044a2c4a808b693563182c6c27400de1b8b102ea16a019144300a12040d8012f24e500809e7a187c3043bf4478e0fae9506b2a900749004d607e14807101a10c00e4111d821c4cc78b0c80028c0a44",
    "milliTimestamp": "0x19d696b712a",
    "miner": "0xca503a7ed99eca485da2e875aedf7758472c378c",
    "mixHash": "0x00000000000000000000000000000000000000000000000000000000000000fa",
    "nonce": "0x0000000000000000",
    "number": "0x56f9bc7",
    "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "parentHash": "0x28942e7a678e3f57ca057f6e58a69d0809247ae1bbf1d20b23eb8c72b6abdfa0",
    "receiptsRoot": "0x59dac4d7b272eabe4a755f869c3ec87033d993ee392f8a70067fed733c7f8f4f",
    "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "size": "0x67d2",
    "stateRoot": "0xbfb9084e605d265d79844e82109f0fc3395c0ee09b46beef8523a5dea36afe17",
    "timestamp": "0x69d55afe",
    "totalDifficulty": "0xad64c73",
    "transactionsRoot": "0xb19dc98f4f0c28f6f40abc86b3de6b5299784e78dbcc1c6cf6f1e285e48edcf2",
    "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
  },
  "id": 1
}
```

## Code Examples

### cURL

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

### JavaScript

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

fetch('https://bnb-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://bnb-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getFinalizedHeader",
    "params": [-3]
}
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://bnb-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getFinalizedHeader\",\n  \"params\": [\n    -3\n  ]\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://bnb-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"eth_getFinalizedHeader\",\n  \"params\": [\n    -3\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://bnb-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\": \"eth_getFinalizedHeader\",\n  \"params\": [\n    -3\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: eth_getFinalizedHeader
description: 'Returns the latest finalized execution payload header. The finality threshold is selected via `verifiedValidatorNum`; negative values are shortcuts: `-1` (≥ 1/2 validators), `-2` (≥ 2/3 validators), `-3` (all validators). The method returns the block header at the height equal to `max(fastFinalizedHeight, probabilisticFinalizedHeight)`.'
params:
  - name: verifiedValidatorNum
    required: true
    description: 'Number of validators required to verify the block for probabilistic finality. Must be in `[1, len(currentValidators)]` or one of the shortcut values: `-1` (≥ 1/2 validators), `-2` (≥ 2/3 validators), `-3` (all validators).'
    schema:
      type: integer
result:
  name: Finalized Header
  description: The finalized execution block header.
  schema:
    type: object
    properties:
      baseFeePerGas:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Base fee per gas in hex.
      blobGasUsed:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Blob gas used in the block.
      difficulty:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Block difficulty.
      excessBlobGas:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Excess blob gas.
      extraData:
        title: hex encoded bytes
        type: string
        pattern: ^0x[0-9a-f]*$
        description: Extra data field.
      gasLimit:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Block gas limit.
      gasUsed:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Total gas used in the block.
      hash:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Block hash.
      logsBloom:
        description: Bloom filter for logs.
        title: 256 hex encoded bytes
        type: string
        pattern: ^0x[0-9a-f]{512}$
      milliTimestamp:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Block timestamp in milliseconds since Unix epoch.
      miner:
        title: hex encoded address
        type: string
        pattern: ^0x[0-9a-fA-F]{40}$
        description: Beneficiary/miner address.
      mixHash:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Mix hash.
      nonce:
        description: Block nonce.
        title: 8 hex encoded bytes
        type: string
        pattern: ^0x[0-9a-f]{16}$
      number:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Block number.
      parentBeaconBlockRoot:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Parent beacon block root.
      parentHash:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Parent block hash.
      receiptsRoot:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Receipts trie root.
      requestsHash:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Requests hash.
      sha3Uncles:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Uncles/ommers hash.
      size:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Block size in bytes.
      stateRoot:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: State trie root.
      timestamp:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Block timestamp in seconds since Unix epoch.
      totalDifficulty:
        title: hex encoded unsigned integer
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
        description: Total difficulty up to this block.
      transactionsRoot:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Transactions trie root.
      withdrawalsRoot:
        title: 32 byte hex value
        type: string
        pattern: ^0x[0-9a-f]{64}$
        description: Withdrawals trie root.
examples:
  - name: eth_getFinalizedHeader example
    params:
      - name: verifiedValidatorNum
        value: -3
    result:
      name: Finalized Header
      value:
        baseFeePerGas: '0x0'
        blobGasUsed: '0x0'
        difficulty: '0x2'
        excessBlobGas: '0x0'
        extraData: '0xda8301060788643233646130343588676f312e32342e30836c696e004d518ce1f8b5831dffffb860b8c7390a8a9be245067620f30a4abd6f53290868da89fa6dbec51cf4168e03e1cd468da4302a7f45ce6492654c3f9ad3105a94e74f17e804ca6552306a314faca45222569612e7078c599e44a39eb93b6da80a903951b0cb4823bf5bd7732f46f84c84056f9bc5a04bc9b5101c179acd90c83a2ac1ff4685ed2b3576ccf24f2e8fd3870b1724efe784056f9bc6a028942e7a678e3f57ca057f6e58a69d0809247ae1bbf1d20b23eb8c72b6abdfa080b28358139305554bd08572388924d7249814fec1931c2ba25e646e3aab6e4a3935ae814c324138005140b593ef0c010f77e576d37c48389e78c282e7cabce75b01'
        gasLimit: '0x3473bc0'
        gasUsed: '0xb498a1'
        hash: '0xdef001fe94c26896c92b875b97558a674824d0a643409edc616a845833578f2c'
        logsBloom: '0xbe791bc23204004153e2505dc28ca82d012a9ea080584296c53824821112010fb48e148959285e0a7820f0802f020085179f30102654b5a02eb00236d52f08884510b613c5689d8d859818398001602338539d5090c4093b001c081730533d082f2800680a8a44b098c062ad0656482429405a4060068fc96d208ed18d7e244046a1d2acf82a0d6091852902240807f699749fc7804ed00a810453408013c564420ca1690112103339558996076d8c40d3044a2c4a808b693563182c6c27400de1b8b102ea16a019144300a12040d8012f24e500809e7a187c3043bf4478e0fae9506b2a900749004d607e14807101a10c00e4111d821c4cc78b0c80028c0a44'
        milliTimestamp: '0x19d696b712a'
        miner: '0xca503a7ed99eca485da2e875aedf7758472c378c'
        mixHash: '0x00000000000000000000000000000000000000000000000000000000000000fa'
        nonce: '0x0000000000000000'
        number: '0x56f9bc7'
        parentBeaconBlockRoot: '0x0000000000000000000000000000000000000000000000000000000000000000'
        parentHash: '0x28942e7a678e3f57ca057f6e58a69d0809247ae1bbf1d20b23eb8c72b6abdfa0'
        receiptsRoot: '0x59dac4d7b272eabe4a755f869c3ec87033d993ee392f8a70067fed733c7f8f4f'
        requestsHash: '0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
        sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347'
        size: '0x67d2'
        stateRoot: '0xbfb9084e605d265d79844e82109f0fc3395c0ee09b46beef8523a5dea36afe17'
        timestamp: '0x69d55afe'
        totalDifficulty: '0xad64c73'
        transactionsRoot: '0xb19dc98f4f0c28f6f40abc86b3de6b5299784e78dbcc1c6cf6f1e285e48edcf2'
        withdrawalsRoot: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
```
