https://github.com/testdouble/go-forex-quotes
Go package to obtain forex quotes for currency
https://github.com/testdouble/go-forex-quotes
Last synced: about 2 months ago
JSON representation
Go package to obtain forex quotes for currency
- Host: GitHub
- URL: https://github.com/testdouble/go-forex-quotes
- Owner: testdouble
- Created: 2022-04-06T16:30:38.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T16:30:19.000Z (over 2 years ago)
- Last Synced: 2024-06-20T19:23:51.515Z (almost 2 years ago)
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Forex Quotes
Go library for fetching realtime forex quotes
### Install
```
go get github.com/testdouble/go-forex-quotes
```
### Usage
```go
package main
import (
"fmt"
"github.com/testdouble/go-forex-quotes/client"
)
func main() {
forexClient := client.New("API_KEY")
quotes := forexClient.GetQuotes([]string{"EURUSD", "GBPJPY"})
fmt.Printf("Quotes: %+v\n", quotes)
usdToEur, err := forexClient.Convert("USD", "EUR", 100)
fmt.Printf("$100 USD to EUR: %v. Err: %v\n", usdToEur, err)
rate, err := forexClient.GetRate("JPY", "EUR")
fmt.Printf("Rate for JPY to EUR: %v. Err: %v\n", rate, err)
}
```