Exchange rate of one currency pair
getRateReturns the rate of one pair as a single number: how many units of to one unit of from buys, and the inverse. Latest at your plan's update interval by default, the close of a past date, or the rate at a datetime within your plan's intraday history (the minute, quarter hour or hour it falls in, as /v1/range reports it: minutes for the last 7 days, hours for the last 3 months). datetime needs a plan with intraday updates.
format=text answers with the bare number, so spreadsheets can read it directly, e.g. Google Sheets =IMPORTDATA("https://api.fxapi.com/v1/rate?from=EUR&to=USD&format=text&apikey=YOUR-API-KEY") or Excel =WEBSERVICE(...).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | The currency to convert to. | |
| date | No | The close of this past day (format `YYYY-MM-DD`). Not together with `datetime`. | |
| from | Yes | The currency to convert from. | |
| format | No | `json` (default), `csv` (`from,to,rate,inverse,last_updated_at`), `xlsx` (the same table as an Excel workbook, `rate.xlsx`) or `text` (only the rate, as plain text without exponent notation). | |
| datetime | No | A moment within your plan's intraday history (ISO 8601). A moment not stored yet gets the newest rate. | |
| precision | No | Round every value to this many decimals (0 to 10). By default values carry up to 10 decimals (10 significant digits below 0.1). |