Currency rate history
cb_rate_historyFetch official CBI exchange rate history for one currency over a date range, including total change, to analyze trends and compare past rates.
Instructions
Get the official CBI rate of one currency over time, oldest first, with the total change.
Without dates it returns the last 7 published days (one fast call). With from_date it samples the archive every step_days up to to_date (default: today), at most 20 points ending at to_date, so use step_days 7 for months or 30 for years. Days without a published rate are skipped. Rates are rials per currency unit; see per_units in cb_exchange_rates. Use cb_exchange_rates to see every currency on one day.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to_date | No | Date as 1404/01/01 (Jalali, year below 1700) or 2025-03-21 (Gregorian). Default: latest. | |
| currency | Yes | ISO code, e.g. USD, EUR, AED, TRY. | |
| from_date | No | Date as 1404/01/01 (Jalali, year below 1700) or 2025-03-21 (Gregorian). Default: latest. | |
| step_days | No | Days between points when from_date is given (1-90). |