Get Block by Hash or Number
POST
Returns specific information about a block queried by block hash or block number.
Path Parameters
chainstringrequired
Parameter specifying the target chain to query.networkstringrequired
Parameter specifying the network of the target chain.Request Body
blockstringrequired
Parameter specifying the point in time for balance query. You can enter one of the following formats:- block hash: 64-character hexadecimal string (256-bit). Queries based on the specified block hash.
- block number: Decimal string. Queries based on the specified block height.
- block tag: Enter "earliest" or "latest" to query the first block or the most recent block.
Responses
hashstringrequired
SHA-256 hash value that uniquely identifies the block. Generated by combining block header information; serves as a unique identifier within the blockchain with no duplicates.heightintegerrequired
Number indicating the position of the block in the blockchain. The genesis block starts at 0, and subsequent blocks increment by 1.versionintegerrequired
Block version number, used to identify the block validation rules used by the network. Updated when new features are added.timestampintegerrequired
Represents when the block was created, displayed as a UNIX timestamp.nonceintegerrequired
Value used in the Proof-of-Work algorithm; a variable that is changed multiple times to find a valid block hash.bitsstringrequired
Compressed 32-bit hexadecimal value representing the difficulty target that the block hash must satisfy. This value varies according to the network's mining difficulty.difficultystringrequired
Represents the difficulty of the block, calculated as the ratio between the initial target value and the current target value. Reflects the relative difficulty of mining.merkleRootstringrequired
Root hash value calculated by constructing a Merkle tree from the hashes of all transactions included in the block. Used to verify data integrity.transactionCountintegerrequired
Indicates the total number of transactions included in the block. Used to check the volume of transactions in a mined block.sizeintegerrequired
Total size of the block including header and transaction data, in bytes. Represents the actual disk space required to store the block data.weightintegerrequired
Block weight calculated according to BIP-141, taking SegWit data into account.previousBlockHashstringrequired
Hash of the previous block; maintains the linkage between blocks in the blockchain. Null for the genesis block.nextBlockHashstringrequired
Hash of the next block; null for the most recent block. Indicates the end of the chain.medianTimeintegerrequired
Median of the timestamps of the most recent 11 blocks. Used to reduce time volatility and provide a more stable block time.strippedSizeintegerrequired
Size of the block excluding SegWit data. Measured in bytes; represents the raw transaction data and header size.transactionsarrayrequired
Array of transaction hash values included in the block. Each transaction is identified by its unique hash.codestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "MISSING_REQUIRED_PARAMETER","message": "Missing required parameter: { PARAMETER_NAME }"}
cURL
curl -X POST 'https://web3.nodit.io/v1/bitcoin/mainnet/blockchain/getBlockByHashOrNumber' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo' \-d '{"block": "latest"}'