Time Series Endpoint - lico/jFixer GitHub Wiki

Getting a list of rates between two dates

The most basic usage is the following:

FixerApiLoader fixerApiLoader = (baseUrl, accessKey, baseCurrency);    
List<ExchangeRate> rates = fixerApiLoader.getTimeSeries("2018-07-22", "2018-07-24");     

where:

  • startDate can be a LocalDate or a string object (in format yyyy-MM-dd in this later case)
  • endDate can be a LocalDate or a string object (in format yyyy-MM-dd in this later case)

A FixerException is thrown in case the dates are invalid or startDate is after endDate.

The API returns a list of ExchangeRate object which basically contain a few methods:

rate.getBaseCurrency(); // the base currency, eg: EUR
rate.getTargetCurrency(); // the target currency, eg: JPY
rate.getRate(); // a double value of the rate, eg: 1.3547
rate.getDate(); // the date of the exchange rate in the format, yyyy-MM-dd, eg: 2018-07-22
rate.getTimestamp(); // a LocalDateTime object that holds the timestamp returned by Fixer.io, that is the date of execution