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 --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/demo' \ --header 'Content-Type: application/json' \ --data-raw ' { "jsonrpc": "2.0", "id": 1, "method":"getBalance", "params": [ "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri" ] }'

Response

{ "jsonrpc": "2.0", "result": { "context": { "slot": 1 }, "value": 0 }, "id": 1 }
Path Params
string
required
Defaults to docs-demo

For higher throughput, create your own API key

Body Params
integer
Defaults to 1
string
Defaults to 2.0
string
Defaults to getBalance
params
array
params
Response

Response body
object | null
integer
string
result
object
context
object
number
Language
URL
Choose an example:
application/json
ReadMe
Support Hub