Average, low and high rates per month, quarter or year
getAverageAverages the daily rates per calendar period (month, quarter, year, or total for the whole span) and reports each period's low and high. Daily rates are first expressed against base_currency and then averaged, so the average EUR rate in GBP is the mean of the daily EUR/GBP rates. Average rates are what IFRS and US GAAP allow for translating income and expenses.
date_from and date_to may be at most 1830 days apart. The first and last period are cut to the requested span; date_from, date_to and days of each period tell exactly which days went into it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Filter the returned currencies by type. | |
| format | No | `json` (default) or `csv`. CSV has a header line and one row per currency (and point in time), values without exponent notation. | |
| period | No | How to group the days. | |
| date_to | Yes | Last day (`YYYY-MM-DD`), yesterday at the latest. | |
| date_from | Yes | First day (`YYYY-MM-DD`), 1999-01-01 or later. | |
| currencies | No | Comma-separated list of currency codes to include (e.g. `EUR,USD,CAD`). The array form `currencies[]=EUR¤cies[]=USD` is also accepted. By default all supported currencies are returned. | |
| base_currency | No | The base currency that all returned values are relative to. Defaults to `USD`. |