Skip to main content
Returns the token balance held by a specific SPL token account.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenAccountBalance",
  "params": ["48gpnn8nsmkvkgso7462Z1nFhUrprGQ71u1YLBPzizbY"]
}

Parameters

tokenAccount
string
required
Base-58 encoded public key of the token account to query.
commitment
string
Commitment level for the query. One of processed, confirmed, or finalized.

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": { "slot": 1114 },
    "value": {
      "amount": "9864",
      "decimals": 2,
      "uiAmount": 98.64,
      "uiAmountString": "98.64"
    }
  }
}
value.amount
string
Raw token balance as a string, without decimal adjustment.
value.decimals
number
Number of decimal places for this token (base-10 digits to the right of the decimal point).
value.uiAmount
number | null
Token balance as a float, adjusted for decimals. May be null if the balance overflows a float.
value.uiAmountString
string
Token balance as a string, adjusted for decimals. Use this for display purposes to avoid float precision issues.

Example

curl "https://rpc.solami.fast/sol?api_key=YOUR_API_KEY" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTokenAccountBalance",
    "params": ["48gpnn8nsmkvkgso7462Z1nFhUrprGQ71u1YLBPzizbY"]
  }'