getblockbynum - Tron
getblockbynum. Returns block details for a specific block number.
getblockbynum - tron [Value: 20CU]
Returns block details for a specific block number.
Use cases
- Also available as GET
- Fetch a specific historical block for auditing or indexing
Constraints
- Returns an empty object if num exceeds the current chain height
- Also available under /walletsolidity/ for confirmed (solidified) data instead of the latest state
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --request POST \
--url https://lb.drpc.live/tron/{API-KEY}/wallet/getblockbynum \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"num": 1}'Response
200
{
"blockID": "0000000003fe262d52bfa4b2814f816fd2e57af5b98a33d60d8630a03a908e0e",
"block_header": {
"raw_data": {
"number": 66987565,
"txTrieRoot": "faf8fe3858339ead25cc892461c82a59b84dca4a51c45b026676bf3f45a352a2",
"witness_address": "41b2f713d57dbcec679d93a8849fa0cd0e4db594ba",
"parentHash": "0000000003fe262c85cd6b02033f4c3e5c1efa35de256a17bd906dc61fb1aeed",
"version": 34,
"timestamp": 1777445121000
},
"witness_signature": "5b3cf6cb15d52947989f7726f4907a144b39ccd667a1a0f98707b40cdfe65b96173ddf34ae8dcc5e78f136e0cf903a15c7128984aa2191f02333209d1879d3f900"
},
"transactions": [
...
]
}Request params
idinteger
jsonrpcstring
methodstring
object
numinteger
The block number to look up
visibleboolean
Set to true to format addresses in Base58; set to false for hex format. (Default: false)
Response
200
Returns block details for a specific block number.Response params
object
blockIDstring
The unique hash identifying this block, encoding both its height and content.
block_headerobject
The block's header, containing metadata about its position in the chain and the producing witness.
object
raw_dataobject
The core header fields that were hashed and signed by the producing witness.
object
timestampinteger
Unix timestamp, in ms, at which this block was produced.
txTrieRootstring
The Merkle root hash of all transactions included in this block, used to verify their integrity.
parentHashstring
The blockID of the preceding block, linking this block into the chain.
numberinteger
The height (sequential number) of this block in the chain.
witness_addressstring
The address of the Super Representative who produced this block.
versioninteger
The block format version used by the node that produced this block.
witness_signaturestring
The hex-encoded signature from the producing witness, proving they authored this block.
transactionsarray_of_objects
The list of transactions included in this block, each with its execution outcome.
object
raw_dataobject
The unsigned transaction body containing the contract instruction and blockchain reference data.
object
ref_block_bytesstring
The last two bytes of the reference block number, used for transaction expiration and replay protection.
ref_block_hashstring
The last eight bytes of the reference block's hash, paired with ref_block_bytes for replay protection.
expirationinteger
Unix timestamp, in ms, after which this transaction would no longer be valid.
contractarray_of_objects
The list of contract instructions executed by this transaction.
object
parameterobject
The typed payload describing the specific contract call being made.
object
valueobject
The decoded fields of the contract — here, a smart contract call (e.g. a TRC20 token transfer).
object
owner_addressstring
The address that initiated the smart contract call, in hex format.
contract_addressstring
The address of the smart contract being invoked, in hex format.
datastring
The hex-encoded ABI-encoded call data, including the function selector and its arguments.
type_urlstring
The fully qualified protobuf type identifier describing which contract schema `value` should be decoded with.
typestring
The human-readable name of the contract type being executed (here, TriggerSmartContract).
timestampinteger
Unix timestamp, in ms, marking when the transaction was created/signed by the client.
fee_limitinteger
The maximum amount of TRX, in sun, the sender is willing to spend on Energy fees for this contract call.
signaturearray_of_strings
The list of hex-encoded signatures authorizing this transaction.
retarray_of_objects
The execution outcome of this transaction as recorded on-chain.
object
contractRetstring
The result status of the contract execution (e.g. SUCCESS, REVERT, OUT_OF_ENERGY).
raw_data_hexstring
The hex-encoded serialized bytes of this transaction's raw_data.
txIDstring
The unique transaction hash (transaction ID) for this transaction, computed as the SHA256 of raw_data.