TriportRPC

getblockbynum

POSThttps://triport.io/rpc/tron/wallet/getblockbynum

Returns a native Tron block by its decimal block number.

Tron mainnettron:rpcfree+; tron_read_rpc_heavy: 2 / 5 / 20 / 80 RPS (free / basic / pro / business; default, unmeasured)

getblockbynum returns the native wallet block object for a non-negative decimal height. Wallet HTTP uses a JSON integer here, unlike eth_getBlockByNumber, whose EVM selector is a hexadecimal quantity.

Historical availability is a property of the selected node. One public wallet node had a measured retention window of 2,219,797 blocks; that observation is not a pool-wide archive promise. A schema-valid request can therefore return an empty object when the selected node lacks the requested block.

Parameters

The JSON body contains one required field.

numintegerrequired
Non-negative decimal block number; hexadecimal strings are not accepted.

Response

The concrete response example is unknown because the OpenAPI contract has no response example. {} is a schema-valid placeholder and also illustrates why an empty response must not be treated as proof of a pool-wide absence.

responseobject
Native block object with operation-dependent fields not enumerated by the schema.

Errors

Wallet failures use HTTP status plus JSON. See Tron errors.

HTTPMeaningWhen it happens
400Bad requestnum is missing, negative, or not a decimal integer.
401UnauthorizedThe API key is missing or invalid.
403ForbiddenThe scope or tier does not permit the request.
429Rate limitedThe tron_read_rpc_heavy budget is exceeded.

Examples

const response = await fetch("https://triport.io/rpc/tron/wallet/getblockbynum", {
  method: "POST",
  headers: { "x-token": process.env.TRIPORT_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ num: 1 }),
});
const block = await response.json();

Notes

  • num is decimal JSON, not an EVM quantity.
  • Retention depth varies by node; the measured 2,219,797-block window is not an SLA.
  • Related: eth_getBlockByNumber.