title: Fetch data from Binance API to Javascript Array
body: <p>I just started to work with API's and got a little bit confused of how can I transfer the data which I receive to a JavaScript array.
  I have this code which receive the data from Binance API and show it in console. </p>
  
  <pre><code>var burl ='https://api.binance.com';
  
  var query ='/api/v3/klines';
  
  query += '?symbol=BTCUSDT&amp;interval=15m&amp;limit=2';
  
  var url = burl + query;
  
  var ourRequest = new XMLHttpRequest();
  
  ourRequest.open('GET',url,true);
  ourRequest.onload = function(){
  console.log(ourRequest.responseText);
  }
  ourRequest.send();
  </code></pre>
  
  <p>I also have a hard-scripted chart from FusionCharts Library.
  The source code of a chart is here - <a href="https://www.fusioncharts.com/charts/candlestick-charts/candlestick-chart-with-custom-trends?framework=javascript" rel="nofollow noreferrer">FusionChart Candlestick Chart</a></p>
  
  <pre><code>const dataSource = {
  chart: {
  caption: "Bitcoin Price",
  subcaption: "Q4-2017",
  numberprefix: "$",
  pyaxisname: "Price (USD)",
  showvolumechart: "1",
  vnumberprefix: "$",
  vyaxisname: "Volume traded",
  exportenabled: 1,
  theme: loadedTheme || ThemeAliases.light
   },
  categories: [
  {
    category: [
      {
        label: "Jan",
        x: "1"
      },
      {
        label: "Feb",
        x: "32"
      },
      {
        label: "Mar",
        x: "62"
      },
      {
        label:"Apr",
        x:"12"
      }
    ]
  }
  ],
  dataset: [
  {
    data: [
      {
        tooltext:
          "&lt;b&gt;Oct 01, 2017&lt;/b&gt;&lt;br&gt;Open: &lt;b&gt;$openDataValue&lt;/b&gt;&lt;br&gt;Close: &lt;b&gt;$closeDataValue&lt;/b&gt;&lt;br&gt;High: &lt;b&gt;$highDataValue&lt;/b&gt;&lt;br&gt;Low: &lt;b&gt;$lowDataValue&lt;/b&gt;&lt;br&gt;Volume: &lt;b&gt;$volumeDataValue&lt;/b&gt;",
        open: 4341.05,
        high: 4403.74,
        low: 4269.81,
        close: 4403.74,
        volume: 1208210000,
        x: 1
      },
  FusionCharts.ready(function() {
  var myChart = new FusionCharts({
  type: "candlestick",
  renderAt: "chart-container",
  width: "75%",
  height: "100%",
  dataFormat: "json",
  dataSource
  
  }).render();
  });
  </code></pre>