node-quandl
About
Description
A nodejs module for interacting with the Quandl API.
Author
Norman Joyner - norman.joyner@gmail.com
Getting Started
Installation
npm install quandl
Configuration
Simply require the quandl module, instantiate a new Quandl object, configure it if necessary, and start making calls. The auth token and api version are configurable.
New Quandl objects can be instantiated with configuration parameters. Here is an example:
var Quandl = ;var quandl = auth_token: "dsahFHUiewjjd" api_version: 3 proxy: "http://myproxy:3128";
Quandl objects can also be configured via the .configure(options)
method. Here is an exmaple:
var Quandl = ;var quandl = ; var options = auth_token: "dsahFHUiewjjd" quandl;
The auth_token parameter defaults to undefined (anonymous access). Be aware of the Quandl Usage Rules. The api_version parameter defaults to 3, for v3 api access. The proxy parameter routes all requests through the specfied proxy.
Supported API versions
- v1
- v3
Supported API Methods
Examples
Fetch Mt. Gox Bitcoin dataset, and print response:
quandl;
Fetch dataset metadata, and print response:
quandl;
Search for datasets pertaining to "crude oil", and print xml response:
quandl;
Passing Search Parameters
It's possible to make simple transformations of the data prior to retrieving it. For example, you can trim the data by excluding certain fields, slice the data using start and end dates, and even sort the data in ascending or descending order.
In the following example, only the closing prices for Facebook between January 30, 2015 and January 29, 2016 are retrieved. In this case, the closing prices are presented in ascending order.
var quandl = auth_token: "MY API TOKEN" api_version: 3; quandl;
You can customize the dataset object by adding extra parameters. For more information about these optional parameters, please take a look at Quandl's API Docs.
If you don't want to hard code the start and/or end dates, use Moment to capture and manipulate the current date and time.
Running Tests
npm test