@asefux/exchange-rates

aggregates currency exchange rates from multiple central banks

Usage no npm install needed!

<script type="module">
  import asefuxExchangeRates from 'https://cdn.skypack.dev/@asefux/exchange-rates';
</script>

README

@asefux/exchange-rates

gather exchange-rates from muiltiplie national banks

Usage

const ExchangeRates = require('@asefux/exchange-rates');

const exchangeRates = ExchangeRates();

exchangeRates.matrix()
.then((ratesMatrix)=>{
        console.log(JSON.stringify(ratesMatrix, null, 2));
});

exchangeRates.rate(10, 'eur', 'usd').then(console.log); // will output how much USD is 10 EUR



Rates matrix of this format


{
        [base]: {
                [quote]: price
        }
}
// how much quote would you get for 1 unit of base

Sources


Changes

Version Changes
1.0.0 initial code
1.0.1 update api
1.1.0 Bank of Bulgaria
1.1.1 on weekends get rates of last working day