I'm trying to fetch some API data to integrate into a google sheet. I'm fetching from this URL https://api.coingecko.com/api/v3/coins/list. However, when I run the function, the logger returns undefined. What am I missing? This is day 2 learning how to code.
function myFunction() {
var res = UrlFetchApp.fetch("https://api.coingecko.com/api/v3/coins/list");
var content = res.getContentText();
var json = JSON.parse(content);
var list = json["id"]["symbol"];
Logger.log(list);
}
for (const el of json) {console.log(el.id, el.symbol, el.name);}