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 ERC20 token price

GEThttps://deep-index.moralis.io/api/v2.2/erc20/:address/price

Get the token price denominated in the blockchain's native token and USD. View supported exchanges here

PATH PARAMS
addressstringrequired
The address of the token contract
QUERY PARAMS
chainstring
The chain to query
includestring
If the result should contain the 24hr percent change
exchangestring
The factory name or address of the token exchange. View supported exchanges here
to_blocknumber
The block number from which the token price should be checked
max_token_inactivitynumber
Exclude tokens inactive for more than the given amount of days
min_pair_side_liquidity_usdnumber
Exclude tokens with liquidity less than the specified amount in USD. This parameter refers to the liquidity on a single side of the pair.
Responses
API KEY
import Moralis from 'moralis';

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

const response = await Moralis.EvmApi.token.getTokenPrice({
"chain": "0x1",
"include": "percent_change",
"address": "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0"
});

console.log(response.raw);
} catch (e) {
console.error(e);
}
Response Example
{
"tokenName": "Kylin Network",
"tokenSymbol": "KYL",
"tokenLogo": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png",
"tokenDecimals": "18",
"usdPrice": 19.722370676,
"usdPriceFormatted": "19.722370676",
"24hrPercentChange": "-0.8842730258590583",
"exchangeAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984",
"exchangeName": "Uniswap v3",
"tokenAddress": "0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c",
"toBlock": "16314545",
"possibleSpam": "false",
"verifiedContract": true,
"pairAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984",
"pairTotalLiquidityUsd": "123.45"
}