Skip to main content

What are codelists?

Categorical fields like legal form, ownership type, and region return a coded value rather than a plain string. Each coded value has the same shape:
{
  "kod": "112",
  "nazov": {
    "sk": "Spoločnosť s ručením obmedzeným",
    "en": "Limited liability company"
  }
}
  • kod — stable entry key. Use for storing, filtering, and comparing.
  • nazov.sk — Slovak label. Use for display in Slovak interfaces.
  • nazov.en — English label. Use for display in English interfaces.
All codelists are sourced from the Statistical Office of the Slovak Republic (ŠÚSR) and returned in full with no parameters required.

Why codes matter

Codes are stable keys that never change — the human-readable label can. A field value might get a wording update, a typo fix, or a punctuation change in the source data. The code behind it won’t. Two situations where this matters:
  • Storing or comparing data. Always store the code, not the label. Matching on a label that could silently change will eventually break.
  • Building in another language. Use the code as a key into your own translation table instead of parsing Slovak strings.

Codelist reference

EndpointDescriptionResolves field
/api/pravne-formyLegal formpravnaForma
/api/sk-naceSK NACE economic activityskNace
/api/druhy-vlastnictvaOwnership typedruhVlastnictva
/api/velkosti-organizacieOrganisation sizevelkostOrganizacie
/api/krajeRegionkraj
/api/okresyDistrictokres
/api/sidlaMunicipalitysidlo
Location entries (kraje, okresy, sidla) also include a nadradenaLokacia field — the parent location code for districts and municipalities.

Resolving a code

// 1. Fetch the legal forms codelist
const { klasifikacie } = await fetch(`/api/pravne-formy`).then(r => r.json());

// 2. Resolve a legal form code from an accounting unit
const form = klasifikacie.find(f => f.kod === unit.pravnaForma);
console.log(form?.nazov?.sk); // "Spoločnosť s ručením obmedzeným"
The same pattern works for all codelists — just swap the endpoint and field name.

Caching codelists

Codelist data changes rarely. Fetch all codelists once at startup and keep them in memory rather than making repeated requests.
// Fetch and cache all codelists at startup
const codelists = {
  legalForms: await fetch(`/api/pravne-formy`).then(r => r.json()).then(d => d.klasifikacie),
  skNace: await fetch(`/api/sk-nace`).then(r => r.json()).then(d => d.klasifikacie),
  ownershipTypes: await fetch(`/api/druhy-vlastnictva`).then(r => r.json()).then(d => d.klasifikacie),
  orgSizes: await fetch(`/api/velkosti-organizacie`).then(r => r.json()).then(d => d.klasifikacie),
  regions: await fetch(`/api/kraje`).then(r => r.json()).then(d => d.lokacie),
  districts: await fetch(`/api/okresy`).then(r => r.json()).then(d => d.lokacie),
  municipalities: await fetch(`/api/sidla`).then(r => r.json()).then(d => d.lokacie),
};

// Resolve any code against the cached codelists
function resolve(codelist, kod) {
  return codelist.find(e => e.kod === kod)?.nazov?.sk ?? kod;
}

// Usage
console.log(resolve(codelists.legalForms, unit.pravnaForma));
console.log(resolve(codelists.regions, unit.kraj));

Data sources

The zdrojDat field on each entity indicates which source system the record originates from.
CodeDescriptionResolves field
SUSRStatistical Office of the Slovak RepubliczdrojDat
SPState Treasury SystemzdrojDat
DCDataCentrumzdrojDat
FRSRFinancial Administration of the Slovak RepubliczdrojDat
JUSUnified State AccountingzdrojDat
OVSRCommercial Bulletin of the Slovak RepubliczdrojDat
CKSCentral Consolidation SystemzdrojDat
SAMBudget Information System for MunicipalitieszdrojDat