DEX API

Get tokens#

It fetches a list of tokens. This interface returns a list of tokens that belong to major platforms or are deemed significant enough by OKX. However, you can still quote and swap other tokens outside of this list on OKX DEX.

Request address#

GET https://www.okx.com/api/v5/dex/aggregator/all-tokens

Request param#

ParameterTypeRequiredDescription
chainIdStringYesChain ID (e.g., 1 for Ethereum. See Chain IDs)

Response param#

ParameterTypeThe precision of tokens
decimalsStringThe precision of tokens (e.g., 18)
tokenContractAddressStringToken contract address (e.g., 0x382bb369d343125bfb2117af9c149795c6c65c50)
tokenLogoUrlStringToken logo (e.g., https://static.okx.com/cdn/wallet/logo/USDT-991ffed9-e495-4d1b-80c2-a4c5f96ce22d.png)
tokenNameStringToken full name (e.g., Tether)
tokenSymbolStringToken symbol (e.g., USDT)

Request example#

shell
curl --location --request GET 'https://www.okx.com/api/v5/dex/aggregator/all-tokens?chainId=1' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'

Response example#

200
{
  "code": "0",
  "data": [
    {
      "decimals": "18",
      "tokenContractAddress": "0x382bb369d343125bfb2117af9c149795c6c65c50",
      "tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/USDT-991ffed9-e495-4d1b-80c2-a4c5f96ce22d.png",
      "tokenName": "Tether",
      "tokenSymbol": "USDT"
    },
    {
      "decimals": "18",
      "tokenContractAddress": "0xc946daf81b08146b1c7a8da2a851ddf2b3eaaf85",
      "tokenLogoUrl": "https://static.okx.com/cdn/explorer/okexchain/exchain_usdc.png",
      "tokenName": "USD Coin",
      "tokenSymbol": "USDC"
    },
    {
      "decimals": "18",
      "tokenContractAddress": "0xdf54b6c6195ea4d948d03bfd818d365cf175cfc2",
      "tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/okb.png",
      "tokenName": "OKB",
      "tokenSymbol": "OKB"
    },
    {
      "decimals": "18",
      "tokenContractAddress": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
      "tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/okt.png",
      "tokenName": "OKTC",
      "tokenSymbol": "OKT"
    },
    {
      "decimals": "18",
      "tokenContractAddress": "0x218c3c3d49d0e7b37aff0d8bb079de36ae61a4c0",
      "tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/BNB-20220308.png",
      "tokenName": "Binance Coin",
      "tokenSymbol": "BNB"
    },
    {
      "decimals": "18",
      "tokenContractAddress": "0x332730a4f6e03d9c55829435f10360e13cfa41ff",
      "tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/BUSD-20220308.png",
      "tokenName": "Binance USD",
      "tokenSymbol": "BUSD"
    },
    {
      "decimals": "18",
      "tokenContractAddress": "0xdcac52e001f5bd413aa6ea83956438f29098166b",
      "tokenLogoUrl": "https://static.okx.com/cdn/wallet/logo/eth_usdk.png",
      "tokenName": "USDK",
      "tokenSymbol": "USDK"
    }
  ],
  "msg": ""
}