Integration of Bitstamp API with Google Sheets using Google Apps Script

In this Post, we Integrate google sheets to Bitstamp API through the ‘authenticated’ section of the API so I can access my account information.
This Script is to Get account balances from Bitstamp.

function Bitstamp() {
  var key = '<Your API key here>';
  var secret = '<Your API secret here>';
  var customer_id = '<Your customer id here>';
  var nonce = new Date().getTime().toString();
  var message = nonce + customer_id + key
  var shaObj = new jsSHA("SHA-256", "BYTES");
  shaObj.setHMACKey(secret, "BYTES");
  var signature = shaObj.getHMAC("HEX").toString().toUpperCase();
  var url = "";
  var formData = {
    "key": key,
    "signature": signature,
    "nonce": nonce
  var options = {
    "method": "post",
    "muteHttpExceptions": true,
    "payload": formData
  var response = UrlFetchApp.fetch(url, options);
  var data = JSON.parse(response.getContentText());

Leave a Reply