Javascript & Quandl API Tutorial

Javascript is the future of financial analysis.

Here's a quick tutorial about how to download data from Quandl and show it in the browser.

I am using Chrome. Your mileage may vary with other browsers, not by much though.

All the code is here.

The first item on the agenda is to craft a Quandl API request.

https://www.quandl.com/api/v1/datasets/WIKI/AAPL.json?column=11&transformation=rdiff&auth_token=xoxo

We are telling Quandl to grab the Apple adjusted close (column 11) price history which are transformed into returns.

The 'auth_token' identifies us to the Quandl server. They also allow so many free calls per day, so no need to worry about it initially.

Javascript has an object called 'XMLHttpRequest' which actually fetches the data.


Javascript is one of the fastest languages available, however any network call is going to be extremely slow no matter which language you use. Be sure to use web workers with web service APIs to keep everything fluid.


Code execution continues once XMLHttpRequest has loaded the data from Quandl.

We tell the browser what's to be executed with the onload() method.

Firstly we write the returned data to do browser with the showData() method.

Next calculate the median absolute deviation statistic using the JStat library with the doAnalysis() method.

The console.log() method tells the browser to show the result in the browser's "console". Usually you can bring up the console by pressing Ctrl+Alt+j or Command+Alt+j.