getblockhash - Bitcoin
getblockhash. Retrieves the unique hash identifier of a specific Bitcoin block based on its height within the blockchain.
getblockhash - bitcoin [Value: 30CU]
Retrieves the hash of a block by height.
Use cases
- Retrieve the hash of a specific Bitcoin block
- Verify block identity by height
- Audit blockchain structure with block hashes
Constraints
- Requires valid block height
- Only retrieves hashes for existing blocks
- Depends on node sync
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --request POST \
--url ' https://bitcoin.drpc.org' \
--header 'Content-Type: application/json' \
--data '{"method": "getblockhash", "params": [1000], "id": 1, "jsonrpc": "2.0"}'
Response
200
{
"jsonrpc": "2.0",
"id": 1,
"result": "0000000000000b4d3eecf8f6c8e4f678dce7061b15e0e4f0a1e9b123456789ab0"
}
Request params
idinteger
jsonrpcstring
methodstring
integer
heightnumeric
Required. The height index of the block in the blockchain.
Response
200
Response params
object
idinteger
jsonrpcstring
resultstring
The hash of the block.
errorstring
The error message, if any.