https://github.com/cpursley/ex_currency
An Elixir library for fetching currency exchange rates from https://www.investing.com
https://github.com/cpursley/ex_currency
currency-converter currency-exchange-rates elixir
Last synced: 28 days ago
JSON representation
An Elixir library for fetching currency exchange rates from https://www.investing.com
- Host: GitHub
- URL: https://github.com/cpursley/ex_currency
- Owner: cpursley
- Created: 2019-10-11T22:02:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-14T19:00:25.000Z (over 6 years ago)
- Last Synced: 2025-02-25T14:53:24.364Z (over 1 year ago)
- Topics: currency-converter, currency-exchange-rates, elixir
- Language: Elixir
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ExCurrency
An Elixir library for fetching currency exchange rates from [www.investing.com](https://www.investing.com)
## Installation
```elixir
def deps do
[
{:ex_currency, git: "https://github.com/cpursley/ex_currency.git"}
]
end
```
## Usage
Fetch a single exchange rate
```
iex(1)> ExCurrency.exchange_rates("usd", "rub")
{:ok, %ExCurrency.Rates{from: "usd", rate: "64.2224", to: "rub"}}
```
Fetch multiple exchange rates (concurrently)
```
iex(2)> ExCurrency.exchange_rates("usd", ["rub", "gbp", "jpy"])
[
ok: %ExCurrency.Rates{from: "usd", rate: "64.2224", to: "rub"},
ok: %ExCurrency.Rates{from: "usd", rate: "0.7908", to: "gbp"},
ok: %ExCurrency.Rates{from: "usd", rate: "108.42", to: "jpy"}
]
```