Home

Get block hash by block number

POST
https://dot.nownodes.io/

Authorizations

ApiKeyAuthApiKeyAuth

api-key string

NOWNodes API key passed in the api-key header.

Get the hash of a specific block by its block number.

The chain_getBlockHash method returns the hash of the block header for the specified block number. If no block number is provided, it returns the hash of the latest finalized block.

This method is essential for:

  • Navigating the blockchain by block height
  • Verifying block existence and integrity
  • Building block explorers
  • Cross-referencing blocks across different queries

Body

application/json
jsonrpcstring2.0required

JSON-RPC version identifier

methodstringchain_getBlockHashrequired

The method to be invoked

idinteger | stringrequired

Request identifier for matching responses

paramsArray<integer | string>required

Array containing optional block number

Show child attributes
One of

Block number (height) to query

integer

Block number as hex string

string

Response

200OK

Block hash retrieved successfully

400Bad Request

Invalid block number or request

500Internal Server Error

Internal server error