所以我复制了一个工作代码,并尝试将其更改为我要导入的API
像这样function fetchdata_Coinswap() {
var ss = SpreadsheetApp.getActiveSpreadsheet()
var response =UrlFetchApp.fetch('https://api.coin-swap.net/market/summary');
var json=response.getContentText();
var data=JSON.parse(json);
var output= new Array()
var i= 0
var currency = '';
for (currency in data['exchange']) {
output[i]= ['Coinswap',currency ,data['exchange'][currency]['lastprice'],data['exchange'][currency]['symbol']];
i=i+1;
}
ss.getRange('Sheet1!A14:D'+(i+13)).setValues(output)
return
}
我现在遇到的问题是,它说,
Incorrect range height, was 0 but should be 2 (line 63, file "Code")
我试图改变范围,但每次我得到的范围都是无关紧要的。我也认为我在输出中做错了,范围错误来了。有人可以给我一点帮助。我非常感谢你,提前谢谢