eth_getBalance
Last updated:
`eth_getBalance` returns the amount of wei held by an Ethereum address at a specific point in the chain's history. The balance is the native ETH balance only — it does not include ERC-20 token balances, which live in their respective token contracts.
Use this method to display an account's spendable ETH, to check a contract's treasury, or to confirm a deposit has landed. By varying the second parameter (the block tag) you can read the balance as of the latest block, a pending block, the genesis block, or any historical block height.
The result is a hex-encoded `u256` string measured in wei (1 ETH = 10¹⁸ wei). For example, `0x1bc16d674ec80000` is `2000000000000000000` wei = **2 ETH**. You are responsible for converting the hex value to a decimal and dividing by 10¹⁸ when presenting it to users.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://<your-endpoint>/ \
-X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":[]}'const res = await fetch("https://<your-endpoint>/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"id": 1,
"method": "eth_getBalance",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"eth_getBalance","params":[],"jsonrpc":"2.0"})
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet.
- Credit cost: 1 per call.
FAQ
- What does eth_getBalance do?
- Returns the native ETH balance of an account, in wei, at a given block.
- How many credits does eth_getBalance cost?
- eth_getBalance costs 1 credit(s) per call on Triport by default.
- Is eth_getBalance available over WebSocket?
- eth_getBalance is an HTTP JSON-RPC method.