Golang sdk for https://exchangerate-api.com
In order to use this package, you need to first head over to https://www.exchangerate-api.com to create an account to get your API Key
.
See the Exchange Rates API Docs
This package can be installed using the go command below.
go get github.com/iqquee/exchangerateapi@latest
# assume the following codes in example.go file
$ touch example.go
# open the just created example.go file in the text editor of your choice
- Standard()
- PairConversion()
- EnrichedData()
- HistoricalDataBasicFormat()
- HistoricalDataSpecificFormat()
"github.com/iqquee/exchangerateapi"
Our Standard API endpoint is the easiest and fastest way to access our exchange rate data.
apiKey := ""
client := exchangerateapi.New(*http.DefaultClient, apiKey)
sd, err := client.Standard("USD")
if err != nil {
fmt.Println("Error => ", err)
}
fmt.Println("Response ::: ", sd)
Our Pair Conversion API endpoint is useful for applications where you just want to convert between two specific currencies and aren't interested in any others.
apiKey := ""
client := exchangerateapi.New(*http.DefaultClient, apiKey)
pr, err := client.PairConversion("NGN", "USD")
if err != nil {
fmt.Println("Error => ", err)
}
fmt.Println("Response ::: ", pr)