This is an exchange data provider for Peso that retrieves data from CurrencyAPI.
composer require peso/currencyapi-serviceInstall the service with all recommended dependencies:
composer install peso/currencyapi-service php-http/discovery guzzlehttp/guzzle symfony/cache<?phpusePeso\Peso\CurrencyConverter;
usePeso\Services\CurrencyApiService;
usePeso\Services\CurrencyApiService\Subscription;
useSymfony\Component\Cache\Adapter\FilesystemAdapter;
useSymfony\Component\Cache\Psr16Cache;
require__DIR__ . '/../vendor/autoload.php';
$cache = newPsr16Cache(newFilesystemAdapter(directory: __DIR__ . '/cache'));
$service = newCurrencyApiService('cur_live_...', Subscription::Free, cache: $cache);
$converter = newCurrencyConverter($service);
// 10777.50 as of 2025-07-30echo$converter->convert('12500', 'USD', 'EUR', 2), PHP_EOL;Read the full documentation here: https://phpeso.org/v1.x/services/currencyapi.html
Please file issues on our main repo at GitHub: https://github.com/phpeso/currencyapi-service/issues
The library is available as open source under the terms of the MIT License.