Skip to content

zardan4/currencybeacon-sdk-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

currencybeacon-sdk-go

sdk for fetching https://currencybeacon.com/

How to install?

go get github.com/zardan4/currencybeacon-sdk-go

import "github.com/zardan4/currencybeacon-sdk-go/client"

USE!

Methods

Check valid api key

client.CheckValidAPIKey()
// returns bool

Get all currencies

client.GetAllCurrencies()
// returns map[string]responses.Currency

Get one currency

client.GetCurrency("UAH")
// arg1: code of currency to return info about. more: https://currencybeacon.com/supported-currencies
// returns responses.Currency

Get exchange rate by date

client.GetExchangeRateByDate("UAH", []string{"EUR", "USD"}, "2008-12-07")
// arg1: code of currency to be as convertation base
// arg2: slice of currencies' codes to convert in. if you want all just leave empty slice
// arg3: date in format YYYY-MM-DD
// returns responses.ExchangeRateResponse

Get current exchange rate

client.GetExchangeRate("UAH", []string{"EUR", "USD"})
// arg1: code of currency to be as convertation base
// arg2: slice of currencies' codes to convert in. if you want all just leave empty slice
// returns responses.ExchangeRateResponse

Convert currencies

client.Convert("UAH", "USD", 20)
// arg1: code of currency to convert from
// arg2: currency to convert in
// arg3: amount of {arg1} to convert in {arg2}
// returns responses.ConvertResponse

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages