getTokenAccountBalance

POSTTokensAll plans

Returns the token balance of a single SPL Token or Token-2022 account.

Try itSends a real request from your browser to the selected region.
POST
/

getTokenAccountBalance returns a token account's balance as a raw integer and pre-divided by the mint's decimals. It only accepts a token account address; a wallet address returns an error, since a wallet's tokens live in its associated token accounts.

With only a wallet address and mint, getTokenAccountsByOwner locates the token account first; its result also carries the balance directly, detailed in Notes.

Plans & rate limitsAll plans
Free5/s
Operator50/s
Blade Runner200/s
Nexus500/s

Parameters

params is a JSON array, with values in this order: pubkey, config.

1pubkeystringrequired

Address of the token account to check, base-58 encoded.

2configobject

Commitment configuration.

Show propertiesProperties
commitmentstringdefault: "finalized"

Bank state to read the balance from.

Allowed values:finalizedconfirmedprocessed

Result

resultobject

The token amount, wrapped with context.

Show propertiesProperties
contextobjectrequired
Show propertiesProperties
slotinteger
apiVersionstring
valueobjectrequired
Show propertiesProperties
amountstringrequired

Raw token amount in the mint's smallest unit, as a string (can exceed safe JS integer range).

decimalsintegerrequired

Number of decimal places the mint uses.

uiAmountnumber | null

Amount divided by 10^decimals, as a float. Deprecated in favor of uiAmountString for anything precision-sensitive.

uiAmountStringstringrequired

Amount divided by 10^decimals, as an exact decimal string.

Notes

  • uiAmountString avoids the precision uiAmount can lose, as a float, on tokens with many decimals or large balances.
  • This errors if the address is not a token account, for example a wallet or mint address.