Skip to main content

getblockchaininfo

Overview

The 'getblockchaininfo ' method returns a comprehensive object that encapsulates various details about the current state of blockchain processing.

Request

wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'X-CoinAPI-Key: 4303fb63-adec-42dc-b571-74bc2f2a5167' \
--body-data '{"jsonrpc":"2.0","id":1,"method":"getblockchaininfo","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

This method does not require any parameters.

Response

An object containing the following properties:

  • chain: Specifies the name of the network currently in use (options include main, test, or regtest).

  • blocks: Represents the height of the most-work fully-validated chain. Note that the genesis block is denoted as height 0.

  • headers: Indicates the total number of headers that have been validated up to this point.

  • bestblockhash: Provides the hash of the block that is currently considered the best block.

  • difficulty: Displays the difficulty level associated with the block at the highest height.

  • time: Specifies the timestamp associated with the current best block.

  • mediantime: Denotes the median time calculated for the current best block.

  • verificationprogress: Gives an estimated value of the verification progress, ranging between 0 and 1.

  • initialblockdownload: (Debug Information) An estimation that indicates whether the node is in the Initial Block Download mode.

  • chainwork: Represents the total amount of work in the active chain, displayed in hexadecimal format.

  • size_on_disk: An estimation of the combined size of the block and undo files stored on the disk.

  • pruned: A flag that indicates whether the blocks are subject to pruning or not.

  • warnings: Contains any warnings related to the network and blockchain.

  • error: In case of an error, this field will contain the respective error message.