Fluctuation Endpoint - lico/jFixer GitHub Wiki

Getting the variations of exchange rates between two dates

The following returns the variations of the base currency compared to CHF in May 2018:

FixerApiLoader fixerApiLoader = (baseUrl, accessKey, baseCurrency);    
List<ExchangeRate> rates = fixerApiLoader.getFluctuations("2018-05-01", "2018-05-31", "CHF");     

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)
  • symbols a string or list of 3-digits supported currencies symbols

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

The result is a Fluctuation object, which provides the following methods:

  • getStartDate() , getEndDate() : the start and end dates
  • getBaseCurrency(), getTargetCurrency() : the base and target currencies
  • getStartRate(), getEndRate() : the rates at the beginning and end of the period
  • getChange(), getChangePct() : the variation in value and in percentage of the rate during the period