Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 620 Bytes

README.md

File metadata and controls

34 lines (23 loc) · 620 Bytes

Go Forex Quotes

Go library for fetching realtime forex quotes

Install

go get github.com/testdouble/go-forex-quotes

Usage

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)
}