How can I use Google Apps Script to parse through the output of an API and convert it into a table in Google Sheets?
I attempted the following code, but it only returns Null values.
var response = UrlFetchApp.fetch(url, options);
var text = response.getContentText();
for (i in text) {
Logger.log(text[i]);
}
{
"status":1,
"complete":1,
"list":{
"3357271691":{
"item_id":"3357271691",
"resolved_id":"3357271691",
"given_url":"https:\/\/www.bloomberg.com\/news\/features\/2021-06-15\/airbnb-spends-millions-making-nightmares-at-live-anywhere-rentals-go-away",
"given_title":"",
"favorite":"0",
"status":"0",
"time_added":"1623783338",
"time_updated":"1623783338",
"time_read":"0",
"time_favorited":"0",
"sort_id":0,
"resolved_title":"Airbnb Is Spending Millions of Dollars to Make Nightmares Go Away",
"resolved_url":"https:\/\/www.bloomberg.com\/news\/features\/2021-06-15\/airbnb-spends-millions-making-nightmares-at-live-anywhere-rentals-go-away",
"excerpt":"When things go horribly wrong during a stay, the company\u2019s secretive safety team jumps in to soothe guests and hosts, help families\u2014and prevent PR disasters. Megaphone.fm: How Airbnb Makes Nightmares Disappear...",
"is_article":"1",
"is_index":"0",
"has_video":"0",
"has_image":"1",
"word_count":"155",
"lang":"en",
"top_image_url":"https:\/\/assets.bwbx.io\/images\/users\/iqjWHBFdfxIU\/iWjqS9z4c46I\/v0\/1200x630.jpg",
"domain_metadata":{
"name":"Bloomberg",
"logo":"https:\/\/logo.clearbit.com\/bloomberg.com?size=800",
"greyscale_logo":"https:\/\/logo.clearbit.com\/bloomberg.com?size=800&greyscale=true"
},
"listen_duration_estimate":60
}
}
}