OANDA
OANDA's own currency converter: live and historical (back to ~1990) exchange rates between any two of its 371+ supported currencies, metals and crypto.
Domain: oanda.com
Also known as: OANDA, OANDA Corporation
Call it directly
bowmark.providers.oanda.convertCurrency(amount: number, from: string, to: string, date?: string): Promise<OandaConversion>Functions
| Function | What it does |
|---|---|
convertCurrency | Converts amount from one currency to another the way oanda.com/currency-converter/en/ does, using OANDA's own daily average bid rate. |
Types
interface OandaConversion {
amount: number;
from: string;
to: string;
rate: number;
convertedAmount: number;
asOf: string;
}Examples
const usd = await bowmark.providers.oanda.convertCurrency(100, "USD", "EUR");
log(`$100 = €${usd.convertedAmount.toFixed(2)} (rate ${usd.rate}, as of ${usd.asOf})`);// names work too, and so does a past date
const then = await bowmark.providers.oanda.convertCurrency(1, "Gold (oz.)", "US Dollar", "1998-01-02");
log(`1oz gold on ${then.asOf}: $${then.convertedAmount}`);