getblockhash
description: Gives back the block's hash given its height.
getblockhash
Example Request and Result for getblockhash method
In this section, we provide an illustrative example of a request made to retrieve details contents using the getblockhash
method. Additionally, we present the resulting response containing information about the block hash in the chain.
Parameters
Field | Type | Description |
---|---|---|
height* | numeric | The height index |
info
The example in this section uses a non-existing project id.
Make sure you replace it with your Bitcoin mainnet or Bitcoin Testnet endpoint when issuing the API calls.
Don't have a project id? Here's a straightforward guide on how to obtain one!
gives back the block's hash given its height.
POST
https://bitcoin-mainnet.blastapi.io/<project-id>
Request Body
Name | Type | Description |
---|---|---|
jsonrpc* | string | 1.0 |
id* | string | bwarelabs |
method* | string | getblockhash |
params* | array<string> | [23465] |
- 200: OK
{
"result": "00000000fc9d999e0556251ca99b0eae4c1578c77e0b010220f0b9e632a550a8",
"error": null,
"id": "bwarelabs"
}
Curl Request example
curl --location 'https://bitcoin-mainnet.blastapi.io/<project-id>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "1.0",
"id": "bwarelabs",
"method": "getblockhash",
"params": [
23465
]
}'