/walletsolidity/getblockbylimitnext - Tron

This endpoint returns a range of blocks between a start height (inclusive) and an end height (exclusive), in one call.

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/getblockbylimitnext over the latest, possibly unconfirmed state.

Parameters

ParameterTypeRequiredDescription
startNumintegerYesFirst block height in the range, inclusive
endNumintegerYesEnd block height, exclusive

Request

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

example.js

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

example.py

pythonimport requests

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

print(response.json())

Response

json{
  "block": [
    {
      "blockID": "0000000002f3a5b0f6d2e6c9a1b4e7f0a3b6c9d2e5f8a1b4c7d0e3f6a9b2c5d8",
      "block_header": {
        "raw_data": {
          "number": 68000000,
          "timestamp": 1719400000000
        }
      }
    }
  ]
}

Response Parameters

FieldTypeDescription
blockarrayBlocks in the requested range, each with header and transactions

Use Cases

  • Batch Indexing: Fetch a window of blocks in one request
  • Backfill: Catch up a store over a range of heights
  • Analytics: Read a contiguous span of blocks for analysis
  • Reorg Windows: Re-scan a recent range after a rollback

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