getblock
POST
Returns information about the block with the given block hash.The response format depends on the
verbosity value.🚧 Is the response slow? Requesting transaction data can make the response take longer!
Setting verbosity to 2 also returns the details of every transaction in the block,
so the response time grows substantially for blocks with many transactions.
If you need a fast response, set verbosity to 1 to retrieve transaction ids only.
param[0]
blockHashstringrequired
The hash of the block to look up.param[1]
verbosityintegerrequired
The level of detail in the response. 0 returns a hex-encoded string, 1 the list of transaction ids, 2 the transaction details, and 3 the transaction details including the prevout of each input.Responses
hashstring
The block hash, identical to the value provided in the request.confirmationsinteger
The number of confirmations, or -1 if the block is not on the main chain.sizeinteger
The block size, in bytes.strippedsizeinteger
The block size excluding witness data, in bytes.weightinteger
The block weight as defined in BIP 141.heightinteger
The block height.versioninteger
The block version.versionHexstring
The block version in hexadecimal.merklerootstring
The merkle root of the transactions in the block.txarray
The list of transactions included in the block.When verbosity is 1, an array of transaction id strings is returned; when 2 or higher, an array of transaction objects is returned.When verbosity is 3, each input additionally includes its prevout data.timeinteger
The block time expressed in UNIX epoch time.mediantimeinteger
The median time of the preceding 11 blocks, expressed in UNIX epoch time.nonceinteger
The nonce used for proof of work.bitsstring
nBits, the compact representation of the block difficulty target.targetstring
The difficulty target, in hexadecimal.difficultynumber
The difficulty of the block.chainworkstring
The expected number of hashes required to produce the chain up to this block, in hexadecimal.nTxinteger
The number of transactions in the block.previousblockhashstring
The hash of the previous block.nextblockhashstring
The hash of the next block.codestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "ERROR_CODE","message": "Unauthorized"}
cURL
curl -X POST 'https://bitcoin-mainnet.nodit.io' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo' \-d '{"jsonrpc": "2.0","id": 1,"method": "getblock","params": ["000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d",1]}'