Exchange Rate API (HTTP)

NBRM Web Service Listing - documentation

 

Basic information

This service is a simple and quick way to access the exchange rates for known currencies without using a SOAP client.

The service is an enhanced version of the well - known SOAP service from NBRM.

 

Token and service authentication

You need to be logged in user before you can use the service.

We simplified the login / registration in the easiest way possible. Only you need to sign in with your Google / Gmail account to continue. After logging into the token field (below) you will be able to use your personal token on PHP.mk services.

Personal Token

Login to show token!

 

Using the Service v1.0

Version ({version}): v1.0

Date ({date}): YYYY-MM-DD e.g. 2019-02-10 * optionally

service end-points

HTTP/GET

https://api.php.mk/nbrm/{version}/?token={token}
                    
https://api.php.mk/nbrm/{version}/{date}?token={token}

Example HTTP/GET request

https://api.php.mk/nbrm/v1.0/?token=

https://api.php.mk/nbrm/v1.0/2015-05-19?token=

Example PHP

$url='https://api.php.mk/nbrm/v1.0/2015-05-17?token=';
$jsonResponse=file_get_contents($url);
$response= json_decode($jsonResponse,true);
            
echo '<pre>';
print_r($response['data']);
exit();

Example cUrl

curl -X GET  'https://api.php.mk/nbrm/v1.0/2021-06-14?token=';

Example Javascript

var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
  if (this.readyState === 4) {
    var response_data=JSON.parse(this.responseText).data;
    console.log(response_data);
  }
});
xhr.open("GET", "https://api.php.mk/nbrm/v1.0/2021-06-14?token=");
xhr.send();

Example jQuery / JavaScript

$.getJSON('https://api.php.mk/nbrm/v1.0/2021-06-14?token=',function(r){

    console.log(r.data);

}).error(function(error){

    console.log(error.responseJSON.msg);

});

 

Service response

The answer is always in JSON format

The reply from the service contains a list of exchange rate data for the most famous currencies in relation to the Macedonian Denar.

Example response

{
    "error": false,
    "status_text": "OK",
    "status_code": 200,
    "data": [
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "EUR",
            "kupoven": "61.3169",
            "sreden": "61.625",
            "prodazen": "61.9331",
            "valuta_id": "978",
            "edinica": "1",
            "drzava_mk": "ЕМУ",
            "drzava_en": "EMU",
            "valuta_mk": "евро",
            "valuta_en": "Euro"
        },
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "USD",
            "kupoven": "54.2195",
            "sreden": "54.492",
            "prodazen": "54.7645",
            "valuta_id": "840",
            "edinica": "1",
            "drzava_mk": "С А Д",
            "drzava_en": "USA",
            "valuta_mk": "САД долар",
            "valuta_en": "US dollar"
        },
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "GBP",
            "kupoven": "69.9805",
            "sreden": "70.3321",
            "prodazen": "70.6838",
            "valuta_id": "826",
            "edinica": "1",
            "drzava_mk": "В.Британија",
            "drzava_en": "U.K.",
            "valuta_mk": "британска фунта",
            "valuta_en": "British pound"
        },
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "CHF",
            "kupoven": "54.0189",
            "sreden": "54.2904",
            "prodazen": "54.5618",
            "valuta_id": "756",
            "edinica": "1",
            "drzava_mk": "Швајцарија",
            "drzava_en": "Switzerland",
            "valuta_mk": "швајцарски франк",
            "valuta_en": "Swiss franc"
        },
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "SEK",
            "kupoven": "5.8476",
            "sreden": "5.877",
            "prodazen": "5.9064",
            "valuta_id": "752",
            "edinica": "1",
            "drzava_mk": "Шведска",
            "drzava_en": "Sweden",
            "valuta_mk": "шведска круна",
            "valuta_en": "Swedish krona"
        },
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "NOK",
            "kupoven": "6.2447",
            "sreden": "6.2761",
            "prodazen": "6.3075",
            "valuta_id": "578",
            "edinica": "1",
            "drzava_mk": "Норвешка",
            "drzava_en": "Norway",
            "valuta_mk": "норвешка круна",
            "valuta_en": "Norwegian krone"
        },
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "JPY",
            "kupoven": "0.492",
            "sreden": "0.4945",
            "prodazen": "0.4969",
            "valuta_id": "392",
            "edinica": "1",
            "drzava_mk": "Јапонија",
            "drzava_en": "Japan",
            "valuta_mk": "јапонски јен",
            "valuta_en": "Japanese yen"
        },
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "DKK",
            "kupoven": "8.2153",
            "sreden": "8.2566",
            "prodazen": "8.2979",
            "valuta_id": "208",
            "edinica": "1",
            "drzava_mk": "Данска",
            "drzava_en": "Denmark",
            "valuta_mk": "данска круна",
            "valuta_en": "Danish krone"
        },
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "CAD",
            "kupoven": "40.8643",
            "sreden": "41.0696",
            "prodazen": "41.275",
            "valuta_id": "124",
            "edinica": "1",
            "drzava_mk": "Канада",
            "drzava_en": "Canada",
            "valuta_mk": "канадски долар",
            "valuta_en": "Canadian dollar"
        },
        {
            "datum": "2019-02-12T00:00:00+01:00",
            "oznaka": "AUD",
            "kupoven": "38.3638",
            "sreden": "38.5566",
            "prodazen": "38.7494",
            "valuta_id": "36",
            "edinica": "1",
            "drzava_mk": "Австралија",
            "drzava_en": "Australia",
            "valuta_mk": "австралиски долар",
            "valuta_en": "Australian dollar"
        }
    ]
}