Data Trends for Investment Professionals

GO TO QUANDL.COM ⟶

API for Stock Data

Tags:

Quandl offers a simple API for stock market data. The API delivers end-of-day prices, harmonized fundamentals, financial ratios, indexes, options and volatility, earnings estimates, analyst ratings, investor sentiment and more.

Example Calls

AAPL stock price:

Free:

https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?api_key=YOURAPIKEY

Premium:

https://www.quandl.com/api/v3/datasets/EOD/AAPL.csv?api_key=YOURAPIKEY

AAPL revenue:

Free:

https://www.quandl.com/api/v3/datasets/SEC/AAPL_SALESREVENUENET_Q.csv?api_key=YOURAPIKEY

Premium:

https://www.quandl.com/api/v3/datasets/SF1/AAPL_REVENUE_MRQ.csv?api_key=YOURAPIKEY

Sign up for a free API key

To find the data you need, use the guide below or use our data browser.

Use our quick start guide to learn our API syntax, or go to our documentation portal for a full reference.

If you prefer, you can get data via our libraries for Python, R, Excel, Ruby and other tools, instead of via the raw API.

Data Organization

Quandl has a huge amount of stock data. This data is divided into multiple databases, each covering a different subject.

Most databases are free to use. A few “premium” databases are available only to paying subscribers. Premium databases are of higher quality, better documented, more comprehensive, and updated more regularly than free databases.

Featured Database

Robur Global Fundamentals Data

Updated daily, this database provides up to 6 years of history for 75+ essential fundamental indicators and financial ratios for 3,700+ companies worldwide.

List of Databases

This list is for US stocks. For other countries, please see our API for global stock data page.

US Stock Prices

US Stock Fundamentals and Financial Ratios

US Stock Options and Volatility

Global Stock Data

Analyst Ratings and Forecasts

Earnings Estimates, Surprises and History

Sales Estimates

Earnings and sales estimates are based on Zacks Investment Research daily surveys of 2,600 equity analysts from over 185 brokerage firms.

Investor Sentiment

Corporate Actions

Technical Indicators

Example 1: Stock Price API

Here is an example API call for stock prices:

https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?column_index=4&order=asc&collapse=quarterly&start_date=2012-01-01&end_date=2013-12-31&api_key=YOURAPIKEY

The above call gets the unadjusted closing prices (column 4) for AAPL stock, sorted in ascending date order, quarterly, from the start of 2012 to the end of 2013, in CSV format.  This dataset has Quandl code WIKI/AAPL and comes from database WIKI.

For the full syntax, read our API reference.

Stock Price API in Depth

In the following sections, selected stock price databases are described in greater depth. Note that the definitive documentation for any given database can always be found on its documentation page; what follows is merely a brief overview.

EOD

For US stock prices, we recommend the Quotemedia End-of-Day US Stock Prices database, EOD. This is the highest-quality stock price database anywhere on the internet: it provides comprehensive, accurate, reliable end-of-day stock prices, both adjusted and unadjusted, including complete dividend and split history. The database covers over 8,000 public companies, including every stock listed on NYSE, NASDAQ, AMEX and ARCA. This database is updated daily at 5pm or earlier.

EOD offers the lowest-cost, highest-quality professsional-grade end of day stock price data in the world. Single user, startup, developer and redistributor licenses are available.

WIKI

For free and open stock prices, we recommend database WIKI. This is an unrestricted and unencumbered collection of historical stock prices on 3 North American exchanges: NYSE, NASDAQ and AMEX. The data in this database is curated by the Quandl community. It is usually updated within 6 hours of the close; however, since it is crowd-sourced, the delivery time cannot be guaranteed.

Example 2: Stock Fundamentals API

Here is an example API call for stock fundamentals:

https://www.quandl.com/api/v3/datasets/SEC/AAPL_SALESREVENUENET_Q.json&api_key=YOURAPIKEY

The above call gets the net quarterly sales revenue for Apple Inc, from database SEC in JSON format; the Quandl code of this dataset is SEC/AAPL_SALESREVENUENET_Q.

Stock Fundamentals API in Depth

In the following sections, individual stock fundamentals databases are described in greater depth. Note that the definitive documentation for any given database can always be found on its documentation page; what follows is merely a brief overview.

SF1

For basic US stock fundamentals, we recommend the SF1 Core Fundamentals database. This database offers 90 essential fundamental indicators and financial ratios for 5,500 US public companies, both point-in-time and revised data, annual and quarterly variants, with 10 years of history.

This is by far the best-value source on the internet for historical and current US stock fundamentals and financial ratios. In addition to parsing raw SEC filing documents, the data provider has invested 1000s of hours into harmonizing the reported data across companies and across time; a huge and extremely intricate process. The database is highly accurate, carefully error-checked and updated every single day.

ZFA + ZFB

Zacks Investment Research has created two excellent and comprehensive databases for fundamental data and financial ratios:  ZFA and ZFB.  These two databases cover over 250 key statistics for each of 10,000 stocks, including delisted tickers.  The presence of delisted stock fundamentals allows back-testing without survivorship bias.  Note that ZFB is a superset of ZFA.

Both databases are updated daily, and build upon Zacks’ 35+ years of expertise building professional-grade data products for sale.

Free Alternatives

Corporate financial statements for the last ~5 years are available from the free SEC database.  However, this database has one major flaw: indicators are not harmonized across companies.  This is a limitation of the source data.

The Quandl community has built a crowd-sourced harmonized fundamentals database that attempts to mitigate this flaw: its is available as database RAYMOND.  Being crowd-sourced, we cannot guarantee update times or accuracy for this database.

Prof. Aswath Damodaran from NYU used to maintain a superb compendium of harmonized corporate data that he would compute himself.  However, he has had to delete most of his calculations and stop providing updates, due to a legal injunction by the “owners” [sic] of the raw data that he used for his computations.  You can view the non-updating database at DMDRN, provided solely for historical purposes.

Limitations of Free Fundamentals Data

Fundamentals data from the SEC, and the corresponding harmonized indicators from RAYMOND, have at least three known limitations.

First, the data only goes back a few years. The SEC did not mandate electronic filing prior to 2009, and so structured online records are not available prior to that date.

Second, the harmonization procedure described above fails when companies change their reporting and accounting treatment from year to year. This does happen, despite the SEC’s best efforts to force standardization.

Third, there are occasional gaps in the quarterly data. Companies are required to file both quarterly (10-Q) and annual (10-K) reports with the SEC, and these reports are what the SEC makes available on its website. But companies are not required to file quarterly reports on dates when they’re “also” filing annual reports. Hence a typical company listing on the SEC will have 3 quarterly reports and 1 annual report, for every fiscal year. Of course, it’s possible to “back out” the missing quarterly data, but this is beyond Quandl’s scope.

Indicators in the DMDRN database suffer from a few known limitations.

First, the data comes from a variety of different public sources, and is subjected to a variety of calculation and adjustment procedures. For those looking for transparency and/or consistency in calculation, this database may not be the best choice.

Second, the data collection and calculation process is designed and optimized for cross-sectional comparisons of companies, not for time series analysis. Ratios are meant to be forward-looking point-in-time estimates, not best guesses of past actuals. And the emphasis is on sector averages rather than on individual company data.

Third and most obviously, the data is not updated any more, due to a legal injunction.

Available Fundamental Indicators

Here is a list of fundamental indicators available for the SF1 database.  Similar lists for ZFA and ZFB can be found on their respective documentation pages.

Balance Sheet

Code Name
ACCOCI Accumulated Other Comprehensive Income
ASSETS Total Assets
ASSETSC Current Assets
ASSETSNC Assets Non-Current
CASHNEQ Cash and Equivalents
DEBT Total Debt
EQUITY Shareholders Equity
INTANGIBLES Goodwill and Intangible Assets
INVENTORY Inventory
LIABILITIES Total Liabilities
LIABILITIESC Current Liabilities
LIABILITIESNC Liabilities Non-Current
PAYABLES Trade and Non-Trade Payables
RECEIVABLES Trade and Non-Trade Receivables
RETEARN Accumulated Retained Earnings (Deficit)

Cash Flow

Code Name
CAPEX Capital Expenditure
DEPAMOR Depreciation, Amortization & Accretion
NCF Net Cash Flow / Change in Cash & Cash Equivalents
NCFCOMMON Issuance (Purchase) of Equity Shares
NCFDEBT Issuance (Repayment) of Debt Securities
NCFDIV Payment of Dividends & Other Cash Distributions
NCFF Net Cash Flow from Financing
NCFI Net Cash Flow from Investing
NCFO Net Cash Flow from Operations
NCFX Effect of Exchange Rate Changes on Cash

Income Statement

Code Name
DPS Dividends per Basic Common Share
EBIT Earning Before Interest & Taxes (EBIT)
EPS Earnings per Basic Share
EPSDIL Earnings per Diluted Share
GP Gross Profit
INTEXP Interest Expense
NETINC Net Income
NETINCCMN Net Income Common Stock
NETINCDIS Net Income from Discontinued Operations
PREFDIVIS Preferred Dividends Income Statement Impact
REVENUE Revenues
RND Research and Development Expense
SGNA Selling, General and Administrative Expense
SHARESWA Weighted Average Shares
SHARESWADIL Weighted Average Shares Diluted
TAXEXP Income Tax Expense

Entity Information

Code Name
EVENT Material Corporate Events
FILINGDATE Filing Date to Report Period Mapping
FILINGTYPE Filing Date to Report Type Mapping
PRICE Share Price (Adjusted Close)
SHAREFACTOR Share Factor
SHARESBAS Shares (Basic)

Metrics and Ratios

Code Name
ASSETSAVG Average Assets
ASSETTURNOVER Asset Turnover
BVPS Book Value per Share
CURRENTRATIO Current Ratio
DE Debt to Equity Ratio
DILUTIONRATIO Share Dilution Ratio
DIVYIELD Dividend Yield
EBITDA Earnings Before Interest, Taxes, Depreciation & Amortization (EBITDA)
EBITDAMARGIN EBITDA Margin
EBT Earnings before Tax
EPSDILGROWTH1YR EPS Diluted Growth
EPSGROWTH1YR EPS Growth
EQUITYAVG Average Equity
EV Enterprise Value
EVEBIT Enterprise Value over EBIT
EVEBITDA Enterprise Value over EBITDA
FCF Free Cash Flow
FCFPS Free Cash Flow per Share
GROSSMARGIN Gross Margin
INTERESTBURDEN Financial Leverage
LEVERAGERATIO Leverage Ratio
MARKETCAP Market Capitalization
NCFOGROWTH1YR NCFO Growth
NETINCGROWTH1YR Net Income Growth
NETMARGIN Profit Margin
PAYOUTRATIO Payout Ratio
PB Price to Book Value
PE Price Earnings (Damodaran Method)
PE1 Price to Earnings Ratio
PS Price Sales (Damodaran Method)
PS1 Price to Sales Ratio
REVENUEGROWTH1YR Revenue Growth
ROA Return on Average Assets
ROE Return on Average Equity
ROS Return on Sales
SHARESWAGROWTH1YR Weighted Average Share Growth
SPS Sales per Share
TANGIBLES Tangible Asset Value
TAXEFFICIENCY Tax Efficiency
TBVPS Tangible Assets Book Value per Share
WORKINGCAPITAL Working Capital

Terms and Licensing

The Quandl API is free for registered users. You can find our rate limits here.

All open databases on Quandl are free and unencumbered.

Premium databases are governed by their respective subscription licenses. We strive to offer the most liberal, flexible, transparent and fair data licenses in the world. Individual, startup, developer and institutional licenses are available.

You can preview all premium databases before buying, if you sign up for an API key.

Additional Resources

You might find these pages helpful:

Start using Quandl’s API for stock data

VIEW COMMENTS

Leave a Reply

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


3 Comments
Fix This
Created with Sketch.