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.
Request
- Base URLhttps://rpc.ankr.com/multichain/569ca1f392f7d3d0bb1073a1173ecb649af1d9249231fe59fa95db19d5ae41fe
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
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.
Changes
No recorded changes to this operation across all 1 revision of this API.