POSTgetTokenAccountBalance

Returns the token balance of an SPL Token account.

Request Body
jsonrpcstringrequired
idintegerrequired
methodstringrequired
paramsoneOf[]required

It contains following items:

  1. Pubkey of Token Account (required)
  2. ConfigurationObject (optional)
params[0]string

Pubkey of Token account to query, as base-58 encoded string

Responses
idinteger

The request ID

jsonrpcstring

The JSON-RPC version

contextobject

An object containing metadata about the current state of the Solana network at the time of the request.

apiVersionstring

The API version used for the request

slotinteger

The slot number at which the request was evaluated

valueobject
amountstring

The raw balance without decimals, a string representation of u64

decimalsnumber

Number of base 10 digits to the right of the decimal place

uiAmountnumber

DEPRECATED The balance, using mint-prescribed decimals

uiAmountStringstring

The balance as a string, using mint-prescribed decimals

X-API-KEY
RequestCU20
cURL
curl -X POST "https://solana-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenAccountBalance",
  "params": [
    "7fUAJdStEuGbc3sM84cKRL6yYaaSstyLSU4ve5oovLS7",
    {
      "commitment": "finalized"
    }
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 1114
    },
    "value": {
      "amount": "9864",
      "decimals": 2,
      "uiAmount": 98.64,
      "uiAmountString": "98.64"
    }
  },
  "id": 1
}