Stocks.js Sector Performance example

by Thomas

HTML

<script src="https://cdn.rawgit.com/wagenaartje/stocks.js/8548d960/dist/stocks.js"></script>

JavaScript

var stocks = new Stocks('SYTCQBUIU44BX2G4'); // Replace with your own

// Let's get the stock data of Tesla Inc for the last 10 minutes
async function request () {
  var result = await stocks.sectorPerformance({
    timespan: 'year-to-date'
  });

   document.body.innerHTML = JSON.stringify(result);
}

request();