Get exchange rate
Return how many units of the target currency one unit of the source currency buys.
Command in the Currency toolkit · id ooa.currency/get_rate · 7 inputs (2 required), 2 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| From currency | String | Yes | Currency you have. | |
| To currency | String | Yes | Currency you want. | |
| Source | String | No | ecb | ecb: European Central Bank daily reference rates (base EUR). json: a JSON rates service at 'url'. fixed: the 'rates' Dictionary. |
| Address (URL) | String | No | For json: the address returning the rates. For ecb: leave empty to use the ECB's public file. | |
| Rates path | String | No | For json: where the rates object sits in the answer, e.g. rates, $.data.rates or results[0].rates. Empty = the whole answer. | |
| Base currency | String | No | Currency the rates are quoted against (rate 1). ecb: always EUR. json: taken from the answer's 'base' field when empty. fixed: required. | |
| Rates | Dictionary | No | For fixed: currency code to rate against the base, e.g. {"USD": 1.08, "GBP": 0.85}. |
Outputs
| Output | Type | What it is |
|---|---|---|
| rate | Number | Exchange rate. |
| rate_date | String | Date of the rates when the source gives one, otherwise empty. |