POST
/
efb0a5eccd2caa5135eb54eba6f7f300
curl --request POST \
  --url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "eth_getBalance",
  "id": 1,
  "params": [
    "0xF977814e90dA44bFA03b6295A0616a897441aceC",
    "latest"
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}

Optimism API method eth_getBalance retrieves the balance of an account at a given block. This method is essential for applications that need to display or utilize the current balance of an Ethereum address.

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • address — the address to get the balance for.
  • block — the block number (in hexadecimal) or one of the strings "earliest", "latest", or "pending", indicating the state to consider. The default is "latest".

Response

  • result — the balance of the account in Wei, as a hexadecimal string.

Use case

The eth_getBalance method is essential for:

  • Wallets and financial applications that track and display user balances.
  • DApps that perform actions based on the account balance.
  • Services that monitor account balances for thresholds, changes, or unusual activity.

Body

application/json
jsonrpc
string
default:2.0
required
method
string
default:eth_getBalance
required
id
integer
default:1
required
params
string[]
required

Response

200 - application/json
The balance of the account
jsonrpc
string
id
integer
result
string