BNB Smart Chain

BNB Smart Chain

eth_getTransactionByHash

A transaction hash is the canonical handle for any payment or contract call on BNB Smart Chain, and eth_getTransactionByHash turns that handle back into the full object: sender, recipient, BNB value, gas fields, input calldata, signature, and the block it landed in. The hash is the same value bscscan.com shows on its explorer pages, so you can copy one straight across. Point the query at https://bsc.therpc.io/YOUR_API_KEY on chain ID 56; a still-pending or unknown transaction comes back with null block fields or null outright, which is how you tell mined from unmined.

Use cases

  • Check that a transaction you broadcast actually made it into a BSC block by testing whether blockNumber is no longer null.
  • Decode the input calldata against an ABI to discover which contract function the transaction invoked and with what arguments.
  • Pull the from address and BNB value to verify an incoming payment matches what your application expected.

Parameters

#NameTypeRequiredDescription
1transactionHashstring (hex)YesThe hash of the transaction to retrieve.

Response

TypeDescription
object | nullTransaction object containing: hash, nonce, blockHash, blockNumber, transactionIndex, from, to (null for contract creation), value (hex wei), gas, gasPrice / maxFeePerGas / maxPriorityFeePerGas, input, type, accessList (type-1/2), chainId, v, r, s. Returns null if not found or still pending (blockHa

Example request

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

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32602Invalid paramsTransaction hash is malformed or not 32 bytes.

Common pitfalls

  • Getting an object back proves only that the transaction exists, not that it succeeded. Fetch the receipt and read its status field to learn whether execution reverted.
  • A transaction still sitting in the mempool comes back populated but with blockHash, blockNumber, and transactionIndex all set to null.
  • Dropped or never-broadcast hashes resolve to null, so always null-check the response before you reach into its fields.

Supported networks

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

See also

Parameters

0x-prefixed 32-byte transaction hash

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

Ready to call this in production?

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