oxr v0.4.0 OXR

A thin wrapper for the Open Exchange Rates API Requires an app id, which you can receive at https://openexchangerates.org

Link to this section Summary

Functions

Convert money value from one currency to another

Get all currencies available

Get historical exchange rates for any date available Default base is USD

Get latest exchange rates Default base is USD

Get historical exchange rates for a given time period Default base is USD

Get basic plan information and usage statistics Warning: this endpoint is still in beta

Link to this section Types

Link to this type converted()
converted() :: number
Link to this type currencies()
currencies() :: %{optional(String.t) => String.t}
Link to this type error_description()
error_description() :: String.t
Link to this type error_message()
error_message() :: String.t
Link to this type http_status()
http_status() :: 200..511
Link to this type rate()
rate() :: number
Link to this type rates()
rates() :: %{optional(String.t) => rate}
Link to this type timestamp()
timestamp() :: pos_integer

Link to this section Functions

Link to this function convert(app_id, value, from, to)

Convert money value from one currency to another

Link to this function currencies(show_experimental \\ false)
currencies(boolean) ::
  {:ok, currencies} |
  {:error, http_status, error_message, error_description} |
  {:error, error_description}

Get all currencies available

Link to this function historical(app_id, date, base \\ "", symbols \\ [])

Get historical exchange rates for any date available Default base is USD

Link to this function latest(app_id, base \\ "", symbols \\ [])
latest(String.t, String.t, [String.t, ...]) ::
  {:ok, timestamp, rates} |
  {:error, http_status, error_message, error_description} |
  {:error, error_description}

Get latest exchange rates Default base is USD

Link to this function time_series(app_id, start, stop, base \\ "", symbols \\ [])
time_series(String.t, String.t, [String.t, ...], String.t, String.t) ::
  {:ok, rates} |
  {:error, http_status, error_message, error_description} |
  {:error, error_description}

Get historical exchange rates for a given time period Default base is USD

Link to this function usage(app_id)
usage(String.t) ::
  {:ok, %Data{app_id: term, plan: term, status: term, usage: term}} |
  {:error, http_status, String.t, String.t} |
  {:error, String.t}

Get basic plan information and usage statistics Warning: this endpoint is still in beta