eth_getHeaderByNumber
curl --request POST \
--url https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getHeaderByNumber",
"params": [
"0x34808ff"
]
}
'import requests
url = "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getHeaderByNumber",
"params": ["0x34808ff"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({id: 1, jsonrpc: '2.0', method: 'eth_getHeaderByNumber', params: ['0x34808ff']})
};
fetch('https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'eth_getHeaderByNumber',
'params' => [
'0x34808ff'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getHeaderByNumber\",\n \"params\": [\n \"0x34808ff\"\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))
}HttpResponse<String> response = Unirest.post("https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getHeaderByNumber\",\n \"params\": [\n \"0x34808ff\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getHeaderByNumber\",\n \"params\": [\n \"0x34808ff\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "0x6dabcf7ed4cf53e05054a4d671b19b7597740bce1042019ff31af68dde9c98a9",
"parentHash": "0xfe1c06b10e6be606cad7b32b7da87bfba91fc1c45085b7ea12c69070e6cd3778",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"miner": "0xa693cc18aa09d33dd388013b7a02e5ff863b8760",
"stateRoot": "0xfd095b710adcb8045a8904d02c000f25230b151ef3a4e4b4dbf84ab083c2b9df",
"transactionsRoot": "0x1df73587a490d0ae7e236905773748ef07ea63c1c22aa93659eb8fd4f77ef04d",
"receiptsRoot": "0x968419399ee52ee3133e57e9111b513f941f269b5f7e83f358b5b894e8736362",
"logsBloom": "0x0000000000004000000010200400000040000010002000024080060400000000800000000000002200000000000000000040000402002201000000024000000011000401120800040000000900000200000100002000000100000000800000000000000006000000200a004400004800002000800000000000000010000000c0000000080000000010080000000000c800012001000880000040000000800000000000200240000000008000000000008000000020000000000000000004000004000023001000001008000004000002000000080404084000080110000020600000000000020000000400001002000008200440000100400000000010000000",
"difficulty": "0x0",
"number": "0x34808ff",
"gasLimit": "0x1c9c380",
"gasUsed": "0x1db35b",
"timestamp": "0x6a7026be",
"extraData": "0x00000004a817c800",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"baseFeePerGas": "0x4a817c800",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"blobGasUsed": "0x0",
"excessBlobGas": "0x0",
"parentBeaconBlockRoot": "0xfe1c06b10e6be606cad7b32b7da87bfba91fc1c45085b7ea12c69070e6cd3778",
"requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size": "0xbda"
}
}Arc node API
eth_getHeaderByNumber | Arc
Arc API method that returns the block header by block number. quantity or tag — the block number in hex format or block tag (latest, earliest, pending.
POST
/
eth_getHeaderByNumber
curl --request POST \
--url https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getHeaderByNumber",
"params": [
"0x34808ff"
]
}
'import requests
url = "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/"
payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getHeaderByNumber",
"params": ["0x34808ff"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({id: 1, jsonrpc: '2.0', method: 'eth_getHeaderByNumber', params: ['0x34808ff']})
};
fetch('https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'eth_getHeaderByNumber',
'params' => [
'0x34808ff'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/"
payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getHeaderByNumber\",\n \"params\": [\n \"0x34808ff\"\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))
}HttpResponse<String> response = Unirest.post("https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getHeaderByNumber\",\n \"params\": [\n \"0x34808ff\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://arc-testnet.core.chainstack.com/6caa7fd90475ac9214f7521dd460fa7c/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getHeaderByNumber\",\n \"params\": [\n \"0x34808ff\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {
"hash": "0x6dabcf7ed4cf53e05054a4d671b19b7597740bce1042019ff31af68dde9c98a9",
"parentHash": "0xfe1c06b10e6be606cad7b32b7da87bfba91fc1c45085b7ea12c69070e6cd3778",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"miner": "0xa693cc18aa09d33dd388013b7a02e5ff863b8760",
"stateRoot": "0xfd095b710adcb8045a8904d02c000f25230b151ef3a4e4b4dbf84ab083c2b9df",
"transactionsRoot": "0x1df73587a490d0ae7e236905773748ef07ea63c1c22aa93659eb8fd4f77ef04d",
"receiptsRoot": "0x968419399ee52ee3133e57e9111b513f941f269b5f7e83f358b5b894e8736362",
"logsBloom": "0x0000000000004000000010200400000040000010002000024080060400000000800000000000002200000000000000000040000402002201000000024000000011000401120800040000000900000200000100002000000100000000800000000000000006000000200a004400004800002000800000000000000010000000c0000000080000000010080000000000c800012001000880000040000000800000000000200240000000008000000000008000000020000000000000000004000004000023001000001008000004000002000000080404084000080110000020600000000000020000000400001002000008200440000100400000000010000000",
"difficulty": "0x0",
"number": "0x34808ff",
"gasLimit": "0x1c9c380",
"gasUsed": "0x1db35b",
"timestamp": "0x6a7026be",
"extraData": "0x00000004a817c800",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"baseFeePerGas": "0x4a817c800",
"withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"blobGasUsed": "0x0",
"excessBlobGas": "0x0",
"parentBeaconBlockRoot": "0xfe1c06b10e6be606cad7b32b7da87bfba91fc1c45085b7ea12c69070e6cd3778",
"requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"size": "0xbda"
}
}Arc API method that returns the block header by block number.
Parameters
quantity or tag— the block number in hex format or block tag (latest,earliest,pending,safe,finalized)
Response
object— the block header object
eth_getHeaderByNumber code examples
const { JsonRpcProvider } = require("ethers");
const provider = new JsonRpcProvider("CHAINSTACK_NODE_URL");
async function call() {
const result = await provider.send("eth_getHeaderByNumber", [
"latest"
]);
console.log(result);
}
call();
from web3 import Web3
node_url = "CHAINSTACK_NODE_URL"
web3 = Web3(Web3.HTTPProvider(node_url))
# Make the call
# Add your parameters here
# result = web3.eth.<method_name>(...)
print(result)
curl -X POST "CHAINSTACK_NODE_URL" \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getHeaderByNumber",
"params": ["0x34808ff"],
"id": 1
}'
Body
application/json
Last modified on August 3, 2026
Was this page helpful?
⌘I