@miekassu/js-bkkbank
v1.0.2
Published
Bangkok Bank API module for nodejs
Readme
Bangkok Bank API
Simplifyied Node.js client for the Bangkok Bank API Exchange Rate Service.
Client is designed to return Promises.
Install
npm install --save @miekassu/js-bkkbankUsage
Ocp-Apim-Subscription-Key is needed. You can find one from your Profile.
To pass needed key to client, please use BKK_BANK_SUBSKEY ENV variable.
Service API
- getAvailableRates
- getHistoricalRates
- getLatestRates
getAvailableRates()
@returns - A promise with the list of currency available from Bankgkok Bank.
getHistoricalRates(date)
@params date - Date string in form: YYYY-MM-DD 2019-10-20
@returns - A promise with the rates at the requested date from Bankgkok Bank.
Example:
getHistoricalRates('2019-10-25')
.then(resp =>{
console.log(resp)
})getLatestRates()
@returns - A promise with the rates at the requested date from available from Bankgkok Bank.
Example:
getLatestRates()
.then(resp =>{
console.log(resp)
})