-2

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)
}
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437

1 Answers1

0

try response.data in your console.log

SupraCoder
  • 115
  • 1
  • 13
  • Did you mean `console.log(response.data)`? The answer is not clear enough. – keiv.fly Apr 23 '22 at 15:08
  • Yes I apologize I meant console.log(response.data). When I run that I still can error message saying: "Uncaught SyntaxError: redeclaration of const cryptSettings" – malloc_magus34 Apr 23 '22 at 16:11