peso/coinlayer-service

Coinlayer data provider for Peso

Maintainers

Package info

github.com/phpeso/coinlayer-service

Homepage

Documentation

pkg:composer/peso/coinlayer-service

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-06-04 05:29 UTC

This package is auto-updated.

Last update: 2026-06-04 06:38:40 UTC


README

Packagist PHP License GitHub Actions Codecov

This is an exchange data provider for Peso that retrieves data from Coinlayer.

Installation

composer require peso/coinlayer-service

Install the service with all recommended dependencies:

composer install peso/coinlayer-service php-http/discovery guzzlehttp/guzzle symfony/cache

Example

<?php

use Peso\Peso\CurrencyConverter;
use Peso\Services\Coinlayer\AccessKeyType;
use Peso\Services\CoinlayerService;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;

require __DIR__ . '/../vendor/autoload.php';

$cache = new Psr16Cache(new FilesystemAdapter(directory: __DIR__ . '/cache'));
// You need a reversible service to get fiat to crypto rates (only crypto to fiat is supported by the service) 
$service = CoinlayerService::reversible('...', AccessKeyType::Free, cache: $cache);
$converter = new CurrencyConverter($service);

// 6.91 as of 2026-04-06
echo $converter->convert('12500', 'USD', 'ETH', 2), PHP_EOL;

Documentation

Read the full documentation here: https://phpeso.org/v1.x/services/coinlayer.html

Support

Please file issues on our main repo at GitHub: https://github.com/phpeso/coinlayer-service/issues

License

The library is available as open source under the terms of the MIT License.