title: How to get data from JSON in google sheets custom function
body: <p>I've been trying to do calculations based on prices on some crypto markets.
  In the mean time I try and learn to write a custom function in the script editor that gets the ticker data.
  So far, I can get the data with the following code;</p>
  
  <pre><code>    function getkrakenbtc() {
      var myUrl = "https://api.kraken.com/0/public/Ticker?pair=XBTUSD";
      var jsonData = UrlFetchApp.fetch(myUrl);
      var jsonString = jsonData.getContentText();
      return jsonString;
      }
  </code></pre>
  
  <p>But this function gets all the data into one cell like this:</p>
  
  <pre><code>{
      "error": [],
      "result": {
          "XXBTZUSD": {
              "a": ["6828.90000", "1", "1.000"],
              "b": ["6822.40000", "3", "3.000"],
              "c": ["6828.30000", "0.45700000"],
              "v": ["8345.28377914", "11241.98107284"],
              "p": ["7079.63828", "7171.18596"],
              "t": [22419, 30041],
              "l": ["6751.00000", "6751.00000"],
              "h": ["7432.70000", "7529.70000"],
              "o": "7410.10000"
          }
      }
  }
  </code></pre>
  
  <p>Then I then get the part that I want with the help of formulas. 
  How can i get the a or b item of the above array using javascript?</p>