Get historical rate time-series
get_historical_ratesFetch historical exchange rate time-series for a currency pair across 1d, 7d, 30d, or 1y windows ending now. Use it to chart or analyze past pair movement.
Instructions
Use this for fixed-window time-series questions like 'how has EUR/USD moved this week', 'show me the last month of GBP/JPY', or 'chart 1-year history of AUD/USD'. Returns { source, target, period, data: [{ date, rate, timestamp }, ...] } — sampling is fixed per period (1d=hourly, 7d/30d=daily, 1y=weekly) and the window always ends NOW. Needs an API key on a paid plan; free and trial keys get a 403. For a specific past datetime use get_rates_authenticated with time. For a single live rate use get_exchange_rate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | Lookback window ending NOW. '1d' returns ~24 hourly points, '7d' returns 7 daily points, '30d' returns 30 daily points, '1y' returns ~52 weekly points. Defaults to '7d' if omitted. | 7d |
| source | Yes | ISO 4217 currency code, 3 letters, case-insensitive (e.g. 'USD', 'EUR', 'GBP', 'JPY'). For a source/target pair, the returned rate is how much 1 unit of source is worth in target. Fiat only — no crypto, no commodities. Call list_currencies if unsure whether a code is supported. | |
| target | Yes | ISO 4217 currency code, 3 letters, case-insensitive (e.g. 'USD', 'EUR', 'GBP', 'JPY'). For a source/target pair, the returned rate is how much 1 unit of source is worth in target. Fiat only — no crypto, no commodities. Call list_currencies if unsure whether a code is supported. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| period | Yes | ||
| source | Yes | ||
| target | Yes | ||
| source_api | No | Upstream data provider |