Stellar (Soroban) API

Look up the USD price of a Stellar asset

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.

post/?stellar_getTokenPrice

Request

Request body

idinteger required

Client-supplied request ID echoed in the response.

jsonrpc'2.0' required
method'stellar_getTokenPrice' required

Example request

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "stellar_getTokenPrice",
  "params": {
    "blockchain": "stellar_soroban"
  }
}

Response

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.

idinteger required
jsonrpc'2.0' required

Changes

No recorded changes to this operation across all 1 revision of this API.