Skip to content

testdouble/go-forex-quotes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Go package to obtain forex quotes for currency

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages