fetch_data
Fetch macro statistics, FX rates, or company data by specifying provider, flow, and dimension key. Get observations with labels, units, and period coverage.
Instructions
Fetch observations. key maps dimension ids to codes, e.g. {"FREQ": "M", "CURRENCY": "USD"}.
A dimension takes several codes joined by +, so {"REF_AREA": "JP+XM"} asks
for both in one request rather than two. A dimension left out of the key
matches every code, which is how to ask which countries a flow covers:
fetch it with only FREQ pinned and read the series keys.
Returns the invariant part of the key once under "key", and observations as
[period, value] pairs grouped into "series" by whichever dimensions vary.
"names" gives the label for every code in the response, so a series keyed
XDC or CP01 can be read without asking search_codes again.
"units" says what the numbers are measured in, including any multiplier:
read it before comparing or converting. "range" is the period span actually
returned; periods with no value are omitted and counted under "empty".
"total" counts what the provider sent, which is the whole series unless
"truncated" says it is a floor: only the newest observations are fetched,
so a longer history exists and was not counted. Narrow start/end to read
it.
An empty response echoes the key it was given and says so under "note".
Any single entry in the key can empty a result and they all look alike, so
drop a dimension to find which one.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ||
| key | Yes | ||
| flow | Yes | ||
| limit | No | ||
| start | No | ||
| provider | Yes |