BNB Smart Chain

BNB Smart Chain

eth_getBalance

eth_getBalance reports how much BNB an address holds at a chosen block. BNB is the native gas token of BNB Smart Chain. Pass an account and a block tag to https://bsc.therpc.io/YOUR_API_KEY (chain ID 56), and the node returns that account's spendable balance as hex wei, snapshotted at the height you named. BSC reaches deterministic finality, so a balance read at a finalized block is a stable, reorg-safe figure you can record with confidence.

Use cases

  • Show an account's BNB holdings in a wallet header or portfolio view.
  • Confirm the sender has enough BNB to cover value plus gas before estimating or broadcasting.
  • Poll an address across new blocks to spot an incoming BNB deposit within seconds.
  • Read the balance at a specific historical height for accounting, audits, or on-chain forensics (archive node required).

Parameters

#NameTypeRequiredDescription
1addressstring (hex)YesThe account address to query.
2blockTagstringNoBlock at which to read the balance.Default: latest

Response

TypeDescription
string (hex)Hex-encoded balance in wei. Convert with BigInt(value); divide by 10n**18n to get the chain's base unit.

Example request

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

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32602Invalid paramsAddress is malformed, missing 0x prefix, or block tag is unrecognised.
-32000Missing trie nodeQueried a historical block that the node has pruned (non-archive node).

Common pitfalls

  • A BNB balance in wei easily exceeds 2^53, so Number() silently loses precision. Parse with BigInt(value) every time.
  • A balance read at latest can still be unwound by a reorg before finality; for any system of record, read at "finalized" instead.
  • This only covers native BNB; a BEP-20 token balance lives in the token contract and must be fetched with eth_call to its balanceOf.

Supported networks

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

See also

Parameters

0x-prefixed 20-byte address

hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"

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

Ready to call this in production?

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