Updated: February 2026
Contact: Brian Dew, bd-econ.com; email: brian.w.dew@gmail.com
Examples of retrieving economic data from public APIs using Python. Each notebook demonstrates the request, data cleaning, and visualization workflow using requests and pandas.
An API key is required for some sources (stored locally in config.py).
U.S. Government
-
Bureau of Economic Analysis (BEA): National accounts — consumer spending, GDP by industry, gross output. nbviewer
-
Bureau of Labor Statistics (BLS): Unemployment rates by race/ethnicity. nbviewer. See also: prices.
-
Census Bureau — ACS: American Community Survey — county income choropleth and state work-from-home rates (2023). nbviewer
-
Census Bureau — M3: Manufacturers' new orders for nondefense capital goods. nbviewer
-
Census Bureau — Trade: U.S. exports by partner country. nbviewer
-
Energy Information Administration (EIA): U.S. crude oil production by region. nbviewer
-
FRED: Federal Reserve Bank of St. Louis — average hourly earnings by industry. nbviewer
-
Treasury: Federal revenue by type from the Monthly Treasury Statement. nbviewer
International
-
European Central Bank (ECB): Government bond yields, exchange rates, and unemployment for Eurozone countries. nbviewer
-
International Labour Organization (ILO): Unemployment rate by sex and age for Canada and G7 countries. nbviewer
-
International Monetary Fund (IMF): CPI inflation and trade data via the SDMX API (uses
sdmx1library). nbviewer -
Organization for Economic Cooperation and Development (OECD): Guide to the SDMX REST API — labor productivity and health spending vs. life expectancy. nbviewer.
-
UN ComTrade: Bilateral trade data by product — US exports/imports and a semiconductor trade network graph using HS 6-digit codes (public preview API, no key required). nbviewer
-
World Bank: Foreign direct investment for Brazil and Chile. nbviewer
Other