Nasdaq Data Link Blog
  • Alternative Data
  • Data Monetization
  • Industry Trends
  • API Usage Guides
  • GO TO NASDAQ DATA LINK
API Usage Guides

Getting Started with the Nasdaq Data Link API

by Abraham Thomas September 3, 2015
by Abraham Thomas September 3, 2015

Every single dataset on Nasdaq Data Link 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 Nasdaq Data Link API; merely a quick-start guide. To read the complete and definitive documentation, please click here.

To start using the Nasdaq Data Link API:
Sign up for a free API key

Synopsis

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

https://data.nasdaq.com/api/v3/datasets/WIKI/FB/data.csv

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

https://data.nasdaq.com/api/v3/datasets/WIKI/FB/data.csv?column_index=4&exclude_column_names=true&rows=3&start_date=2012-11-01&end_date=2013-11-30&order=asc&collapse=quarterly&transform=rdiff

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:

https://data.nasdaq.com/api/v3/datasets/WIKI/FB/data.csv?api_key=YOURAPIKEYHERE

You can find your API key on your Nasdaq Data Link account settings page.

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

Time-Series Codes

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

Every 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 Time-Series Codes on our website, using our data browser.

Data Formats

You can get data in CSV, XML or JSON formats. Just append your preferred format to your Time-Series or Table Code.

CSV .csv https://data.nasdaq.com/api/v3/datasets/WIKI/FB/data.csv
XML .xml https://data.nasdaq.com/api/v3/datasets/WIKI/FB/data.xml
JSON .json https://data.nasdaq.com/api/v3/datasets/WIKI/FB/data.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”

Use to get changes, % changes, cumulative sums, or returns from 100

To see a full list of options and their detailed behavior, 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:

https://data.nasdaq.com/api/v3/datasets/WIKI/FB/metadata.json

Or if you prefer XML format, like this:

https://data.nasdaq.com/api/v3/datasets/WIKI/FB/metadata.xml

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

https://data.nasdaq.com/api/v3/datasets/WIKI/FB.json

Or this:

https://data.nasdaq.com/api/v3/datasets/WIKI/FB.xml

 

Downloading Lots of Data in One Call

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

https://data.nasdaq.com/api/v3/databases/YC/data?download_type=complete

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

https://data.nasdaq.com/api/v3/databases/YC/data?download_type=partial

 

Getting a list of datasets or databases

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

https://data.nasdaq.com/api/v3/databases

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

https://data.nasdaq.com/api/v3/databases/WIKI/codes.json

 

Full Reference

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

Abraham Thomas

previous post
API for Global Stock Data
next post
A Quant’s Approach to Building Trading Strategies: Part One

You may also like

API for Stock Data

July 13, 2017

API for Zacks Earnings Data

June 14, 2017

API for Global Stock Data

August 10, 2015

API for Currency Data

April 30, 2014

API for Housing Data

January 22, 2014

API for Interest Rate Data

November 13, 2013

API for Economic Data

November 7, 2013

API for Commodity Data

October 21, 2013

API for Bitcoin Data

August 16, 2013

About Nasdaq Data Link

Nasdaq Data Link is a premier source for financial, economic and alternative datasets.

Popular Posts

  • API for Stock Data
  • Tesla's Model 3 Has Miles to Go
  • 5 Misleading Myths About Alternative Data
  • Alternative Data in Action: Iron Ore in a Meltdown?
  • Data Monetization: Building a Data Product
Footer Logo

@2021 - All Right Reserved.

Nasdaq Data Link Blog
  • Alternative Data
  • Data Monetization
  • Industry Trends
  • API Usage Guides
  • GO TO NASDAQ DATA LINK