The IMF provides datasets on global economic indicators, including GDP growth, inflation rates, exchange rates, fiscal balances and international trade.
The `imf-data` Python library and `requests` against the IMF Data API (dataservices.imf.org) provide access to WEO, IFS, and DOTS datasets. Engineers use ISO-2 country codes with indicator codes to retrieve long time-series of GDP, inflation, and current account data.
IMF data is the gold standard for AI macroeconomic analysis tools. Expose the IMF API as an MCP server so LLM agents can retrieve current GDP forecasts, or build RAG systems on IMF Article IV consultation reports so AI economic advisors can answer questions with official IMF assessments.
# pip install requests pandas
import requests, pandas as pd
resp = requests.get(
"https://www.imf.org/external/datamapper/api/v1/NGDP_RPCH/USA/CHN/DEU/JPN"
)
data = resp.json()["values"]["NGDP_RPCH"]
df = pd.DataFrame(data).T
df.index.name = "year"
print("GDP growth rates (%):")
print(df.tail(5))Official dataset source
More datasets used by Python data engineers.
FiveThirtyEight publishes the datasets behind its data journalism articles covering US politics, sports analytics, economics, and culture. Available on GitHub as clean, analysis-ready CSV files, making them ideal for practising data loading, statistical analysis pipelines, and exploratory data workflows in Python.
The Global Findex Database offers datasets on financial inclusion indicators, access to banking, usage of financial services, savings behavior and mobile money adoption worldwide.
UNCTAD provides datasets on trade, investment, development, globalization, economic indicators and other aspects of international trade and development.