You can use pancakeswap API for get coin price in USD and convert it in your application
Simple example
const PANCAKESWAP_TONCOIN_ID = '0x76a797a59ba2c17726896976b7b3747bfd1d220f'
const PANCAKESWAP_URL = 'https://api.pancakeswap.info/api/v2/tokens'
const UPDATE_ERROR = "Can't update token price"
await new Axios({})
.get(`${PANCAKESWAP_URL}/${pancakeswapTokenId}`)
.then(async (response) => {
if (
response.status === 200 &&
response.data &&
parseJSON(response.data)
) {
const { data } = parseJSON(response.data)
if (data.price && validateThirdpartyPrice(data.price)) {
resolve({ price: data.price })
} else {
resolve({ error: UPDATE_ERROR })
}
} else {
resolve({ error: UPDATE_ERROR })
}
})
.catch(() => {
resolve({ error: UPDATE_ERROR })
})
As you can see in data.price you will get value like: 2.42187 (Toncoin in USD)