Skip to main content

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 block to query. The default value is latest. You can input block number (decimal string), block hash (64-character hexadecimal string starting with 0x), or block tag (earliest, latest). "earliest" refers to the first block, "latest" refers to the most recent block.
Responses
hashstringrequired
A field representing the block hash. Provided as a 64-character hexadecimal string prefixed with 0x.
numberintegerrequired
A field representing the block number or block height. Provided as a decimal string.
timestampintegerrequired
A field representing the time when the block was created. This field is provided as a UNIX timestamp.
parentHashstringrequired
A field representing the hash of the parent block. Provided as a 64-character hexadecimal string prefixed with 0x.
noncestringrequired
A value used to prove block validity in Proof of Work (PoW). Returns 0x0000000000000000 for blocks after the transition to Proof of Stake (PoS).
stateRootstringrequired
A field representing the root hash of the block state. Provided as a 64-character hexadecimal string prefixed with 0x.
receiptsRootstringrequired
A field representing the root hash of all transaction receipts in the block. Provided as a 64-character hexadecimal string prefixed with 0x.
transactionsRootstringrequired
A field representing the root hash of all transactions in the block. Provided as a 64-character hexadecimal string prefixed with 0x.
minerstringrequired
A field representing the address of the miner who created the block. Provided as a 40-character hexadecimal string prefixed with 0x.
difficultystringrequired
A field representing the block creation difficulty. Returns the difficulty value for Proof of Work (PoW), and 0 for blocks after the transition to Proof of Stake (PoS).
totalDifficultystringrequired
A field representing the cumulative block creation difficulty. Returns the sum of difficulty from block 0 to the current block. Provided as a hexadecimal string prefixed with 0x.
mixHashstringrequired
A value used to prove block validity in Proof of Work (PoW). Provided as a 64-character hexadecimal string prefixed with 0x.
gasLimitstringrequired
A field representing the maximum gas allowed for the block. The sum of gas used by all transactions in the block must be less than this value. Provided as a hexadecimal string prefixed with 0x.
gasUsedstringrequired
A field representing the total gas used by all transactions in the block. Provided as a hexadecimal string prefixed with 0x.
baseFeePerGasstring
A field representing the block base gas fee. Part of the variable fee model introduced in EIP-1559 (London Hard fork). This field is not provided for blocks before this introduction. Provided as a hexadecimal string prefixed with 0x.
sizestringrequired
A field representing the size of the block in bytes. Provided as a hexadecimal string prefixed with 0x.
logsBloomstringrequired
A field representing the logs bloom of all transactions in the block. Provided as a 512-character hexadecimal string prefixed with 0x.
extraDatastringrequired
A field representing additional data added by the block creator. Returns 0x when no value was added. Provided as a hexadecimal string prefixed with 0x.
sha3Unclesstringrequired
A field representing the hash of all uncle blocks in the block. Provided as a 64-character hexadecimal string prefixed with 0x.
transactionsCountintegerrequired
A field representing the number of transactions in the block.
transactionsarrayrequired
A field representing the list of transactions in the block.
withdrawalsRootstring
A field representing the root hash of all withdrawal transactions in the block. Provided as a 64-character hexadecimal string prefixed with 0x.
withdrawalsCountinteger
A field representing the number of withdrawal transactions included in the block.
A field representing the list of withdrawals of staked assets by validators.
indexstringrequired
A field representing the index of the withdrawal transaction. Provided as an integer starting from 0, in decimal string format.
validatorIndexstringrequired
A field representing the index of the validator who requested the withdrawal. Provided in decimal string format.
addressstringrequired
A field representing the address that receives the withdrawn Native Token. Provided as a 40-character hexadecimal string prefixed with 0x.
amountstringrequired
A field representing the withdrawn amount. Provided in decimal string format.
requestsHashstring
A field in the block header that is a cryptographic commitment of the order and content of all requests in the block. This allows verification of the integrity of the request list within the block without downloading the full data.
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/avalanche/mainnet/blockchain/getBlockByHashOrNumber' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"block": "latest"
}'