# getTokenAccountBalance

## getTokenAccountBalance RPC Method

> Returns the token balance of an SPL Token account.

````json
{"openapi":"3.0.3","info":{"title":"Solana RPC API - getTokenAccountBalance Method","version":"1.0.0"},"tags":[{"name":"Token Data","description":"Methods related to SPL token data retrieval. These methods provide\ninformation about token accounts, balances, and token-specific operations.\n"}],"servers":[{"url":"https://public.rpc.solanavibestation.com"},{"url":"https://basic.rpc.solanavibestation.com"},{"url":"https://ultra.rpc.solanavibestation.com"},{"url":"https://elite.rpc.solanavibestation.com"},{"url":"https://epic.rpc.solanavibestation.com"},{"url":"https://basic.swqos.solanavibestation.com"},{"url":"https://ultra.swqos.solanavibestation.com"},{"url":"https://elite.swqos.solanavibestation.com"}],"security":[{},{"AuthHeader":[]},{"URLParameter":[]}],"components":{"securitySchemes":{"AuthHeader":{"type":"apiKey","in":"header","name":"Authorization","description":"Authorization header for API key authentication.\n\n**Example:**\n```\nAuthorization: your-api-key-here\n```\n"},"URLParameter":{"type":"apiKey","in":"query","name":"api_key","description":"API key passed as a URL parameter for authentication.\n\n**Example:**\n```\nhttps://public.rpc.solanavibestation.com/?api_key=your-api-key-here\n```\n"}},"schemas":{"GetTokenAccountBalanceRequest":{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier that will be returned in the response"},"method":{"type":"string","description":"The RPC method name","enum":["getTokenAccountBalance"]},"params":{"type":"array","description":"Method parameters:\n\n1. Token account public key (base58 encoded string) - required\n2. Configuration object (optional)\n","minItems":1,"maxItems":2,"items":{"oneOf":[{"type":"string","description":"Token account public key (base58 encoded) - REQUIRED PARAMETER","pattern":"^[1-9A-HJ-NP-Za-km-z]{32,44}$"},{"$ref":"#/components/schemas/TokenAccountBalanceOptions"}]}}}},"TokenAccountBalanceOptions":{"type":"object","description":"Configuration options for the getTokenAccountBalance request","properties":{"commitment":{"type":"string","description":"The commitment level describes how finalized a block is at that point in time.\nSee [Configuring State Commitment](https://docs.solana.com/api/http#configuring-state-commitment) \nfor detailed information about each level.\n\n- `processed`: Query the most recent block which has reached 1 confirmation\n- `confirmed`: Query the most recent block which has reached maximum-lockout on this node\n- `finalized`: Query the most recent block which has been finalized by the cluster\n","enum":["processed","confirmed","finalized"],"default":"finalized"}}},"GetTokenAccountBalanceResponse":{"type":"object","description":"RPC response containing token account balance information","required":["jsonrpc","id"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier matching the original request"},"result":{"type":"object","description":"The result object containing context and token balance information","required":["context","value"],"properties":{"context":{"$ref":"#/components/schemas/Context"},"value":{"$ref":"#/components/schemas/TokenAmount"}}},"error":{"$ref":"#/components/schemas/RpcError"}}},"Context":{"type":"object","description":"Context information about when and where the request was processed","required":["slot"],"properties":{"slot":{"type":"integer","description":"The slot number at which this request was processed. Slots are the basic unit of time \nin Solana, with each slot representing approximately 400ms.\n","minimum":0},"apiVersion":{"type":"string","description":"The version of the Solana RPC API being used"}}},"TokenAmount":{"type":"object","description":"Token amount information with both raw and UI-formatted values","required":["amount","decimals","uiAmount","uiAmountString"],"properties":{"amount":{"type":"string","description":"Raw amount of tokens as a string, ignoring decimals. This is the actual value stored on-chain without any decimal adjustment.\n","pattern":"^[0-9]+$"},"decimals":{"type":"integer","description":"Number of decimals configured for the token's mint. This determines how the raw amount should be interpreted for display purposes.\n","minimum":0,"maximum":255},"uiAmount":{"oneOf":[{"type":"number"},{"type":"null"}],"description":"Token amount as a float, accounting for decimals. This is the human-readable amount. May be null for very large amounts that cannot be represented as a float.\n"},"uiAmountString":{"type":"string","description":"Token amount as a string, accounting for decimals. This is the most precise representation and should be used for display purposes.\n"}}},"RpcError":{"type":"object","description":"Standard JSON-RPC error object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Numeric error code following JSON-RPC 2.0 specification:\n- `-32700`: Parse error\n- `-32600`: Invalid request  \n- `-32601`: Method not found\n- `-32602`: Invalid params\n- `-32603`: Internal error\n- `-32005`: Too Many Requests\n- `-32003`: Unauthorized\n"},"message":{"type":"string","description":"Human-readable error message"},"data":{"type":"object","description":"Additional structured error information (optional)","additionalProperties":true}}}}},"paths":{"/":{"post":{"summary":"getTokenAccountBalance RPC Method","description":"Returns the token balance of an SPL Token account.","operationId":"getTokenAccountBalance","tags":["Token Data"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTokenAccountBalanceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTokenAccountBalanceResponse"}}}},"401":{"description":"Unauthorized","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","content":{"text/plain":{"schema":{"type":"string"}}}},"429":{"description":"Too Many Requests","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
````
