getblockchaininfo - Bitcoin
getblockchaininfo. Provides comprehensive details about the current state and status of the Bitcoin blockchain
getblockchaininfo - bitcoin [Value: 30CU]
Provides an overview of the blockchain’s status, including network and difficulty information.
Use cases
- Retrieve blockchain status
- Get current block height
- Check node's blockchain info
Constraints
- Requires running node
- Depends on node sync
- Varies with node state
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl https://bitcoin.drpc.org \
-X POST \
-H "Content-Type: application/json" \
--data '{ "method": "getblockchaininfo" }'
Response
200
{
"jsonrpc": "2.0",
"id": "curltest",
"result": {
"chain": "main",
"blocks": 681543,
"headers": 681543,
"bestblockhash": "0000000000000000000abcdefabcdefabcdefabcdefabcdefabcdefabcdef",
"difficulty": 1234567.89012345,
"mediantime": 1625569780,
"verificationprogress": 0.999999,
"initialblockdownload": false,
"chainwork": "0000000000000000000000000000000000000000000000000000000000000000",
"size_on_disk": 4294967296,
"pruned": false
}
}
Request params
idinteger
jsonrpcstring
methodstring
Response
200
Response params
object
idinteger
jsonrpcstring
resultnumeric
object
chainstring
The name of the current network (main, test, regtest).
blocksnumeric
The height of the most-work fully-validated chain. The genesis block has height 0.
headersnumeric
The current number of headers validated.
bestblockhashstring
The hash of the current best block.
difficultynumeric
The difficulty of the highest height block.
timenumeric
The time for the current best block.
mediantimenumeric
The median time for the current best block.
verificationprogressnumber
An estimate of verification progress [0..1].
initialblockdownloadboolean
(Debug information) An estimate of whether this node is in Initial Block Download mode.
chainworkstring
Total amount of work in the active chain in hexadecimal form.
size_on_disknumeric
The estimated size of the block and undo files on disk.
prunedboolean
Indicates if the blocks are subject to pruning.
warningsstring
Any network and blockchain warnings.
errorstring
The error message, if any.