import requests
base = "https://dataservices.imf.org/REST/SDMX_JSON.svc"
# IFS dataset — CPI for United States
url = f"{base}/CompactData/IFS/Q.US.PCPI_IX"
r = requests.get(url)
series = r.json()["CompactData"]["DataSet"]["Series"]
obs = series.get("Obs", [])
for o in obs[-5:]:
print(o["@TIME_PERIOD"], o["@OBS_VALUE"]) Cost
Free
Access type
limited
Signup required
Yes
Update alerts
Not offered
Coverage
global
Update frequency
yearly
Source Documentation
What You're Getting
IMF Data covers World Economic Outlook (WEO) projections, Balance of Payments, International Financial Statistics (IFS), Direction of Trade Statistics (DOTS), and more. The Data API uses a SDMX-JSON format. Key datasets: WEO (annual projections + actuals for 190+ countries), IFS (monthly financial indicators), DOTS (bilateral trade flows). Identifiers follow SDMX conventions: dataflow + key (country + indicator codes).
Ingestion Strategy
Use the SDMX REST API at dataservices.imf.org/REST/sdmx/2.1. No auth required. For WEO: the bulk CSV download (available on imf.org) is the simplest approach — download the WEO release zip twice yearly (April and October). For IFS and DOTS, use the API with specific dataflow IDs. Expect XML or JSON responses; JSON is easier to parse.
import requests
# Fetch IFS monthly data for US, Canada — exchange rate series
url = "https://dataservices.imf.org/REST/sdmx/2.1/data/IFS/M.US+CA.ENDA_XDC_USD_RATE"
r = requests.get(url, params={"startPeriod": "2020-01", "format": "jsondata"})
data = r.json()["data"]["dataSets"][0]["series"]
Rate Limits & API Details
- No authentication; soft rate limit around 10 req/min — back off if 429s appear
- WEO bulk download: imf.org/en/Publications/WEO (Excel/CSV, ~10MB)
- SDMX API:
dataservices.imf.org/REST/sdmx/2.1 - Dataflow list endpoint:
/dataflow/IMF/all/latestto discover available datasets
Schema Stability
SDMX dataflow codes are stable between releases. Country codes follow ISO + IMF additions. WEO vintage comparisons require downloading both April and October releases — do not assume the previous year's estimate is final. IFS series codes occasionally deprecated; monitor the release notes.
Data Quality Gotchas
- WEO projections mixed with actuals: the dataset contains both historical actuals and forward projections in the same rows — use the
WEO Estimates Start Aftercolumn to separate them - Currency and scale: IFS indicators come in local currency or USD; check
UNITandSCALEmetadata - Country aggregates: IMF includes regional groups (Advanced Economies, EMDE) — filter by IMF country code length (3-char = country)
- April vs October releases differ: store the release date as a partition key
Tool Compatibility
- Python:
imf-datatoolsorimfpy(lightweight wrappers) - R:
imfrpackage - Direct SDMX parsers:
pandasdmx(Python) handles the response format well - Bulk CSV/Excel works for dbt seeds
Benchmarking Approach
WEO release: expect ~8,500 rows per release (190 countries × ~45 variables). Spot-check US GDP growth rate for current year against IMF press release. IFS exchange rates: verify ENDA_XDC_USD_RATE for EUR matches ECB published rate within 0.01%. Alert if row count deviates >3% from prior release.
Notable Datasets
1 total- ▸ Asia and Pacific Regional Economic Outlook (APDREO)\nBalance of Payments (BOP)\nBalance of Payments (BOP), World and Regional Aggregates\nCommodity Terms of Trade\nConsumer Price Index (CPI)\n100+ Data Sets
Access
- Cost
- Free
- Access type
- Limited
- Update alerts
- Not offered
Data Profile
- Coverage
- Global
- Frequency
- Yearly / Annual
- History from
- 1945
- Source updated
- Jan 2024
Data Formats
How to Access
- 🌐 Browser/UI
- ⚡ Automation Ready programmable
- 📦 Bulk Export
Index entry
Added: Apr 30, 2026
Last indexed: May 2, 2026
~ Community-sourced entry