Supported Symbols Endpoint - lico/jFixer GitHub Wiki

Getting the List of Currencies from Fixer.io

You get the list of supported currencies by calling the method getSupportedCurrencies().

FixerApiLoader fixerApiLoader = (baseUrl, accessKey, baseCurrency);    
List<Currency> currencies = fixerApiLoader.getSupportedCurrencies();     
for(Currency currency : currencies) {    
  log.debug("{}->{}", currency.getSymbol(), currency.getDisplayName());     
}

This method returns a com.upandcoding.fixer.model.Currency object and not a java.util.Currency object. The reason for this choice is because java.util.Currency comes with a list of international currencies some of which are not supported by Fixer.io.

A FixerException is thrown in case of error.

Note that once you call getSupportedCurrencies(), the object Currency keeps a static list of the supported symbols which makes it unnecessary to call the method each and every time:

List<Currency> currencies = Currency.setSupportedCurrencies(currencies);

Also, there's an interesting method in com.upandcoding.fixer.model.Currency for getting the currency name in a different language:

String frName = currency.getDisplayName(Locale.FRENCH)

This method relies on the implementation in java.util.Currency

⚠️ **GitHub.com Fallback** ⚠️