For the complete documentation index, see llms.txt. This page is also available as Markdown.

/walletsolidity/gettransactioncountbyblocknum - Tron

Example code for the gettransactioncountbyblocknum Solidity API method. Complete guide on how to use gettransactioncountbyblocknum Solidity API method in GetBlock Web3 documentation.

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://go.getblock.io/<ACCESS-TOKEN>/wallet/gettransactioncountbyblocknum over the latest, possibly unconfirmed state.

Parameters

Parameter
Type
Required
Description

num

integer

Yes

The block height

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/walletsolidity/gettransactioncountbyblocknum' \
--header 'Content-Type: application/json' \
--data-raw '{
  "num": 68000000
}'
example.js
const response = await fetch(
    'https://go.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
import requests

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

print(response.json())

Response

{
  "count": 312
}

Response Parameters

Field
Type
Description

count

integer

Number 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 Status
Message
Description

200

OK

The request succeeded; some TRON errors are returned in the 200 body as an Error field

400

Bad request

The request body is malformed or a required field is missing

500

Internal error

The node failed to process the request

Was this helpful?