getbestblockhash

Gives back the hash of the most-workfully-validated chain's best (tip) block.

Example Request and Result for getbestblockhash method

In this section, we provide an illustrative example of a request made to retrieve details contents using the getbestblockhash method. Additionally, we present the resulting response containing information about the hash of the best block.

Parameters

  • none

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!

Returns the hash of the best (tip) block

POST https://bitcoin-mainnet.blastapi.io/<project-id>

Request Body

{
    "result": "00000000000000000000af2d02f35a4b40a3d5544270cb10407f0f3d3aba050a",
    "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": "curltest",
    "method": "getbestblockhash",
    "params": []
}'

Last updated