> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.galleon8.com/api-reference/advanced-api/api-endpoints/token-api/ankr-get-account-balance/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.galleon8.com/_mcp/server. # ankr_getAccountBalance POST https://advanced-api-docs-proxy.galleon8.workers.dev Content-Type: application/json Retrieves the balance of the specified account. Reference: https://docs.galleon8.com/api-reference/advanced-api/api-endpoints/token-api/ankr-get-account-balance ## Request ### Body (application/json) This endpoint expects an object. - `walletAddress` (string, required) — Address to get the balance of. - `blockchain` (BlockchainSelector, optional) — Name of the blockchain or list of blockchain names. Single: eth. Multiple: [eth, bsc, fantom, avalanche, polygon, arbitrum, syscoin, optimism, eth_goerli, polygon_mumbai, avalanche_fuji]. All chains: empty value. - `nativeFirst` (boolean, optional) — Sorting order. Native network token first (true) or not (false). - `onlyWhitelisted` (boolean, optional) — Filtering. Only show tokens listed on CoinGecko (true) or all the tokens (false). Default — true. - `pageSize` (integer, optional) — Number of entries per page. Max value — all, default value — all. - `pageToken` (string, optional) — Current page token for pagination. ## Response ### 200 Result returned by ankr_getAccountBalance. - `assets` (list of AnkrGetAccountBalanceResultAssetsItems, required, nullable) - `totalBalanceUsd` (string, required) — Total value of assets at the address calculated by Ankr, in US dollars. - `nextPageToken` (string, optional) — Next page token for pagination. - `totalCount` (integer, optional) — Total number of all assets (ERC20) at the address. ## Types ### BlockchainSelector A single blockchain identifier or an array of blockchain identifiers. ### AnkrGetAccountBalanceResultAssetsItems - `balance` (string, required) — Total balance of the token holder address. - `balanceRawInteger` (string, required) — Raw balance: value*10^decimals. - `balanceUsd` (string, required) — Total value at the token holder address calculated by Ankr, in US dollars. - `blockchain` (enum, required) — Supported blockchain identifier. - Allowed values: `arbitrum`, `avalanche`, `avalanche_fuji`, `bsc`, `eth`, `eth_goerli`, `fantom`, `optimism`, `polygon`, `polygon_mumbai`, `polygon_zkevm`, `syscoin` - `holderAddress` (string, required) — Blockchain address, ENS name, or contract address where supported. - `thumbnail` (string, required) — URL to the thumbnail (logo or symbol) of the token. - `tokenDecimals` (integer, required) — Number of decimals the token supports. - `tokenName` (string, required) — Name of the token. - `tokenPrice` (string, required) — Current token price calculated by Ankr, in US dollars. - `tokenSymbol` (string, required) — Symbol of the token. - `tokenType` (string, required) — Type of the token. E.g., ERC20. - `contractAddress` (string, optional) — Blockchain address, ENS name, or contract address where supported. ## Examples **Request** ```json [ "0x18b2a687610328590bc8f2e5fedde3b582a49cda" ] ``` **Response** ```json { "jsonrpc": "2.0", "id": "1", "result": { "assets": [ { "balance": "1608.434310817656690616", "balanceRawInteger": "1608434310817656690616", "balanceUsd": "394175.866488091069305026", "blockchain": "bsc", "holderAddress": "0x18b2a687610328590bc8f2e5fedde3b582a49cda", "thumbnail": "https://www.ankr.com/protocol/static/media/bsc.e1bfba92.svg", "tokenDecimals": 18, "tokenName": "Binance Smart Chain", "tokenPrice": "245.068053968402063819", "tokenSymbol": "BNB", "tokenType": "NATIVE" }, { "balance": "1.106063312048596845", "balanceRawInteger": "1106063312048596845", "balanceUsd": "1339.617032917654314456", "blockchain": "eth", "holderAddress": "0x18b2a687610328590bc8f2e5fedde3b582a49cda", "thumbnail": "https://www.ankr.com/protocol/static/media/eth.3ee8ddd4.svg", "tokenDecimals": 18, "tokenName": "Ethereum", "tokenPrice": "1211.157641994725049028", "tokenSymbol": "ETH", "tokenType": "NATIVE" }, { "balance": "300000", "balanceRawInteger": "30000000000000", "balanceUsd": "1244.852927117672699968", "blockchain": "polygon", "contractAddress": "0x0b91b07beb67333225a5ba0259d55aee10e3a578", "holderAddress": "0x18b2a687610328590bc8f2e5fedde3b582a49cda", "thumbnail": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x426CA1eA2406c07d75Db9585F22781c096e3d0E0/logo.png", "tokenDecimals": 8, "tokenName": "Minereum Polygon", "tokenPrice": "0.004149509757058909", "tokenSymbol": "MNEP", "tokenType": "ERC20" } ], "totalBalanceUsd": "398857.927815440716633863" } } ``` **SDK Code** ```python import requests url = "https://advanced-api-docs-proxy.galleon8.workers.dev/" payload = ["0x18b2a687610328590bc8f2e5fedde3b582a49cda"] headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://advanced-api-docs-proxy.galleon8.workers.dev/'; const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '["0x18b2a687610328590bc8f2e5fedde3b582a49cda"]' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://advanced-api-docs-proxy.galleon8.workers.dev/" payload := strings.NewReader("[\n \"0x18b2a687610328590bc8f2e5fedde3b582a49cda\"\n]") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://advanced-api-docs-proxy.galleon8.workers.dev/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "[\n \"0x18b2a687610328590bc8f2e5fedde3b582a49cda\"\n]" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://advanced-api-docs-proxy.galleon8.workers.dev/") .header("Content-Type", "application/json") .body("[\n \"0x18b2a687610328590bc8f2e5fedde3b582a49cda\"\n]") .asString(); ``` ```php request('POST', 'https://advanced-api-docs-proxy.galleon8.workers.dev/', [ 'body' => '[ "0x18b2a687610328590bc8f2e5fedde3b582a49cda" ]', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://advanced-api-docs-proxy.galleon8.workers.dev/"); var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "[\n \"0x18b2a687610328590bc8f2e5fedde3b582a49cda\"\n]", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["0x18b2a687610328590bc8f2e5fedde3b582a49cda"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://advanced-api-docs-proxy.galleon8.workers.dev/")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```