Solana RPC · Accounts & balances

POST getTokenAccountBalance

Token balance of an SPL token account.

Endpoint

POST  https://solrpc.infinityblocks.io/<API_KEY>

Standard Solana JSON-RPC 2.0 over HTTP POST. The API key is part of the URL path.

Parameters

ParamTypeRequiredDescription
accountstringyesBase-58 SPL token account pubkey.
configobjectnocommitment.

Request

curl -s https://solrpc.infinityblocks.io/<API_KEY> \
  -X POST -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getTokenAccountBalance","params":["<TOKEN_ACCOUNT>",{"commitment":"confirmed"}]}'

With @solana/web3.js

const bal = await rpc.getTokenAccountBalance(new PublicKey("<TOKEN_ACCOUNT>"));

Response

{ "jsonrpc": "2.0", "id": 1, "result": { "context": { "slot": 423214981 }, "value": { "amount": "41152213702243", "decimals": 6, "uiAmount": 41152213.702243, "uiAmountString": "41152213.702243" } } }

Try it

Run getTokenAccountBalancelive · POST

Replace placeholders (e.g. <ADDRESS>) with real values. Your key is stored only in this browser.