Skip to main content

chain_getHeader - JSON-RPC Method

Description#

Retrieves the header of a specific block without the body (extrinsics). More efficient than chain_getBlock when you only need header information.

Parameters#

ParameterTypeRequiredDescription
blockHashstringNoHex-encoded block hash. If omitted, returns the latest block header

Request Example#

{ "jsonrpc": "2.0", "method": "chain_getHeader", "params": [], "id": 1 }

Code Examples#

import requests, json
url = "https://api-acala.n.dwellir.com/YOUR_API_KEY"
payload = {"jsonrpc":"2.0","method":"chain_getHeader","params":[],"id":1}
print(requests.post(url, headers={"Content-Type":"application/json"}, data=json.dumps(payload)).json()["result"])