Skip to main content

Price API

๐ŸŒ endpointโ€‹

GET https://app.clober.io/api/chains/143/price/{tokenAddress}
  • {tokenAddress}: the ERC-20 address you want priced.
  • Quoted currency is always USDC.
  • Default quote size is 1 USDC (1000000 in 6 decimals).

๐Ÿ“ฆ example requestโ€‹

GET https://app.clober.io/api/chains/143/price/0x0000000000000000000000000000000000000000

๐Ÿงช minimal typeScript usageโ€‹

import axios from 'axios'

async function getUsdPrice(tokenAddress: string) {
const { data } = await axios.get(
`https://app.clober.io/api/chains/143/price/${tokenAddress}`
)
return data.usdPrice as string
}

๐Ÿ“˜ sample responseโ€‹

{
"usdPrice": "4487.635893019317953020",
"currency": {
"address": "0xEE8c0E9f1BFFb4Eb878d8f15f368A02a35481242",
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18
},
"source": [
{
"amountIn": "1000000",
"inputCurrency": {
"address": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6
},
"amountOut": "222834477626747",
"outputCurrency": {
"address": "0xEE8c0E9f1BFFb4Eb878d8f15f368A02a35481242",
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18
},
"usdPrice": "4487.635893019317953020",
"aggregator": "KyberSwap",
"executionMilliseconds": 528.114308999851
},
{
"amountIn": "1000000",
"inputCurrency": {
"address": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6
},
"amountOut": "222831276921878",
"outputCurrency": {
"address": "0xEE8c0E9f1BFFb4Eb878d8f15f368A02a35481242",
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18
},
"usdPrice": "4487.700352543364578669",
"aggregator": "EisenFinance",
"executionMilliseconds": 403.161776999943
},
{
"amountIn": "1000000",
"inputCurrency": {
"address": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6
},
"amountOut": "222831276921878",
"outputCurrency": {
"address": "0xEE8c0E9f1BFFb4Eb878d8f15f368A02a35481242",
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18
},
"usdPrice": "4487.700352543364578669",
"aggregator": "Madhouse",
"executionMilliseconds": 194.255760999862
},
{
"amountIn": "1000000",
"inputCurrency": {
"address": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6
},
"amountOut": "222831276921878",
"outputCurrency": {
"address": "0xEE8c0E9f1BFFb4Eb878d8f15f368A02a35481242",
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18
},
"usdPrice": "4487.700352543364578669",
"aggregator": "Monorail",
"executionMilliseconds": 1173.72003900027
},
{
"amountIn": "1000000",
"inputCurrency": {
"address": "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6
},
"amountOut": "222831276921878",
"outputCurrency": {
"address": "0xEE8c0E9f1BFFb4Eb878d8f15f368A02a35481242",
"name": "Wrapped Ether",
"symbol": "WETH",
"decimals": 18
},
"usdPrice": "4487.700352543364578669",
"aggregator": "OpenOcean",
"executionMilliseconds": 263.910091999918
}
]
}
  • usdPrice: final price of {tokenAddress} in USDC, as a string with full precision.
  • currency: metadata for the token you requested.
  • source: array of per-aggregator quotes used to derive usdPrice.
    • amountIn: USDC amount used for the quote (smallest units, default 1000000).
    • inputCurrency: always USDC (address, symbol, decimals).
    • amountOut: expected output token amount for amountIn USDC (smallest units of the token).
    • outputCurrency: echoes the priced token metadata.
    • usdPrice: implied price from this aggregator for the given size.
    • aggregator: name of the router/aggregator.
    • executionMilliseconds: time taken to fetch/compute this quote.