API ReferenceExtended RPC APIeth_getTokenPriceOn this pageeth_getTokenPriceGet ERC-20 Token Price by Token AddressPOSThttps://site1.moralis-nodes.com/:chain/:apiKeyRetrieves the current price of an ERC20 token based on its contract address. Optional parameters include specifying an exchange address, retrieving data at a specific block number, and including percentage change in price over the last 24 hours.NotePlease refer to RPC schema page for more details on the RPC params and RPC response definitions of the RPC method.PATH PARAMSchainstringrequiredThe blockchain to interact with.ethsepoliaholeskybasebase-sepoliapolygonamoybscbsc-testnetarbitrumarbitrum-sepoliaoptimismoptimism-sepoliagnosisgnosis-testnetlinealinea-sepoliaavalanchemoonbeammoonrivermoonbaseblastblast-sepoliamantlemantle-sepoliapolygon-zkevmpolygon-zkevm-cardonazksynczksync-sepoliazetachainzetachain-testnetfantomopbnbflowflow-testnetroninronin-testnetlisklisk-sepoliapulseapiKeystringrequiredYour API key for authentication.BODY PARAMRequest BodyobjectrequiredThe request payload for retrieving the price of an ERC20 token by its contract address.{ "jsonrpc": "2.0", "id": 1, "method": "eth_getTokenPrice" }Responses200Returns the price data for the specified ERC20 token.400Bad Request404Not Found429Too Many Requests500Internal Server ErrorTest Live APIcURLNode.jsPythonGoPHPcurl --request POST \ --url 'https://site1.moralis-nodes.com/eth/YOUR_API_KEY' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data '{ "jsonrpc": "2.0", "id": 1, "method": "eth_getTokenPrice"}'// Node.js v18+ has native fetch support// No additional dependencies requiredconst options = { method: 'POST', headers: { accept: 'application/json', 'content-type': 'application/json' }, body: JSON.stringify({ "jsonrpc": "2.0", "id": 1, "method": "eth_getTokenPrice" })};fetch('https://site1.moralis-nodes.com/eth/YOUR_API_KEY', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));# Dependencies to install:# $ python -m pip install requestsimport requestsurl = "https://site1.moralis-nodes.com/eth/YOUR_API_KEY"payload = { "jsonrpc": "2.0", "id": 1, "method": "eth_getTokenPrice"}headers = { "Accept": "application/json", "Content-Type": "application/json"}response = requests.request("POST", url, json=payload, headers=headers)print(response.text)package mainimport ( "fmt" "strings" "net/http" "io")func main() { url := "https://site1.moralis-nodes.com/eth/YOUR_API_KEY" payload := strings.NewReader("{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getTokenPrice\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Accept", "application/json") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body))}<?php// Dependencies to install:// $ composer require guzzlehttp/guzzlerequire_once('vendor/autoload.php');$client = new \GuzzleHttp\Client();$response = $client->request('POST', 'https://site1.moralis-nodes.com/eth/YOUR_API_KEY', [ 'body' => '{"jsonrpc":"2.0","id":1,"method":"eth_getTokenPrice"}', 'headers' => [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', ],]);echo $response->getBody();Response Example200 Returns the price data for the specified ERC20 token.{ "jsonrpc": "2.0", "id": 1, "result": { "tokenName": "Kylin Network", "tokenSymbol": "KYL", "tokenLogo": "https://cdn.moralis.io/eth/0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c.png", "tokenDecimals": "18", "nativePrice": { "value": "8409770570506626", "decimals": 18, "name": "Ether", "symbol": "ETH", "address": "string" }, "usdPrice": 19.722370676, "usdPriceFormatted": "19.722370676", "24hrPercentChange": "-0.8842730258590583", "exchangeAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984", "exchangeName": "Uniswap v3", "tokenAddress": "0x67b6d479c7bb412c54e03dca8e1bc6740ce6b99c", "toBlock": "16314545", "possibleSpam": "", "verifiedContract": true, "pairAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984", "pairTotalLiquidityUsd": "123.45" }}