Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Get Token Price

GEThttps://solana-gateway.moralis.io/token/:network/:address/price

Gets the token price (usd and native) for a given contract address and network. Currently, this API only support fetching token price listed on Raydium DEX.

💡USD Price Decimal

The usdPrice output field now supports results with more than 4 decimal places. The smallest unit returned will be based on the SPL token's decimal value. For example, if the token price is 0.001 and the token decimal is 2, the price will be 0.

PATH PARAMS
networkstringrequired
The network to query
addressstringrequired
The address of the token contract
Responses
API KEY
import Moralis from 'moralis';

try {
await Moralis.start({
apiKey: "YOUR_API_KEY"
});

const response = Moralis.SolApi.token.getTokenPrice({
"network": "mainnet",
"address": "SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"
});

console.log(response.raw);
} catch (e) {
console.error(e);
}
Response Example
{
"nativePrice": {
"value": "",
"decimals": "",
"name": "",
"symbol": ""
},
"usdPrice": "",
"exchangeAddress": "",
"exchangeName": ""
}