/php-currency-scoop-client

Client for work with CurrencyScoop API (https://currencyscoop.com/api-documentation)

Primary LanguagePHPMIT LicenseMIT

Currency Scoop PHP Client

Client for work with CurrencyScoop API

Install

Via composer

composer require dasauser/currency-scoop-client

Documentation

use \Dasauser\CurrencyScoop\CurrencyCode;
use \Dasauser\CurrencyScoop\ClientBuilder;

$client = (new ClientBuilder())->buildClient('yourApiKey');

$currency = $client->historical(
    CurrencyCode::USD,
    new \DateTimeImmutable('2015-06-15'),
    [CurrencyCode::EUR, CurrencyCode::GBP]
);

echo $currency->getCode()->value; // USD

echo $currency->getRate(CurrencyCode::EUR); // 0.88835713
echo $currency->getRate(CurrencyCode::GBP); // 0.6426023
echo $currency->getRate(CurrencyCode::BRL); // 0
 

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.