Ethereum

Ethereum

eth_getBalance

eth_getBalance returns the ETH balance of an account on Ethereum mainnet, measured at a block you pick. The value comes back as wei — the smallest unit of Ether, with 18 decimals — so a balance of one ETH reads as 0xde0b6b3a7640000. Pass an address plus a block tag: latest for the current head, finalized for a value that can't be reorged, or a specific hex height for a point-in-time read. Send it to https://ethereum.therpc.io/YOUR_API_KEY (chain ID 1). This reports only native ETH; a token's balance lives in that token's own contract, not here.

Use cases

  • Wallet display. Render the ETH figure in a wallet header, converting wei to Ether for the user.
  • Affordability check. Confirm an account holds enough ETH to cover value plus gas before you bother running eth_estimateGas or signing.
  • Payment detection. Poll the balance at latest and react when it rises to spot an incoming deposit.
  • Historical audit. Read the balance at a fixed past height for accounting or forensics — that requires an archive node, which is why pruned-state queries can fail.

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://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": [
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"latest"
],
"id": 1
}'

Try it live in the Ethereum 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 wei balance routinely exceeds 2^53, so Number(hex) silently loses precision. Always parse with BigInt(value) and divide by 10n**18n to reach whole ETH.
  • A balance at latest sits at the head and can shift in a short reorg before justification. For a ledger or system of record, read at finalized so the figure can't be revised out from under you.
  • This is native ETH only. To get an account's USDC, DAI, or any ERC-20 holding you call balanceOf on the token contract via eth_call — this method never sees token balances.

Supported networks

  • Mainnet — Chain ID: 1
  • Sepolia — Chain ID: 11155111

See also

Parameters

0x-prefixed 20-byte address

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

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

Ready to call this in production?

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