GuidesAPI Reference

Token Price API

You can obtain token market price information in both US dollars and South Korean won.

We fetch real-time fluctuating token price information from exchanges, and token prices can be converted into U.S. dollars and Korean won.

What can be created with Token Price API?

  • Virtual asset portfolio: Users can develop an app that allows them to track their virtual assets.
    Try using the API to provide real-time price information for each virtual asset in the app.

  • Cryptocurrency exchange: At a cryptocurrency exchange, users can check real-time price information for
    the cryptocurrencies they want to trade. Try using the API to provide price information for each cryptocurrency in the app.

  • Cryptocurrency prediction model: You can develop a model that predicts the price of a specific token in the cryptocurrency market. Try using the Token Price API to collect real-time token price information and use it to train the model.

  • Cryptocurrency price comparison site: You can develop a website that compares the prices of various tokens offered in the cryptocurrency market, providing users with information on the most favorable deals they can make. Try using the API to collect and provide price information for various tokens.


Provided Platform

PlatformMainnetTestnet
Bitcoinβœ…βŒ
BNB Smart Chainβœ…βŒ
Ethereumβœ…βŒ
Klaytnβœ…βŒ
Polygonβœ…βŒ

Supported currencies

U.S. dollars($), South Korean won(β‚©)

Exchanges

The token price is retrieved in descending order from the following exchanges at the bottom:

  • CoinMarketCap
  • CoinGecko
  • Upbit
  • Bithumb
  • CoinOne
  • Korbit
  • Gopax

Token Price Endpoint

https://api.xplorer.tech/{coinSymbol}/token-price/{apiKey}

Authentication and permissions

To use the Token Price API, you first need an API Key. When you create a project in the console, an endpoint with the API Key added is generated. Copy the endpoint and send a request to it.

2800

Request method

To request the Token Price API, use the HTTP GET method. Additionally, you can include the desired token addresses in the addresses query parameter to retrieve their price information. See below for more details on the request format.

When you do not include a value for the addresses query parameter, Token Price API retrieves the price information of the platform coin as default behavior, as shown in the following example.

curl -X 'GET' \
  'https://api.xplorer.tech/ETH/token-price/{apiKey}' \
  -H 'accept: */*'

You will get the following result:

{
  "prices": [
    {
      "token": {
        "name": "Ethereum",
        "symbol": "ETH",
        "decimals": 18,
        "address": "0x"
      },
      "usdPrice": "1760.7300000000000000000000",
      "krwPrice": "2306078.8864500957313745976246",
      "source": "CoinGecko"
    }
  ]

To retrieve platform coin information, you should enter 0x in the addresses parameter.

curl -X 'GET' \
  'https://api.xplorer.tech/ETH/token-price/{apiKey}?addresses=0x' \
  -H 'accept: */*'

You will get the following result:

{
  "prices": [
    {
      "token": {
        "name": "Ethereum",
        "symbol": "ETH",
        "decimals": 18,
        "address": "0x"
      },
      "usdPrice": "1760.7300000000000000000000",
      "krwPrice": "2306078.8864500957313745976246",
      "source": "CoinGecko"
    }
  ]

To input multiple token addresses into the addresses parameter, separate them with commas without spaces.
Be careful not to include any spaces, as this could result in querying incorrect addresses.

The following example shows how to query the prices of Ethereum coin and Tether USD token using the Token Price API. Remember to separate the addresses with a comma without any spaces in between.

curl -X 'GET' \
  'https://api.xplorer.tech/ETH/token-price/{apiKey}?addresses=0x,0xdAC17F958D2ee523a2206206994597C13D831ec7' \
  -H 'accept: */*'

You will get the following result:

{
  "prices": [
    {
      "token": {
        "name": "Ethereum",
        "symbol": "ETH",
        "decimals": 18,
        "address": "0x"
      },
      "usdPrice": "1760.7300000000000000000000",
      "krwPrice": "2305920.4094140584870411714837",
      "source": "CoinGecko"
    },
    {
      "token": {
        "name": "Tether USD",
        "symbol": "USDT",
        "decimals": 6,
        "address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"
      },
      "usdPrice": "1.0020000000000000000000",
      "krwPrice": "1312.25812602323275233298338",
      "source": "CoinGecko"
    }
  ]
}

You cannot use the Token Price API in a testnet project. Price information is only valid on the mainnet.

Note

Clicking the Tracker button will take you to a token address lookup site related to the platform.
You can copy the desired token addresses from there and use them in the Token Price API.

2800