eth_getBalance - Optimism
Returns the balance of the account of a given address.

Parameters

  1. 1.
    DATA, 20 Bytes - address to check for balance.
  2. 2.
    QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending", see the default block parameter.
1
params: [
2
'0xf69d0bbc95db6287ef02f19e5b2789972f776c2f',
3
'latest'
4
]
Copied!

Returns

QUANTITY - integer of the current balance for the given address in wei.
Request
Curl
Postman
1
curl https://opt-mainnet.g.alchemyapi.io/v2/your-api-key \
2
-X POST \
3
-H "Content-Type: application/json" \
4
-d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xf69d0bbc95db6287ef02f19e5b2789972f776c2f", "latest"],"id":0}'
Copied!
1
URL: https://opt-mainnet.g.alchemyapi.io/v2/your-api-key
2
RequestType: POST
3
Body:
4
{
5
"jsonrpc":"2.0",
6
"method":"eth_getBalance",
7
"params":["0xf69d0bbc95db6287ef02f19e5b2789972f776c2f", "latest"],
8
"id":0
9
}
Copied!
Result
1
{
2
"jsonrpc": "2.0",
3
"id": 0,
4
"result": "0x206c36e81d47c480"
5
}
Copied!
Optimism API
Alchemy Documentation
Copy link
Contents