ots_getHeaderByNumber JSON-RPC method retrieves block header information by block number on the Hyperliquid EVM blockchain. This Otterscan-specific method provides a lightweight way to fetch block headers without retrieving full block data, making it efficient for block explorer operations.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
- block number (integer, required): The block number to retrieve the header for
Response
The method returns a block header object with the following fields:Response structure
- number— the block number
- hash— the block hash
- parentHash— the parent block hash
- nonce— proof-of-work nonce (always 0x0000000000000000 for PoS)
- sha3Uncles— SHA3 hash of the uncles data
- logsBloom— bloom filter for the logs
- transactionsRoot— root of the transaction trie
- stateRoot— root of the final state trie
- receiptsRoot— root of the receipts trie
- miner— address of the beneficiary
- difficulty— difficulty for this block
- totalDifficulty— total difficulty of the chain until this block
- extraData— extra data field of this block
- size— size of this block in bytes
- gasLimit— maximum gas allowed in this block
- gasUsed— total gas used by all transactions
- timestamp— Unix timestamp of the block
- mixHash— mix hash for the block
- baseFeePerGas— base fee per gas (post-EIP-1559)
Usage example
Shell
Example response
Use cases
Theots_getHeaderByNumber method is essential for:
- Block explorers: Efficiently fetch block header information without full block data
- Light clients: Verify blockchain state with minimal data requirements
- Node detection: Identify if a node supports Otterscan APIs
- Block monitoring: Track new blocks with reduced bandwidth usage
- Chain analysis: Analyze block production patterns and timing
- Header verification: Validate block headers for security checks
- Timestamp tracking: Monitor block timestamps for time-based operations
- Gas analysis: Track gas usage and limits across blocks
- Fork detection: Monitor chain reorganizations via parent hash tracking
- Performance optimization: Reduce data transfer when only header data is needed
Body
application/json