---
title: "Read a Stellar account's XLM and Stellar Asset Contract balances"
method: POST
path: "/?stellar_getAccountBalance"
tags: ["Stellar (Soroban) API"]
---

# Read a Stellar account's XLM and Stellar Asset Contract balances

`POST /?stellar_getAccountBalance`

## Request

- Base URL: `https://rpc.ankr.com/multichain/569ca1f392f7d3d0bb1073a1173ecb649af1d9249231fe59fa95db19d5ae41fe`
- URL: `https://rpc.ankr.com/multichain/569ca1f392f7d3d0bb1073a1173ecb649af1d9249231fe59fa95db19d5ae41fe/?stellar_getAccountBalance`
- Auth: none declared
- TypeScript: <https://skmtc.dev/ankr/apis/ankr-advanced-api/docs/%3Fstellar_getAccountBalance/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns the balance of a Stellar account, native XLM plus any Stellar Asset Contract (`SAC`) tokens, with USD valuations from Ankr's pricing service.

Analogous to `ankr_getAccountBalance` with Stellar conventions: `walletAddress` is a Strkey address (`G…`), tokens carry `tokenType: "SAC"`, and balances come back both raw and normalized so you never divide by decimals yourself.

Stellar is served by this namespace only. The `ankr_*` methods reject both `stellar` and `stellar_soroban` as a `blockchain` value.

## Request body

- object
  - `id` integer, required: Client-supplied request ID echoed in the response.
  - `jsonrpc` '2.0', required
  - `method` 'stellar_getAccountBalance', required
  - `params` object, required
    - `blockchain` 'stellar_soroban', required: Stellar network identifier.
    - `walletAddress` string, required: Stellar account address in Strkey format (`G…`).
    - `onlyWhitelisted` boolean: Restrict the reply to CoinGecko-listed tokens. Set false for the full inventory.
    - `nativeFirst` boolean: Sort native XLM first when true.
    - `pageSize` integer: Number of assets per page.
    - `pageToken` string: Opaque page token from a prior response's `nextPageToken`.

## Response `200`

Success. JSON-RPC `result` contains the USD total, the asset list and the indexer sync status. JSON-RPC errors are returned with HTTP 200; check the response body for an `error` key.

- object
  - `id` integer, required
  - `jsonrpc` '2.0', required
  - `result` object, required
    - `totalBalanceUsd` string, required: Sum of the USD valuations in this page, as a decimal string.
    - `totalCount` integer: Number of assets in this page.
    - `nextPageToken` string: Pass back as `pageToken` to fetch the next page.
    - `assets` object[], required
      - `blockchain` 'stellar_soroban'
      - `tokenName` string
      - `tokenSymbol` string
      - `tokenDecimals` integer
      - `tokenType` string: NATIVE for XLM, SAC for a Stellar Asset Contract.
      - `contractAddress` string: Strkey contract address of the asset.
      - `holderAddress` string: Strkey account the balance belongs to.
      - `balance` string: Balance with decimals applied.
      - `balanceRawInteger` string: Balance in raw base units.
      - `balanceUsd` string
      - `tokenPrice` string
      - `thumbnail` string
    - `syncStatus` SyncStatus: How far the indexer that answered this call has read the chain.
      - `timestamp` integer: Unix time of the last indexed block.
      - `blockNumber` integer: Last indexed block (ledger sequence on Stellar).
      - `lag` string: Distance behind the chain head, as a duration string.
      - `status` string: synced when the indexer keeps up with the chain.

## Other responses

- `400`: Bad Request — malformed JSON-RPC envelope or invalid `params`. The gateway rejects before the JSON-RPC layer processes the call.
- `401`: Unauthorized — missing or invalid API key in the server URL path. Verify that `{API_KEY}` is set to a valid project key.
- `429`: Too Many Requests — the API key has exceeded its rate or quota limits. Back off and retry; consider upgrading the Premium tier for higher limits.
- `500`: Server error — unexpected condition. Retry with exponential backoff; if it persists, file a ticket at https://www.ankr.com/support/.

---

[API](https://skmtc.dev/ankr/apis/ankr-advanced-api.md) - [All operations](https://skmtc.dev/ankr/apis/ankr-advanced-api/llms.txt) - [OpenAPI document](https://skmtc.dev/ankr/apis/ankr-advanced-api/revisions/77e494aeec1b?raw)
