currencyapi

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 6 Imported by: 0

README

currencyapi-go: Golang Currency Converter

This package is a Golang wrapper for currencyapi.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 currencyapi.com):

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

Afterwards you can make calls to the API like this:

Status Endpoint
currencyapi.Status()
Currencies Endpoint
currencyapi.Currencies()
Latest Endpoint
currencyapi.Latest({
    "base_currency": "USD",
    "currencies": "EUR"
})
Historical Endpoint
currencyapi.Historical({
    "base_currency": "USD",
    "currencies": "EUR",
	"date": "2022-09-04"
})
Conversion Endpoint *
currencyapi.Convert({
    "base_currency": "USD",
    "currencies": "EUR",
	"date": "2022-09-04",
	"value": "1"
})
Range Endpoint *
currencyapi.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.currencyapi.com/v3/"

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