https://github.com/ivanglie/go-br-client
Golang client for exchange rate of cash currency in Russia
https://github.com/ivanglie/go-br-client
cash currency finance golang
Last synced: 6 months ago
JSON representation
Golang client for exchange rate of cash currency in Russia
- Host: GitHub
- URL: https://github.com/ivanglie/go-br-client
- Owner: ivanglie
- License: mit
- Created: 2023-01-24T07:58:11.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T10:28:29.000Z (about 2 years ago)
- Last Synced: 2024-06-20T12:03:24.121Z (over 1 year ago)
- Topics: cash, currency, finance, golang
- Language: Go
- Homepage:
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golang client for exchange rate of cash currency in Russia
[](https://pkg.go.dev/github.com/ivanglie/go-br-client)
[](https://github.com/ivanglie/go-br-client/actions/workflows/test.yml)
[](https://codecov.io/gh/ivanglie/go-br-client)Golang client that provides latest exchange rate of USDRUB cash in largest cities of Russia.
## Example
First, ensure the library is installed and up to date by running
```
go get -u github.com/ivanglie/go-br-client
```This is a very simple app that just displays USDRUB exhange rate in Novosibirsk.
```golang
package mainimport (
"fmt"br "github.com/ivanglie/go-br-client"
)func main() {
client := br.NewClient()
rates, err := client.Rates(br.Novosibirsk)
if err != nil {
panic(err)
}
fmt.Println(rates)
}
```Console output:
```json
{
"currency": "USD",
"city": "novosibirsk",
"branches": [
{
"bank": "ОП № 029/0000 Филиала \"Газпромбанк\" АО",
"subway": "Заельцовская, Гагаринская, Сибирская",
"currency": "USD",
"buy": 87.1,
"sell": 91.3,
"updated": "2023-07-03T13:00:00+03:00"
},
{
"bank": "ДО № 029/1007 Филиала \"Газпромбанк\" АО",
"subway": "Заельцовская, Берёзовая роща, Гагаринская",
"currency": "USD",
"buy": 87.1,
"sell": 91.3,
"updated": "2023-07-03T13:00:00+03:00"
},
{
"bank": "ДО № 029/1003 Филиала \"Газпромбанк\" АО",
"subway": "Берёзовая роща, Маршала Покрышкина, Золотая Нива",
"currency": "USD",
"buy": 87.1,
"sell": 91.3,
"updated": "2023-07-03T13:00:00+03:00"
}
]
}
```
See [main.go](./_example/main.go).## References
For more information check out the following links:
* Cash currency exchange rates by [Banki.ru](https://www.banki.ru/products/currency/map/moskva/) (RU)