Exchange rates
A bank statement shows what a purchase cost in kroner; the receipt in the
mail says 20.00 USD or € 49,00. currency_rate gives a bot Norges Bank's
exchange rate for the day, so it can tell whether an amount is in kroner or
the foreign currency, and match the receipt with the line on the statement.
Norges Bank, USD on 2026-05-13 (the last business day on or before 2026-05-14): 1 USD = 9.1690 NOK. 20.00 USD = 183.38 NOK.
| Argument | What |
|---|---|
currency |
the ISO code: USD, EUR, SEK, GBP, … |
date |
YYYY-MM-DD; today when left out |
amount |
an amount in that currency to convert |
- The rates are Norges Bank's daily rates (the same accounting systems use). A day without one, a weekend or a holiday, gets the last business day before it, and the answer says so.
- A rate Norges Bank gives per 100 (SEK, DKK, JPY) is given per one.
- Banks add 1–2.5 % to the rate when a card is used abroad, so the statement's kroner are a little above what the rate gives. The tool says so to the bot.
- Only the currency and the days are sent to
data.norges-bank.no; it is open and needs no key. A rate never changes once given, so it is kept on the Mac and asked for once. Today's is not kept, as it may not be out yet. - In every plan. It is a read: it waits for no one, and works in rehearsal.
HUSKARL_NORGES_BANK_API points it elsewhere (see
configuration).