PHP Classes

NBU API: Get data of exchange rates and banks from Ukraine

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 28 All time: 11,111 This week: 524Up
Version License PHP version Categories
nbu-api 1.0.0Custom (specified...5PHP 5, Web services, Finances


This package is specific mainly for applications used in Ukraine Ukraine .

This package can get data of exchange rates and banks from Ukraine.

It can send HTTP requests to the Web server of the National Bank of Ukraine API to perform several types of operations.

Currently it can get the current exchange rate between the Ukraine currency (UAH) to other currencies, metal exchange rates, as well information about the banks in Ukraine.

Picture of Slava Striletskyi
  Performance   Level  
Name: Slava Striletskyi <contact>
Classes: 2 packages by
Country: Ukraine Ukraine
Age: 34
All time rank: 439876 in Ukraine Ukraine
Week rank: 225 Up4 in Ukraine Ukraine Up
Innovation award
Innovation award
Nominee: 1x


 * Project: nbuAPI
 * Created by:
 * Date: 10/16/2018
 * Time: 10:57 AM

require_once "NBU_API.php";

$jsonNbuAPI = new JSON_NBU_API();
$xmlNbuAPI = new XML_NBU_API();


print_r( $xmlNbuAPI->getExchanges( array( 'valcode' => 'USD' ) ) );

print_r( $jsonNbuAPI->getBanks( array( 'typ' => 6 ), false ) );



Classes for working with National Bank of Ukraine API. Currently class can get information about banks and current exchange UAH to foreign currencies and banking metals.

<h3>Example</h3> <pre>

require_once "NBU_API.php";<br>
require_once "JSON_NBU_API.php";<br>
require_once "XML_NBU_API.php";<br>
$jsonNbuAPI = new JSON_NBU_API();<br>
$xmlNbuAPI = new XML_NBU_API();<br>
print_r( $xmlNbuAPI->getExchanges( array( 'valcode' => 'USD' ) ) );<br>
print_r( $jsonNbuAPI->getBanks( array( 'typ' => 6 ), false ) );<br>


<h3>Answers</h3> <pre> SimpleXMLElement Object (

[currency] => SimpleXMLElement Object
        [r030] => 840
        [txt] => ????? ???
        [rate] => 27.928166
        [cc] => USD
        [exchangedate] => 16.10.2018

) [ { "GLMFO":322313,"N_GOL":"?? "????????????"","NAME_E":null,"KOD_EDRPOU":null,"SHORTNAME":"?????????????? ?? "????????????" ? ????? ???????, ??","NKB":"002","TYP":"6","KU":"0","N_OBL":"?? ?????????","DEPCODE":"00226826626205000000","P_IND":null,"TNP":"?.","NP":"??????","ADRESS":"Juxon ?ouse 100 St. Paul's Churchyard, London EC4M 8BU, United Kingdom","KODT":null,"TELEFON":null,"KSTAN":"1","N_STAN":"??????????","D_STAN":"09.09.2006","D_OPEN":"25.05.2006","D_CLOSE":null,"STAN_GOL":"1","NSTAN_GOL":"??????????" } ,{ "GLMFO":322313,"N_GOL":"?? "????????????"","NAME_E":null,"KOD_EDRPOU":null,"SHORTNAME":"?????????????? ?? "?????????????" ? ?.???-?????, ???","NKB":"002","TYP":"6","KU":"0","N_OBL":"?? ?????????","DEPCODE":"00226840626205000000","P_IND":null,"TNP":"?.","NP":"???-????","ADRESS":"14 WALL STREET, 20th FLOOR,NEW YORK, NY 10005,USA","KODT":null,"TELEFON":null,"KSTAN":"1","N_STAN":"??????????","D_STAN":null,"D_OPEN":"10.10.2007","D_CLOSE":null,"STAN_GOL":"1","NSTAN_GOL":"??????????" } ,{ "GLMFO":334851,"N_GOL":"??? "????"","NAME_E":null,"KOD_EDRPOU":null,"SHORTNAME":"?????????????? ???? ? ?.??????","NKB":"115","TYP":"6","KU":"0","N_OBL":"?? ?????????","DEPCODE":"11526826626747000001","P_IND":null,"TNP":"?.","NP":"??????","ADRESS":"100 Pall Mall, office 19. St.James's, SW1Y 5HP","KODT":"(44)","TELEFON":"2073213900","KSTAN":"5","N_STAN":"????????? ??????????? ??????????","D_STAN":null,"D_OPEN":"15.01.2003","D_CLOSE":null,"STAN_GOL":"1","NSTAN_GOL":"??????????" } ] </pre>

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.php Aux. Auxiliary script
Accessible without login Plain text file index.php Example Example script
Plain text file JSON_NBU_API.php Class Class source
Accessible without login Plain text file LICENSE Lic. License text
Plain text file NBU_API.php Class Class source
Accessible without login Plain text file Doc. Documentation
Plain text file XML_NBU_API.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:11,111
This week:524Up