I can't figure how to use the axios.get() call to get the prices of cryptocurrencies using the coin gecko API

390 Views Asked by At

I am trying to just get the prices of bitcoin, ethereum, and dogecoin data using coingeckos api. I am trying to use the axios call axios.get method but I can't seem to figure it out.

This is the code I have so far:

const cryptSettings = async() => {
    const response = await axios.get('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin%2Cethereum%2Cdogecoin&vs_currencies=usd')
    console.log(response)
}
1

There are 1 best solutions below

2
On

try response.data in your console.log