I have JavaScript to communicate with the Binance API - it only downloads two data - I can't finish it because I get the message: {"code": - 1003, "msg": "Way too much request weight used; IP banned until 1663675430913. Please use the websocket for live updates to avoid bans. "} Please help me how to create a Websocket at the beginning of the script.
function response() {
var depthSocketBuffer;
//fetch(url) Metoda
var url = "https://api.binance.com/api/v3/ticker/bookTicker?symbol=XLMUSDT";
//getContentText() formula
var response = UrlFetchApp.fetch(url);
Logger.log(response);
//JSON.parse() formula
//highestBid
var json1 = response
var data = JSON.parse(response);
var bidPrice = data.ticker.bidPrice;
Logger.log(bidPrice)
SpreadsheetApp.getActiveSheet().getRange("B2").setValue(bidPrice);
//lowestAsk
var json2 = response
var data = JSON.parse(response);
var askPrice = data.ticker.askPrice;
Logger.log(lowestAsk)
SpreadsheetApp.getActiveSheet().getRange("C2").setValue(askPrice);
}