function processXMRAPI() {

 

  // Link the script with a spreadsheet using the unique identifier found in the spreadsheet web address

  var ss = SpreadsheetApp.openById('1fV9Q-wygsPa1QOrtl-Y-u69U5Nn2FYdyhmwoUE8opyI');

 

  var APIPullSheet = ss.getSheetByName("APIPull");

 

  // Clear Columns A, B, C & D

  APIPullSheet.getRange('A2:D19999').clearContent();

 

  var url= "https://poloniex.com/public?command=returnOrderBook&currencyPair=BTC_XMR&depth=19999";

  var responseAPI = UrlFetchApp.fetch(url);

  var parcedData = JSON.parse(responseAPI.getContentText());

 

  // Define the 'asks' array, and populate it from the parced data pulled

  var asks = [];

  asks.push(['askRate', 'askAmount']);

 

  for(var key in parcedData.asks)

    {

      asks.push(parcedData.asks[key]);

    }

 

  // Put the 'asks' data into the spreadsheet columns A & B

  askRange = APIPullSheet.getRange(1, 1, asks.length, 2);

  askRange.setValues(asks);

 

 

  // Get the 'bids' data into the spreadsheet columns C & D

  var bids = [];

  bids.push(['bidRate', 'bidAmount']);

  for(var key in parcedData.bids)

    {

       bids.push(parcedData.bids[key]);

    }

  bidRange = APIPullSheet.getRange(1, 3, bids.length, 2);

  bidRange.setValues(bids);  

}