getBalance
Returns the balance of the account of provided Pubkey

Parameters

  • <base-58 encoded string> - Pubkey of account to query
  • <object> - (optional) Config object:
    • commitment: (optional) <string> - Configures the commitment level of the blocks queried Accepts one of the following strings: ["finalized", "confirmed", "processed"] For more info, refer to this doc.
    • minContextSlot: (optional) <number> - set the minimum slot that the request can be evaluated at.

Result

  • RpcResponse:<u64> - RpcResponse JSON object with value field set to the balance

Example

Request

cURL
1
curl --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/demo' \
2
--header 'Content-Type: application/json' \
3
--data-raw ' {
4
"jsonrpc": "2.0",
5
"id": 1,
6
"method":"getBalance",
7
"params":
8
[
9
"83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
10
]
11
}'
Copied!

Response

1
{
2
"jsonrpc": "2.0",
3
"result": { "context": { "slot": 1 }, "value": 0 },
4
"id": 1
5
}
Copied!