Parameters
string
required
Public key of the token account (base-58 encoded)
Response
object
Code Examples
Basic Request
Using web3.js
Notes
- Returns the token balance of a token account
- The balance is returned in both raw and UI-friendly formats
- The response is immediate as it reads from the current state
- The balance can change with token transfers and other operations
- The account must be a valid token account
Best Practices
- Use appropriate commitment level based on your needs
- Cache results when appropriate to reduce RPC load
- Monitor for changes in token balances
- Consider using websocket subscription for real-time updates
- Handle network errors and retry when appropriate
Common Errors
Use Cases
-
Token Balance Analysis
-
Token Balance Monitoring
-
Token Balance Planning