Need help with getting the values

I’m very new to working with APIs and i can’t figure how to get the specific value from nomics’s API.

Here’s my js code :
fetch(“https://api.nomics.com/v1/currencies/ticker?key=&ids=BTC&interval=1d,30d&per-page=100&page=1”)
.then(response => response.json())
.then(data => {
console.log(data)
})

the console can print out the data fine but when i try to get a specific value like “price” , usually adding .price to data like data.price should work. But the console keeps printing undefined

Here’s my code :

fetch(“https://api.nomics.com/v1/currencies/ticker?key=&ids=BTC&interval=1d,30d&per-page=100&page=1”)
.then(response => response.json())
.then(data => {
console.log(data.price)
})

I know this is a very simple question but i tried Google for an hour with no success so hopefully i can get my answer here.

1 Like

Okay i figured out how, thanks guy.

1 Like

Okay i figured how to access values but not the ones inside another obj. Like the values inside the 1 day interval etc…

1 Like

nvm i figured it out too :stuck_out_tongue:

1 Like