Description
Exchange rates client for the excellent Exchange Rates API. The API provides current and historical foreign exchange rates published by the European Central Bank.
exrates alternatives and similar packages
Based on the "Financial" category.
Alternatively, view exrates alternatives based on common mentions on social networks and blogs.
-
Golang Crypto Trading Bot
A golang implementation of a console-based trading bot for cryptocurrency exchanges -
ach
ACH implements a reader, writer, and validator for Automated Clearing House (ACH) files. The HTTP server is available in a Docker image and the Go package is available. -
sleet
DISCONTINUED. Payment abstraction library - one interface for multiple payment processors ( inspired by Ruby's ActiveMerchant ) -
https://github.com/alpeb/go-finance
Go library containing a collection of financial functions for time value of money (annuities), cash flow, interest rate conversions, bonds and depreciation calculations. -
go-finnhub
DISCONTINUED. Client for stock market, forex and crypto data from finnhub.io. Access real-time financial market data from 60+ stock exchanges, 10 forex brokers, and 15+ crypto exchanges.
SaaSHub - Software Alternatives and Reviews
Do you think we are missing an alternative of exrates or a related project?
README
exrates
Exchange rates client for the excellent Exchange Rates API. The API provides current and historical foreign exchange rates published by the European Central Bank.
Installation
go get github.com/adrg/exrates
Usage
Latest exchange rates
// Get all available exchange rates.
rates, err := exrates.Latest("USD", nil)
if err != nil {
// Treat error.
return
}
// Get specific exchange rates.
// rates, err := exrates.Latest("EUR", []string{"USD", "CAD"})
fmt.Printf("Exchange rates for %s on %s\n", rates.Base, rates.Date)
for currency, value := range rates.Values {
fmt.Printf("%s: %f\n", currency, value)
}
Exchange rates on specific date
date := time.Date(2019, 3, 8, 0, 0, 0, 0, time.UTC)
// Get all available exchange rates.
rates, err := exrates.On("USD", date, nil)
if err != nil {
// Treat error.
return
}
// Get specific exchange rates.
// rates, err := exrates.On("EUR", date, []string{"USD", "CAD"})
fmt.Printf("Exchange rates for %s on %s\n", rates.Base, rates.Date)
for currency, value := range rates.Values {
fmt.Printf("%s: %f\n", currency, value)
}
Exchange rates in date interval
start := time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC)
end := time.Date(2019, 4, 22, 0, 0, 0, 0, time.UTC)
// Get all available exchange rates.
days, err := exrates.Between("USD", start, end, nil)
if err != nil {
// Treat error.
return
}
// Get specific exchange rates.
// days, err := exrates.Between("EUR", start, end, []string{"USD", "CAD"})
for _, day := range days {
fmt.Printf("Exchange rates for %s on %s\n", day.Base, day.Date)
for currency, value := range day.Values {
fmt.Printf("%s: %f\n", currency, value)
}
}
Supported currencies
EUR - Euro
USD - US dollar
JPY - Japanese yen
BGN - Bulgarian lev
CZK - Czech koruna
DKK - Danish krone
GBP - Pound sterling
HUF - Hungarian forint
PLN - Polish zloty
RON - Romanian leu
SEK - Swedish krona
CHF - Swiss franc
ISK - Icelandic krona
NOK - Norwegian krone
HRK - Croatian kuna
RUB - Russian rouble
TRY - Turkish lira
AUD - Australian dollar
BRL - Brazilian real
CAD - Canadian dollar
CNY - Chinese yuan renminbi
HKD - Hong Kong dollar
IDR - Indonesian rupiah
ILS - Israeli shekel
INR - Indian rupee
KRW - South Korean won
MXN - Mexican peso
MYR - Malaysian ringgit
NZD - New Zealand dollar
PHP - Philippine peso
SGD - Singapore dollar
THB - Thai baht
ZAR - South African rand
Contributing
Contributions in the form of pull requests, issues or just general feedback,
are always welcome.
Before making a contribution please read CONTRIBUTING.md.
References
For more information see the Exchange Rates API.
License
Copyright (c) 2019 Adrian-George Bostan.
This project is licensed under the MIT license.
See LICENSE for more details.
*Note that all licence references and agreements mentioned in the exrates README section above
are relevant to that project's source code only.