fxapi

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2023 License: MIT Imports: 6 Imported by: 0

README

fxapi-go: Golang Currency Converter

This package is a Golang wrapper for fxapi.com that aims to make the usage of the API as easy as possible in your project.

Usage

Initialize the API with your API Key (get one for free at fxapi.com):

fxapi.Init("YOUR-API-KEY")

Afterwards you can make calls to the API like this:

Status Endpoint
fxapi.Status()
Currencies Endpoint
fxapi.Currencies()
Latest Endpoint
fxapi.Latest({
    "base_currency": "USD",
    "currencies": "EUR"
})
Historical Endpoint
fxapi.Historical({
    "base_currency": "USD",
    "currencies": "EUR",
	"date": "2022-09-04"
})
Conversion Endpoint *
fxapi.Convert({
    "base_currency": "USD",
    "currencies": "EUR",
	"date": "2022-09-04",
	"value": "1"
})
Range Endpoint *
fxapi.Range({
    "base_currency": "USD",
    "currencies": "EUR",
	"datetime_start": "2022-09-01T23:59:59Z",
	"datetime_end": "2022-09-03T23:59:59Z",
	"accuracy": "day"
})

(*) Requires paid subscription

Find out more about our endpoints, parameters and response data structure in the docs

License

The MIT License (MIT). Please see License File for more information.

Documentation

Index

Constants

View Source
const BaseUrl = "https://api.fxapi.com/v1/"

Variables

This section is empty.

Functions

func Convert

func Convert(params map[string]string) []byte

func Currencies

func Currencies(params map[string]string) []byte

func Historical

func Historical(params map[string]string) []byte

func Init

func Init(key string)

func Latest

func Latest(params map[string]string) []byte

func Range

func Range(params map[string]string) []byte

func Status

func Status() []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL