/wallet/getblockbynum - Tron
Example code for the getblockbynum REST method. Complete guide on how to use getblockbynum REST method in GetBlock Web3 documentation.
Parameters
Parameter
Type
Required
Description
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/wallet/getblockbynum' \
--header 'Content-Type: application/json' \
--data-raw '{
"num": 68000000
}'const response = await fetch(
'https://go.getblock.io/<ACCESS-TOKEN>/wallet/getblockbynum',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"num": 68000000})
}
);
console.log(await response.json());import requests
response = requests.post(
'https://go.getblock.io/<ACCESS-TOKEN>/wallet/getblockbynum',
headers={'Content-Type': 'application/json'},
json={"num": 68000000}
)
print(response.json())Response
{
"blockID": "0000000002f3a5b0f6d2e6c9a1b4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8",
"block_header": {
"raw_data": {
"number": 68000000,
"timestamp": 1719400000000,
"witness_address": "41e72d833e0c46837c0802864acc5f119a0a904d05"
}
},
"transactions": [
{
"txID": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62"
}
]
}Response Parameters
Field
Type
Description
Use Cases
Error Handling
HTTP Status
Message
Description
Was this helpful?