---
title: "Look up the USD price of a Stellar asset"
method: POST
path: "/?stellar_getTokenPrice"
tags: ["Stellar (Soroban) API"]
---

# Look up the USD price of a Stellar asset

`POST /?stellar_getTokenPrice`

## Request

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

Returns Ankr's current USD price for a Stellar token. Pass a Strkey `contractAddress` (`C…`) for a Stellar Asset Contract, or omit it to fetch the price of native XLM.

Analogous to `ankr_getTokenPrice`, with Strkey contract addresses in place of hex. Prices are decimal strings, and the response echoes the contract the price belongs to, so an omitted `contractAddress` still tells you which asset was priced.

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_getTokenPrice', required
  - `params` object, required
    - `blockchain` 'stellar_soroban', required: Stellar network identifier.
    - `contractAddress` string: Stellar Asset Contract address in Strkey format (`C…`). Omit to fetch the native XLM price.

## Response `200`

Success. JSON-RPC `result` contains the priced contract, a decimal-string USD price, 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
    - `blockchain` 'stellar_soroban', required
    - `contractAddress` string: Stellar Asset Contract the price belongs to, in Strkey format.
    - `usdPrice` string, required: Current USD price as a decimal 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)
