BNB Smart Chain

BNB Smart Chain

trace_block

A BSC block closes about every three seconds, and on a busy one that can mean a few hundred transactions packed with BEP-20 transfers and DeFi calls. trace_block hands you the call-tree trace for all of them at once. Pass a height in hex or a tag like latest; you get back a single flat array where each entry names a call, create, or self-destruct action and carries the transactionPosition of the transaction that produced it. Point the request at chain ID 56 on https://bsc.therpc.io/YOUR_API_KEY. This is the block-wide view, tuned for fund-flow and MEV work rather than opcode-by-opcode debugging. It is heavy, and it only runs against a trace-enabled archive node.

Use cases

  • Pull every internal transaction in a block in one shot to feed an indexer or analytics pipeline.
  • Spot sandwiches and back-runs by reading MEV activity across all the transactions in a single block.
  • Watch BNB and token value move into and out of a contract over the span of one whole block.

Parameters

#NameTypeRequiredDescription
1blockParameterstringYesBlock whose transactions to trace.

Response

TypeDescription
arrayFlat array of all trace objects across all transactions in the block. Each object has the same shape as individual entries from trace_transaction, with `transactionPosition` indicating which transaction it belongs to.

Example request

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_block",
"params": ["latest"],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32601Method not foundtrace namespace not enabled or not supported by this client.
-32602Invalid paramsblockParameter is malformed or not a recognized tag.
-32000block not foundBlock does not exist or trace archive data is unavailable.

Common pitfalls

  • One call returns every trace for every transaction, so a high-throughput BSC block can produce a very large payload.
  • The trace namespace runs only on a trace-enabled archive node, and plenty of public endpoints either hide it or throttle it on lower tiers.
  • Skip the pending tag for production data. Those traces can still change before the block finalizes.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

Parameters

hex block number or "latest" | "earliest" | "pending"

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"trace_block","params":["latest"]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.