theRPC
Ethereum

Ethereum

eth_getBalance

eth_getBalance returns the native-token balance of a given account at a specific block. On Ethereum that's ETH in wei; on BSC it's BNB in wei; on Polygon it's MATIC in wei. The unit is always wei (10^-18 of the chain's native token).

Parameters

#NameTypeDescription
1addressstring20-byte hex-encoded account address (with the 0x prefix).
2blockstringBlock number in hex, or a tag: latest, pending, earliest, safe, finalized.

safe and finalized are supported on Ethereum mainnet, Gnosis, Arbitrum, Arbitrum Nova, and Avalanche C-chain.

Response shape

The result is a hex-encoded integer in wei. Convert to a number with BigInt(value); converting to a decimal display value requires dividing by 10n ** 18n for the native token.

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1a055690d9db80000"
}

0x1a055690d9db80000 = 30,000,000,000,000,000,000 wei = 30 ETH.

Common pitfalls

  1. Don't divide raw integers in JS. Number("0x1a055690d9db80000") / 1e18 silently loses precision past ~2^53. Use BigInt and an explicit decimal formatter.
  2. latest is not necessarily final. If you need a value safe from reorgs, query at the finalized block tag instead.
  3. **For ERC-20 balances, use eth_call against the token contract's balanceOf(address) selector — eth_getBalance only returns the native-token balance.

See also

Parameters

20-byte address (vitalik.eth in the default value)

block number, hash, "latest", "pending", "earliest" or "safe"

curl https://ethereum.therpc.io \
-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.