I'm tryig to get JSON data from cryptocurrency exchange API to google spreadsheet.
I wrote a script for Poloniex and Cex.io or many exchanges, but I have an error for Binance. can you please help me to find what is the problem and what is the correction?
here is my working codes for Poloniex and others.
function ttt() {
var ss = SpreadsheetApp.openById('1J15kMAiE1alyBhqP5VB3C8-_8C6m60PkT0e5nUsWpBE');
var Polo = ss.getSheetByName("Polo");
ss.setActiveSheet(Polo);
Polo.getRange('A1:E1000').clearContent();
var url= "https://poloniex.com/public?command=returnOrderBook¤cyPair=BTC_ARDR&depth=1";
var responseAPI = UrlFetchApp.fetch(url);
var parcedData = JSON.parse(responseAPI.getContentText());
var asks = [];
asks.push(['askRate', 'askAmount']);
for(var key in parcedData.asks)
{asks.push(parcedData.asks[key]);}
Polo.getRange(1, 2, asks.length, 2).setValues(asks);
var url= "https://api.aex.com/ticker.php?c=all&mk_type=btc";
var responseAPI = UrlFetchApp.fetch(url);
var parcedData = JSON.parse(responseAPI.getContentText());
var buy = [[parcedData.ardr.ticker.buy]];
aex.getRange(2, 2, 1, 1).setValue(buy);
var sell = [[parcedData.ardr.ticker.sell]];
aex.getRange(2, 3, 1, 1).setValue(sell);
BUT!!! the binance API doesnt work why?