1.2.0 • Published 6 years ago

swea-exchange-rate v1.2.0

Weekly downloads
14
License
ISC
Repository
-
Last release
6 years ago

Description

This module will return the exchange rate between a currency and SEK (Swedish Kronor) or the other way around, from SEK to a currency, using the 'Sveriges Riksbanks API'.

Install

Install with npm:

npm install swea-exchange-rate

How to use

In this example the cross rate between EUR (€ Euro) and SEK (Svenska kronor) is returned.

var exchangeRates = require('swea-exchange-rate');
exchangeRates.getExchangeRate( 'EUR', 'SEK', '2016-02-29', ( err, exchangeRate ) => {

  if (err) {
    // TODO: Handle error
  }
  
  console.log( `Rate: ${exchangeRate.value}`);
});
  

The response of the result in the callback method will be something like:

 {
   description: '1 EUR = ? SEK',
   date: '2016-02-29',
   value: '9.3936'
 }

If the specified date is a bank holiday, sunday or saturday, then no exchange rate will be available and in that case the most recent date with an exchange rate will be returned.

More information

This module will call Sveriges Riksbanks API using the SOAP protocol.

The seriesId that's being used are from this list (under "Valutakurser"): http://www.riksbank.se/sv/Rantor-och-valutakurser/serier-for-webbservices/

1.2.0

6 years ago

1.1.0

6 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago