/walletsolidity/gettransactioncountbyblocknum - Tron

This endpoint returns the number of transactions in a confirmed block, identified by height.

This is a Solidity-node endpoint. It returns only confirmed, irreversible data, so it is the correct interface for balance and payment verification. The Fullnode serves the same operation at https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/gettransactioncountbyblocknum over the latest, possibly unconfirmed state.

Parameters

ParameterTypeRequiredDescription
numintegerYesThe block height

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/walletsolidity/gettransactioncountbyblocknum' \
--header 'Content-Type: application/json' \
--data-raw '{
  "num": 68000000
}'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/walletsolidity/gettransactioncountbyblocknum',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"num": 68000000})
    }
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/walletsolidity/gettransactioncountbyblocknum',
    headers={'Content-Type': 'application/json'},
    json={"num": 68000000}
)

print(response.json())

Response

json{
  "count": 312
}

Response Parameters

FieldTypeDescription
countintegerNumber of transactions in the confirmed block

Use Cases

  • Block Analytics: Track confirmed transactions per block
  • Pagination: Size iteration over a confirmed block's transactions
  • Throughput Metrics: Measure finalized block fullness
  • Explorer Headers: Show the transaction count on a block page

Error Handling

HTTP StatusMessageDescription
200OKThe request succeeded; some TRON errors are returned in the 200 body as an Error field
400Bad requestThe request body is malformed or a required field is missing
500Internal errorThe node failed to process the request