/go-cbr-client

Golang client for CBRF currency rates API

Primary LanguageGoMIT LicenseMIT

Golang client for the Central Bank of the Russian Federation currency rates API

Go Reference Test Codecov

go-cbr-client is a fork of matperez's client for CBRF API.

Example

First, ensure the library is installed and up to date by running

go get -u github.com/ivanglie/go-cbr-client

This is a very simple app that just displays exhange rate of US dollar.

package main

import (
	"fmt"
	"time"

	cbr "github.com/ivanglie/go-cbr-client"
)

func main() {
	client := cbr.NewClient()
	rate, err := client.GetRate("USD", time.Now())
	if err != nil {
		panic(err)
	}
	fmt.Println(rate)
}

Console output:

76.8207

See main.go.

References

For more information check out the following links: