Forex.Feed (forex v0.1.1)
View SourceThis module is responsible for fetching the latest exchange rates from the European Central Bank (ECB) and parsing the XML response.
The ECB provides three different feeds:
- Current exchange rates: https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
- Exchange rates for the last ninety days: https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml
- Historic exchange rates: https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml
For each feed, this module provides a function to fetch the rates and parse the response, respectively,
current_rates/1
, last_ninety_days_rates/1
, and historic_rates/1
.
Summary
Functions
The API module to use for fetching the exchange rates, by default uses the HTTP API.
The API module must implement the Forex.Feed.API
behaviour.
The base URL for the European Central Bank (ECB) exchange rate feeds.
Fetches the latest exchange rates from the European Central Bank (ECB).
Fetches the historic exchange rates from the European Central Bank (ECB).
Fetches the exchange rates for the last ninety days from the European Central Bank (ECB).
The path for the different exchange rate feeds, corresponding to each different feed provided by the European Central Bank (ECB).
Functions
The API module to use for fetching the exchange rates, by default uses the HTTP API.
The API module must implement the Forex.Feed.API
behaviour.
This is useful for testing purposes, where you can provide a mock API module or for using a different API module, for example, an API module that uses a different HTTP client.
The base URL for the European Central Bank (ECB) exchange rate feeds.
Fetches the latest exchange rates from the European Central Bank (ECB).
Fetches the historic exchange rates from the European Central Bank (ECB).
Fetches the exchange rates for the last ninety days from the European Central Bank (ECB).
The path for the different exchange rate feeds, corresponding to each different feed provided by the European Central Bank (ECB).