I am currently trying to access the ID from this api. When I just ask for the data it returns everything fine:
fetch('https://cors-anywhere.herokuapp.com/https://api.deezer.com/user/4164456382/playlists')
.then(function (response) {
response.json()
.then(function (data){
console.log("Playlists: ", data);
})
})
However, when I try console logging the id using data[0].id
I get an error saying “Uncaught (in promise) TypeError: Cannot read property ‘id’ of undefined”. I have tried searching for other ways to get around it but so far I think that the path is correct. I’m not sure what I am overlooking.