Getting Started with the Quandl API

By Permalink 0

Every single dataset on Quandl is available via our API. The API is simple, consistent and completely free to use. Here’s a quick and easy guide to get you started.

This is not meant to be a formal reference for the Quandl API; merely a quick-start guide. To read the complete and definitive documentation, please click here.

Get Started

To start using the Quandl API:

  1. Sign up for a free API key
  2. Find the data you need: use the list below or use our search page.
  3. Start making calls: use our API reference page to learn the syntax.



Here is an API call for FB stock data in CSV format:

Here is the same call, with some additional parameters appended:

The second call gets FB stock data, but only column 4 (closing prices); it skips column names, truncates the data at 3 rows, selects only data between 2012-11-01 and 2013-11-30, arranges the dates in ascending order, down-samples daily data to quarterly, and computes percentage changes.


Usage Rules

API usage is free for registered users; just append your API key to your call like this:

You can find your API key on your Quandl account settings page.

(For concision, we will not be including the api_key parameter in the remaining examples on this page).


Quandl Codes

To download a dataset, you will need to know its “Quandl code”.  In the above example, you downloaded a dataset with the Quandl code “WIKI/FB”.

Every Quandl code has 2 parts: the database code (“WIKI”) which specifies where the data comes from, and the dataset code (“FB”) which identifies the specific time series you want.

You can find Quandl codes on our website, by searching for the data you need.


Data Formats

You can get data in CSV, XML or JSON formats.  Just append your preferred format to your Quandl code.

CSV .csv 
XML .xml
JSON  .json


Data Manipulation

You can customize the data you receive by passing optional parameters with your API call.  Here are some of the available options:

Sort Order Use “order=asc|desc” to specify the order in which data is returned
Date Range Use “start_date=yyyy-mm-dd” and/or “end_date=yyyy-mm-dd”
Specific Columns  Use “column_index=m” to return only data from column m 
Truncated Rows   Use “rows=n” to return only the first n rows of data 
Data Only Use “exclude_column_names=true” to return only data rows in CSV
Data Frequency  Use “collapse=none|daily|weekly|monthly|quarterly|annual” to sample observations at your desired frequency 
Data Arithmetic  Use “transform=none|diff|rdiff|cumul|normalize” to get changes, % changes, cumulative sums, or returns from 100 

To see a full list of options and their detailed behaviour, please visit our API reference.


Getting Metadata

You can use the API to get metadata for the dataset you need, in JSON format, like this:

Or if you prefer XML format, like this:

You can get both data and metadata in one call like this:

Or this:


Downloading Lots of Data in One Call

For premium (subscriber-only) databases, you can download the entire database in a single call, like this:

If you just want the last day’s worth of data, do this:


Getting a list of datasets or databases

For a list of all databases on Quandl, do this:

For a list of datasets in a given database, do this:


Full Reference

This is not meant to be a complete reference for the Quandl API. See our full API documentation for that.

Get Started Now!

To use Quandl’s API, please sign up for a free API key:
Get Your Free API Key Now

No Comments Yet.

Leave a Reply

Your email address will not be published. Required fields are marked *