oneapi
Sign in
Locations v1 / Demografie

Ranking

The top localities, administrative units or counties by a criterion. nivel picks the entity, dupa picks the criterion (population by default), judet narrows it, limita = how many (20 by default).

GET
https://oneapi.ro/api/locations/v1/clasament

Query parameters

NameTypeDescriptionAccepted values
nivelrequired string The entity being ranked. localitateuatjudet
dupaoptional string | null The ranking criterion. populatiesuprafatadensitatefirmedensitate_firme
judetoptional string | null Narrows to one county (registration prefix). e.g. CJ
limitaoptional integer | null How many results. 1 – 100

How it behaves

  • The top localities, administrative units or counties by the criterion in dupa (population by default), optionally narrowed to one county.
  • Which criteria are available depends on the level, and the limit is one of the data, not of the route: densitate and densitate_firme do not exist at locality level, because localities have no area in the nomenclature (only units and counties do). A density without a denominator would be an invented figure — hence a 422 listing the criteria possible for the requested level, rather than an approximate value.
  • Entities with no value for the requested criterion are excluded, not ranked as zero: a locality with no companies does not appear in a ranking by companies, but neither is it listed as „last, with 0".
  • valoare is the quantity the ranking was made on, and criteriu and um in the response header say what it is and what it is measured in. populatie stays on every row as a reference point, even when the ranking is by something else.

What it is for

  • A „top towns by population" widget on a dashboard or public page.
  • Prioritising markets: ordering a county's units by population for expansion.
  • Populating a „largest localities" dropdown for quick selection.

Response structure

FieldTypeDescription
data[].pozitie integer The rank in the list (1 = the highest value).
data[].cod string The key you continue with to that level's detail route: registration prefix for a county, SIRUTA code for a unit or locality.
data[].cod_siruta integer The entity's SIRUTA code — present at every level, so the shape does not vary.
data[].nume string The name of the entity.
data[].tip string | null The type of the ranked entity (municipality/town/commune or locality type); null for a county.
data[].judet.cod string The registration prefix of the entity's county.
data[].judet.nume string The name of the entity's county.
data[].populatie integer | null The entity's population — a reference point, whatever the criterion.
data[].valoare number The value the ranking was made on, in the unit given by um.
meta.actualizat object Prospețimea datelor pe domenii (dată ISO 8601).

Response examples

GEThttps://oneapi.ro/api/locations/v1/clasament?nivel=uat&judet=CJ&limita=5
{
    "data": [
        {
            "pozitie": 1,
            "cod": "54975",
            "cod_siruta": 54975,
            "nume": "Cluj-Napoca",
            "tip": "municipiu",
            "judet": {
                "cod": "CJ",
                "nume": "Cluj"
            },
            "populatie": 286598,
            "valoare": 286598
        }
    ],
    "meta": {
        "criteriu": "populatie",
        "um": "locuitori",
        "actualizat": {
            "administrativ": "2026-08-15T16: 39: 14+03: 00",
            "populatie": "2026-08-15T16: 40: 07+03: 00"
        }
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403feature_indisponibilThe current plan does not include the feature the route depends on.
422parametri_invalizinivel missing or invalid.
429cota_depasitaThe plan's monthly quota has been exceeded (see Retry-After).

All errors share the same shape. eroare.cod is stable and is the value you should branch on in code — not the text in mesaj, which may change.

{
    "eroare": {
        "cod": "parametri_invalizi",
        "mesaj": "nivel missing or invalid.",
        "detalii": {
            "nivel": [
                "The value sent does not satisfy the parameter rule."
            ]
        }
    }
}