Useful library for fetching currency rates from cbr and ecb providers

0.2.4 2015-09-29 07:11 UTC

This package is not auto-updated.

Last update: 2020-06-26 18:14:29 UTC


Build Status Code Coverage Scrutinizer Code Quality SensioLabsInsight Dependency Status

This library shows an efficient way to work with currencies and currency rates form Central Bank of Russia, European Central Bank, and Yahoo Finance. It contains base classes and interfaces which hide logic about loading currency rates, one of the most useful implementation is Symfony2 bundle.



You can easily install it with composer by command:

composer require redcode/currency-rate


First of all you need to implement services ICurrencyRateManager, ICurrencyManager. Then DTO or Entity objects Currency and CurrencyRate.

After that create and configure currencyConverter:

use RedCode\Currency\Rate;

// we have initialized $currencyRateManager and $currencyManager

$providerFactory = new Provider\ProviderFactory();
  new Provider\EcbCurrencyRateProvider`(

$converter = new CurrencyConverter(

$convertedValue = $converter->convert('USD', 'GBP', 100);


To run tests use command below:



Pull requests are welcome. Please see our CONTRIBUTING guide.