Get data (validated, with provenance)
get_dataRetrieve validated macroeconomic time series from global sources, with provenance and cross-validation to compare data across institutions.
Instructions
Retrieve a time series in the canonical model, with validation and provenance.
Three ways to ask (use one):
1. Concept: indicator + country (+ source, cycle), e.g. indicator="CPI_YOY", country="US".
Korea uses ECOS first; other economies OECD, IMF and BIS. If a source has no data, the next one is tried.
2. ECOS table (Korea): stat_code (+ cycle, item_code1..4)
3. SDMX dataflow: source (OECD | IMF | BIS) + dataflow + key + cycle
* validation: country, frequency, unit (and index base), scale, period, missing, duplicate and revision checks (pass/info/warn/fail)
* cross_validate=True: fetch the concept from every source and compare period by period;
the result is MATCH, DIFFER (documented cause) or UNRESOLVED (unexplained difference)
* dates: "2024", "2024-03", "2024Q1", "2024-03-15" are converted; default window 3 months for daily data, else 2 years
* transform: "yoy" / "pop" % change — value becomes the change and the level is kept
* rebase_period: rebase an index to that period = 100 (e.g. "2020")
Args:
indicator: concept id or name (see search_statistics(scope="concepts"))
country: economy, ISO code or EA (required with indicator; with a direct SDMX query it enables the country check)
source: ECOS | OECD | IMF | BIS
stat_code: ECOS table code
cycle: frequency A/S/Q/M/SM/D
item_code1..4: ECOS item codes
dataflow: SDMX dataflow (e.g. "OECD.SDD.STES:DSD_STES@DF_FINMARK(4.0)")
key: SDMX series key (e.g. "USA.M.IRLT.PA._Z._Z._Z._Z.N")
start_date: start period
end_date: end period
recent_years: window when dates are omitted
transform: "yoy" | "pop" | "none"
changes_only: only periods where the value changed (default for policy rates)
rebase_period: index rebase period
unit_mult: rescale values to 10^unit_mult (e.g. 12 turns a billions (9) series into trillions)
cross_validate: include cross-validation across institutions
output_format: "compact" | "csv" | "json" | "sdmx"
prefer_latest: when ECOS results are truncated, keep the latest periods
start_count: ECOS first row
end_count: ECOS last row
language: "kr" | "en" (ECOS names)
Returns:
series (periods and values), provenance (source and citation), validation, and optionally cross_validation
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | ||
| cycle | No | ||
| source | No | ||
| country | No | ||
| dataflow | No | ||
| end_date | No | ||
| language | No | kr | |
| end_count | No | ||
| indicator | No | ||
| stat_code | No | ||
| transform | No | ||
| unit_mult | No | ||
| item_code1 | No | ||
| item_code2 | No | ||
| item_code3 | No | ||
| item_code4 | No | ||
| start_date | No | ||
| start_count | No | ||
| changes_only | No | ||
| recent_years | No | ||
| output_format | No | compact | |
| prefer_latest | No | ||
| rebase_period | No | ||
| cross_validate | No |