Skip to main content

getblockchaininfo


description: >- Gives back an object with a variety of status details related to blockchain processing.


getblockchaininfo

Example Request and Result for getblockchaininfo method

In this section, we provide an illustrative example of a request made to retrieve details contents using the getblockchaininfo method. Additionally, we present the resulting response containing information details about the status of the blockchain processing.

Parameters

  • none
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!

returns an object containing the details of various states' blockchain processing

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

Request Body

NameTypeDescription
jsonrpc*string1.0
id*stringbwarelabs
method*stringgetblockchaininfo
params*array<string>[]
{
"result": {
"chain": "main",
"blocks": 830259,
"headers": 830259,
"bestblockhash": "000000000000000000025c1be24710e2455dbd3d9560e45b4f5d904e9717598c",
"difficulty": 75502165623893.72,
"time": 1707812560,
"mediantime": 1707809509,
"verificationprogress": 0.9999995194235158,
"initialblockdownload": false,
"chainwork": "00000000000000000000000000000000000000006a17a5b7216cb5116d1778a0",
"size_on_disk": 623055614995,
"pruned": false,
"warnings": ""
},
"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": "getblockchaininfo",
"params": []
}'