1.1.0 • Published 1 year ago
primabankapi v1.1.0
Slovakia’s Prima banka API
Unofficial API for Prima banka’s currency rate sell/buy list
Source code: https://github.com/Kukyn/primabankapi
Install
npm install primabankapi
Usage
const api = require("primabankapi");
All functions returns promise that needs to be resolved
Commands
Calling function without parameter
roundAt
returns response with five decimal placesMaximum decial places that site is providing is 5
For parameter
currency
choose one from list of supported currencies
.getSellRate(currency: string, ?roundAt: int)
Returns sell rate of given currency for today
var response = await api.getSellRate("CZK")
console.log(response) //ex. output 24.98400
.getBuyRate(currency: string, ?roundAt: int)
Returns buy rate of given currency for today
var response = await api.getBuyRate("CZK")
console.log(response) //ex. output 25.12400
.getMiddleRate(currency: string, ?roundAt: int)
Returns middle rate of given currency for today
var response = await api.getMiddleRate("CZK")
console.log(response) //ex. output 24.34400
Supported currencies
- USD - US Dollar
- CZK - Czech Koruna
- GBP - British Pound
- HUF - Hungarian Forint
- PLN - Polish Zloty
- CHF - Swiss Franc