Skip to main content

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.

PATH PARAMS
networkstringrequired
The network to query
addressstringrequired
The address of the SPL token program
Responses
API KEY
import Moralis from 'moralis';
import { SolNetwork, SolAddress } from "@moralisweb3/sol-utils";

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

const address = SolAddress.create(
"SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"
);

const network = SolNetwork.MAINNET;

const response = await Moralis.SolApi.token.getTokenPrice({
address,
network,
});

console.log(response?.result);
} catch (e) {
console.error(e);
}
Response Example