Skip to content

eagle-io/open-exchange-rate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

open-exchange-rate

This module is used to get the latest currency exchange rates from the open exchange rates public api.

Getting Started

Install the module using the following command.

npm i open-exchange-rate

Example

Below given is the example to use this package.

Note : USD is the base currency.

const oxr = require('open-exchange-rate');

oxr.set({ app_id: 'APP_ID_HERE' });

let currencies = ["CAD", "EUR"];

oxr.getExchangeRate(currencies).then(({rates}) => {
    console.log(rates); // { CAD: 1.342507, EUR: 0.896797}
})
.catch(err => {
    console.log('Error :: ',err);
});

Also please refer example.js file for an example.

Replace the APP_ID_HERE with your APP_ID or say API_KEY.

Use the below command to run the example.

node example.js

Documentation

For further reference and for list of currencies, please refer the documentation.

Authors

  • Vishweswaran P - Initial work - Github

License

This project is licensed under the ISC License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%