progjp/nbu-currency-api

Get currency rate from NBU API

v1.0 2020-11-28 20:13 UTC

This package is auto-updated.

Last update: 2024-09-29 05:56:06 UTC


README

Latest Stable Version Total Downloads License composer.lock available

NBU Currency Client

PHP client for NBU (National bank of Ukraine) API service (https://old.bank.gov.ua/doccatalog/document?id=72819047)

Requirements

  • PHP >=7.2
  • ext-json
  • ext-curl

Install

Via Composer

$ composer require progjp/nbu_currency

Usage

Get All Currency rates

$client = new CurrencyApiClient();
$client->getCurrencyRate();

Get All Currency rates by date

$client = new CurrencyApiClient();
$client->getCurrencyRate(null, new DateTime());

Get Currency rate by date

$client = new CurrencyApiClient();
$client->getCurrencyRate('USD', new DateTime());