Data Trends for Investment Professionals

GO TO QUANDL.COM ⟶

API for Economic Data

Tags:

Using the Quandl API for Economic Data

This document is a comprehensive guide to using the Quandl API to access our economic data.The mechanism for accessing economic data via the Quandl API is no diferent from the mechanism for accessing all data on Quandl. The purpose of this help page is mainly to explain the specific publishers and nomenclature for economic data.

For further information on the Quandl data API, read our general API reference. You can also access Quandl data directly from within the analysis tool of your choice – Stata, SAS, R, Python, Matlab, Maple, EViews and more – using our free tools. Quandl is the easiest way to find and download current and historical economic data.

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.

Free Unlimited API for Economic Data

Quandl provides a free, unlimited and unrestricted API for global economic data, including macroeconomic, demographic and social statistics.

Quandl unifies free data from the World Bank, UN, Eurostat, ADB, BEA, BLS, FRED and many more data publishers, in a single easy-to-use and powerful economic data API. Quandl also offers premium economic databases from specialist data vendors, guaranteed to be accurate, comprehensive and up-to-date, via the same API.

Quandl’s API offers access to 1000s of economic indicators for every country in the world. Data publishers include regional and multinational organizations, central banks, government statistical departments, research agencies and think tanks. Indicators cover growth, inflation, employment, domestic and internationsl trade, industry, agriculture, services, capital markets, government finances, aid, education, gender, health, poverty, disease, mortality, population, and much much more. All of these datasets are accessible via a single uniform API, documented on this page.

Basic Economic Data API Usage

International and regional statistical organizations often collect data for the same indicator across multiple countries, suitably harmonized and synchronized. For such economic indicators that exist across countries, the Quandl code generally follows one of these two formats:

{PUBLISHER}/{COUNTRY}_{INDICATOR}

or

{PUBLISHER}/{INDICATOR}_{COUNTRY}

where {PUBLISHER} identifies the data publisher, {COUNTRY} is the ISO 3-letter code of the country, and {INDICATOR} is a publisher-specific code for the indicator in question. The country code and the indicator code are separated by an underscore.

For example, the ISO 3-letter code for China is “CHN”. The publisher named “WORLDBANK” has data for total population under the indicator code “SP_POP_TOTL”. Hence the full Quandl code for the Population of China as published by the World Bank is WORLDBANK/CHN_SP_POP_TOTL.

Here is a list of all ISO 3-letter country codes.

Central banks and government agencies typically publish single-country economic statistics, hence the above nomenclature pattern does not apply to them.

Example API Call

For quick learners, here is an example of a Quandl API call for economic data:

https://www.quandl.com/api/v3/datasets/UNDATA/GID_IFIR_CAN.csv?column_index=2order=asc&start_date=1980-01-01&end_date=1990-12-31&collapse=annual

The above call gets the government bill rate (column 2) from the dataset titled “Interest Rates – Canada”, published by the UN, sorted in ascending date order, from the start of 1980 to the end of 1990, annual observations, in CSV format.

Many more transformations and manipulations of the data are available; see our full API reference for more details.

Data Publishers

Quandl covers data from over 500 different publishers, many of whom provide economic statistics. For economic data, these publishers generally fall into 6 categories:

  • International Organizations. This includes the UN, World Bank, IMF, WHO, FAO, WTO, ILO and similar institutions.
  • Regional Organizations. This includes the OECD, ADB, Eurostat, ECB and others.
  • Central Banks. Quandl has data from about 30 different central banks. The most comprehensive central bank databases are published by the Bundesbank, BOE, BCB and the Federal Reserve.
  • Government Agencies. The US government publishes a huge amount of data, via the DOE, BEA, BLS, USDA, CENSUS and other agencies. Other countries with excellent statistical agencies include Canada, Brazil, France, UK, Australia and Germany,
  • Researchers. There are a number of excellent cross-country surveys, including LIS, Penn, GGDC / Maddison, Brinkhoff and EPI.
  • Premium Publishers. These are specialist economic data providers who provide high-quality harmonized cross-country data for a fee.

Individual economic data publishers are described in detail below.

Note that most international and regional organizations do not collect or measure primary economic data themselves; they merely collate data that was originally published by central banks and single-country statistical agencies. This leads to certain limitations that are explained at the end of this guide.

International Organizations

World Bank

The World Bank has one of the most comprehensive (and best-documented) collections of international economic and statistical data. All economic datasets published by the World Bank can be found on the WORLDBANK page and follow the code format WORLDBANK/{COUNTRY}_{INDICATOR}.

The World Bank’s data is organized into 22 databases corresponding to specific areas of coverage. For a list of available databases and their descriptions, please refer to the WORLDBANK documentation page

IMF

The International Monetary Fund publishes several different databases, covering global economic and financial statistcs. However, not all of theses databases are freely available. Quandl’s IMF database contains the subset of IMF data that is freely available under the publisher name ODA. This subset includes most major economic indicators in the World Economic Outlook (WEO) database.

All of the ODA datasets follow the code format ODA/{COUNTRY}_{INDICATOR}. For a list of all available indicators, please refer to the IMF documentation page.

United Nations

The United Nations Statistical Division (UNSD) collects data from a number of primary and secondary sources, and publishes it in harmonized format. UNSD’s data coverage is vast and comprehensive, and includes economic, societal, demographic, and environmental data. Datasets from UNSD on Quandl are listed under publisher name UNDATA, and they all follow the code format UNDATA/{INDICATOR}_{COUNTRY}.

The UNDATA database is made up of 15 component databases, each covering a different subject area. For a list of all available databases and their Quandl codes, please refer to the UNDATA documentation page.

More Global Data

Quandl has data from a number of other international and regional organizations, listed below. Visit each organization’s documentation page to see its respective dataset nomenclature conventions on Quandl.

Organization

Description

Documentation

Food and Agriculture Organization

Data on farming, fisheries, livestock, agricultural infrastructure, hunger, environment and sustainability

FAO

International Labour Organization

Data on employment, wages, households and companies, sliced by age, gender, education, location

ILO

World Trade Organization

Comprehensive international trade statistics

WTO

International Telecommunications Union

Data on telecommunications and technology

ITU

World Health Organization

Data on health, disease, mortality and healthcare systems

WHO

Eurostat

Social and economic statistics for member nations of the European Union

EUROSTAT

Asian Development Bank

Social, financial and economic statistics for developing countries in Asia

ADB

Organization for Economic Cooperation and Development

Comprehensive economic and social statistics for developed nations

OECD

Country Statistics

In addition to cross-country statistics published by multi-national organizations, most countries in the world collect and publish their own domestic data. Single-country data is usually more “granular” than cross-country data (more frequent observations, more indicators surveyed) but cannot easily be compared or harmonized.

Single-country data is usually published by central banks and by national statistical agencies. Quandl has a number of both. Here are some of the central bank databases available on Quandl:

Country

Bank

Documentation

Comment

USA

St Louis Fed

FRED

Huge collection of US and international economic data

England

Bank of England

BOE

Includes excellent foreign exchange data collection

Germany

Bundesbank

BUNDESBANK

German and European time-series economic data

Brazil

Central Bank of Brazil

BCB

Brazilian and global data including commodites

France

Bank of France

BOF

Banking activities of French banks with non-residents

Japan

Bank of Japan

BOJ

Japanese macroeconomic data

China

People’s Bank of China

PBCHINA

Chinese macroeconomic data

Some of the above central banks — notably FRED, BCB, BOE and Bundesbank — publish a great deal of international data in addition to domestic indicators. Here is a full list of 25+ central bank databases available on Quandl and via the economic data API.

Here are some of the national statistical agency databases available on Quandl:

Country

Agency

Documentation

Canada

Statistics Canada

CANSIM

Brazil

Brazilian Institute of Geography and Statistics

IBGE

France

National Institute of Statistics France

INSEE

Australia

Australian Bureau of Statistics

AUSBS

UK

UK Office of National Statistics

UKONS

Spain

National Statistics Institute of Spain

NSIS

India

Ministry of Statistics India

MOSPI

China

National Bureau of Statistics China

STATCHINA

Here is a full list of 30+ statistical agencies available on Quandl and via the economic data API.

The United States government in particular publishes an enormous quantity of data via the Federal Reserve system and via various government agencies:

Agency

Documentation

Federal Reserve Bank

FED

FRED Economic Data

FRED

ALFRED Archival Data

ALFRED

FRB New York

FRBNY

FRB Kansas City

FRKC

FRB Philadelphia

FRBP

Bureau of Economic Analysis

BEA

Bureau of Labor Statistics

BLS

Census Bureau

USCENSUS

Department of Energy

DOE, EIA

Department of Agriculture

USDAERS, USDAFAS, USDANASS

Here is a full list of 20+ US bureaus and agencies whose data is available on Quandl.

Visit any of the “documentation” pages listed above, to see data coverage details and nomenclature rules for each publisher.

Research Agencies

A number of think tanks and research agencies publish specialized cross-country and multi-national statistics. Some of the best known are:

Organization

Documentation

Comment

Penn World Tables

PENN

GDP, income and prices

Luxembourg Income Study

LIS

Growth, income, poverty and equality

Groningen Growth Survey

GGDC

Growth since AD0 via Angus Maddison

Brinkhoff Population Data

CITYPOP

Population for 14,000 cities

Flaws in Free Data

Free data from international organizations suffers from a few limitations.

First, the data is by definition “secondary”; it is aggregated from a multitude of sources (individual central banks, statistical agencies, surveys, governments and so on). This almost always introduces transcription and translation errors. The very best aggregators (e.g. UNSD) have robust processes in place to minimze these errors, nonetheless many mistakes do persist.

Second, data obtained from international organizations has limited or no transparency to the original publisher. This makes it difficult to confirm numbers as well as methodology. Complete transparency is the best way to avoid data-pipeline errors, but this option is not always available.

Third, multinational aggregators collect and publish data annually at best. This is true even when their respective primary sources publish data monthly or quarterly. As a result, the aggregated data is often outdated or stale.

Fourth, despite the annual frequency limit, the “updating time” can be very slow. For example, the IMF’s flagship WEO survey for a given calendar year is only released in October of the following year. This may be too late for many time-sensitive or predictive applications.

Fifth, the quality of documentation for public data sources varies hugely. Some publishers provide excellent documentation; many others do not.

Premium Data

In order to avoid the limitations detailed above, we now provide a professional grade economic database to our users. The Standard Global Economics (SGE) database collects 7000+ harmonized macroeconomic indicators for over 200 countries, going back up to 100 years.The data is collected from 1000+ sources, including central banks, statistical agencies, and research institutions.

The datasets in this premium economic database are collected directly from their primary publishers, with complete transparency to source. The data is as granular as possible, with monthly observations in most cases, and quarterly when monthly is not available. The data is updated immediately after the publisher updates, based on a pre-defined economic calendar. The data is comprehensive, perfectly organized and documented, and goes back decades.

Each dataset in the SGE database has a Quandl code of the format SGE/{ISO}{INDICATOR}, where ISO is a 3-letter country code and `{INDICATOR} is a harmonized indicator code. The indicators include GDP, population, inlation, unemployment, government budget, and many other macroeconomic indicators.

To see a list of all available indicators, country ISO codes, and Quandl code examples, please visit the SGE documentation page.

If you’re interested in subscribing to this premium economic database on Quandl, please visit this page.

 

Get Started Now!

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

In case of any questions, comments or suggestions, please don’t hesitate to email us.

Fix This
Created with Sketch.