1.0.2 • Published 6 years ago

fixer-io-node v1.0.2

Weekly downloads
13
License
ISC
Repository
github
Last release
6 years ago

fixer-io-node

Description

A node module that interacts with the fixer.io API (http://api.fixer.io). The API requires a query string to be added and they are added to the functions when they are called.

How to Install

npm install fixer-io-node --save

How to Use

var api = require('fixer-io-node');

# latest
The function returns the latest currency exchange rates with EURO as its base currency

api.latest('latest').then(function(result){
    console.log(result)
}).catch(function(error){
    console.log(error)
})

# base
The function returns the latest currency rates passing USD as its base currency. Other currencies like GBP, AUD, EUR, BGN etc
can be used

api.base('USD').then(function(result){
    console.log(result)
}).catch(function(error){
    console.log(error)
})

# historical
The function gets historical rates for any day since 1999

api.historical('2005-05-10').then(function(result){
    console.log(result)
}).catch(function(error){
    console.log(error)
})

N.B: Date format: YYYY-MM-DD

# specificRate
Returns specific exchange rates

api.specificRate('USD', 'GBP').then(function(result){
    console.log(result)
}).catch(function(error){
    console.log(error)
})