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_estimateGasor signing. - Payment detection. Poll the balance at
latestand 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
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | address | string (hex) | Yes | The account address to query. |
| 2 | blockTag | string | No | Block at which to read the balance.Default: latest |
Response
| Type | Description |
|---|---|
| string (hex) | Hex-encoded balance in wei. Convert with BigInt(value); divide by 10n**18n to get the chain's base unit. |
Example request
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Address is malformed, missing 0x prefix, or block tag is unrecognised. |
-32000 | Missing trie node | Queried 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 withBigInt(value)and divide by10n**18nto reach whole ETH. - A balance at
latestsits at the head and can shift in a short reorg before justification. For a ledger or system of record, read atfinalizedso 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
balanceOfon the token contract viaeth_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"