List regions
curl --request GET \
--url https://www.registeruz.sk/cruz-public/api/krajeimport requests
url = "https://www.registeruz.sk/cruz-public/api/kraje"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://www.registeruz.sk/cruz-public/api/kraje', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.registeruz.sk/cruz-public/api/kraje",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.registeruz.sk/cruz-public/api/kraje"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.registeruz.sk/cruz-public/api/kraje")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.registeruz.sk/cruz-public/api/kraje")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"lokacie": [
{
"kod": "<string>",
"nazov": {
"sk": "<string>",
"en": "<string>"
},
"nadradenaLokacia": "<string>"
}
]
}Codelists
List regions
Returns all region codes and labels.
GET
/
api
/
kraje
List regions
curl --request GET \
--url https://www.registeruz.sk/cruz-public/api/krajeimport requests
url = "https://www.registeruz.sk/cruz-public/api/kraje"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://www.registeruz.sk/cruz-public/api/kraje', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.registeruz.sk/cruz-public/api/kraje",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.registeruz.sk/cruz-public/api/kraje"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.registeruz.sk/cruz-public/api/kraje")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.registeruz.sk/cruz-public/api/kraje")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"lokacie": [
{
"kod": "<string>",
"nazov": {
"sk": "<string>",
"en": "<string>"
},
"nadradenaLokacia": "<string>"
}
]
}You can use this endpoint to resolve the
kraj field from the response on an Accounting unit into a human-readable label.
The source code for this endpoint is the ŠÚSR codelist
0023/RSUJ3.Common patterns
Resolve a region code
Resolve a region code
Fetch all regions and find the matching label for a
kraj code on an accounting unit.Resolve a region code
// 1. Fetch all regions
const { lokacie } = await fetch(`${BASE}/api/kraje`).then(r => r.json());
// 2. Resolve the region label for an accounting unit
const region = lokacie.find(r => r.kod === unit.kraj);
// 3. Log the region label
console.log(region?.nazov?.sk);
Response
200 - application/json
Regions returned successfully.
Show child attributes
Show child attributes
⌘I