Locations v1 / Ierarhie & dropdown-uri
Locality detail
The detail of a locality by cod_siruta: the parent county and unit (chainable), urban/rural, population. Expandable with ?include=populatie,coduri_postale,nume_alternative,secundare (secundare = the attached hamlets and neighbourhoods). No geospatial data (dedicated route) and no streets (/localitati/{cod}/strazi).
GET
https://oneapi.ro/api/locations/v1/localitati/{cod}
Path parameters
NameTypeDescriptionExample
codrequired
string
SIRUTA code of the locality (e.g.
54984).
Query parameters
NameTypeDescriptionAccepted values
includelistoptional
text
Expandable sections, comma-separated.
populatiecoduri_postalenume_alternativesecundare
How it behaves
- 227 of the 13,755 localities (1.65%) have no population figure — near-abandoned villages for which the 2021 census published no value (the smallest figure published anywhere in the country is 3). This is not a missing link: all 227 exist, with geometry and with a GeoNames identifier. County and administrative-unit figures are unaffected — they come from their own census rows, not from summing localities. Anyone who sums the localities themselves loses, nationwide, 96 people out of 19,053,815.
- Includes the locality's coordinates (
lat/lng). Streets live separately, at/localitati/{cod}/strazi. ?include=adds sections; an unknown code in include → 422.include=secundareadds the hamlets and neighbourhoods attached to the locality (name, type, coordinates, distance to the locality).- A locality and the administrative unit of the same name may share a
geoname_id(GeoNames has one entry for the town), but they have differentwikidata_qidvalues — Wikidata keeps the town separate from the administrative unit.
What it is for
- The detail page of a locality: chainable county and unit, urban/rural, population and coordinates in a single object.
- After a search or autocomplete, fetching the full entity by
cod_sirutafor display or confirmation. - Enriching an order with its administrative context (unit, county) starting from nothing but a
cod_siruta.
Response structure
FieldTypeDescription
data.cod_siruta
integer
The SIRUTA code (the entity's public key).
data.nume
string
The name of the entity.
data.tip
string
Entity type (raw code; the full names are at /nomenclatoare/tipuri).
data.mediu
string | null
urban or rural.
data.geoname_id
integer | null
The locality's GeoNames id (an external bridge, not a key of ours).
data.wikidata_qid
string | null
The locality's Wikidata QID.
data.lat
number | null
Latitude (WGS 84).
data.lng
number | null
Longitude (WGS 84).
data.judet.cod
string
The county's registration prefix.
data.judet.nume
string
The name of the county.
data.uat
object
The parent administrative unit (chainable).
data.uat.cod_siruta
integer
The SIRUTA code of the administrative unit — chainable to /uat/{cod}.
data.uat.nume
string
The name of the administrative unit.
data.uat.tip
string
The type of unit (municipality/town/commune).
data.populatie
integer | null
Population (census).
data.populatie_detaliu
object
Male/female breakdown — only with include=populatie.
data.populatie_detaliu.masculin
integer | null
Male population.
data.populatie_detaliu.feminin
integer | null
Female population.
data.populatie_detaliu.an
integer | null
The year of the source census.
data.populatie_detaliu.sursa
string | null
The population source (e.g. RPL2021).
data.coduri_postale[]
string
The locality's postal codes.opțional
data.nume_alternative[]
array
Exonyms and historical names — only with include=nume_alternative.
data.nume_alternative[].nume
string
The alternative name (exonym or historical form).
data.nume_alternative[].lang
string | null
The language of the name, where known.
data.nume_alternative[].tip
string | null
What kind of name it is: exonym, historical, variant.
data.nume_alternative[].sursa
string | null
Where the name comes from.
data.nume_alternative[].valabil_pana_la
string | null
The year the name stopped being official.
data.secundare[]
array
Attached hamlets and neighbourhoods — only with include=secundare.
data.secundare[].nume
string
The name of the hamlet or neighbourhood.
data.secundare[].tip
string
catun | cartier.
data.secundare[].lat
number | null
Latitude of the secondary place (WGS 84).
data.secundare[].lng
number | null
Longitude of the secondary place (WGS 84).
data.secundare[].distanta_m
integer | null
Distance to the parent locality, in metres.
data.secundare[].sursa
string
Where the secondary place comes from: osm or geonames.
meta.actualizat
object
Prospețimea datelor pe domenii (dată ISO 8601).
meta.distanta
object
How the distances in the response are measured. Present on every response that carries a distance.
meta.distanta.metoda
string
Always
linie_dreapta (straight line): the geodesic distance over the Earth's surface, not by road.
meta.distanta.detaliu
string
The same information, in words.
Response examples
GEThttps://oneapi.ro/api/locations/v1/localitati/54984
{
"data": {
"cod_siruta": 54984,
"nume": "Cluj-Napoca",
"tip": "resedinta_municipiu",
"mediu": "urban",
"geoname_id": 681290,
"wikidata_qid": "Q16898189",
"lat": 46.78,
"lng": 23.559444444444,
"judet": {
"cod": "CJ",
"nume": "Cluj"
},
"uat": {
"cod_siruta": 54975,
"nume": "Cluj-Napoca",
"tip": "municipiu"
},
"populatie": 286598
},
"meta": {
"actualizat": {
"administrativ": "2026-08-15T16: 39: 14+03: 00",
"geo": "2026-09-04T21: 24: 20+03: 00",
"populatie": "2026-08-15T16: 40: 07+03: 00"
}
}
}
GEThttps://oneapi.ro/api/locations/v1/localitati/54984?include=populatie,coduri_postale,nume_alternative
{
"data": {
"cod_siruta": 54984,
"nume": "Cluj-Napoca",
"tip": "resedinta_municipiu",
"mediu": "urban",
"geoname_id": 681290,
"wikidata_qid": "Q16898189",
"lat": 46.78,
"lng": 23.559444444444,
"judet": {
"cod": "CJ",
"nume": "Cluj"
},
"uat": {
"cod_siruta": 54975,
"nume": "Cluj-Napoca",
"tip": "municipiu"
},
"populatie": 286598,
"populatie_detaliu": {
"masculin": 134768,
"feminin": 151830,
"an": 2021,
"sursa": "RPL2021"
},
"coduri_postale": [
"400335"
],
"nume_alternative": [
{
"nume": "Cluj-Napoca",
"lang": "ro",
"tip": "denumire_istorica",
"sursa": "mfp",
"valabil_pana_la": "2001-05-10"
}
]
},
"meta": {
"actualizat": {
"administrativ": "2026-08-15T16: 39: 14+03: 00",
"geo": "2026-09-04T21: 24: 20+03: 00",
"populatie": "2026-08-15T16: 40: 07+03: 00"
}
}
}
GEThttps://oneapi.ro/api/locations/v1/localitati/54984?include=secundare
{
"data": {
"cod_siruta": 54984,
"nume": "Cluj-Napoca",
"tip": "resedinta_municipiu",
"mediu": "urban",
"geoname_id": 681290,
"wikidata_qid": "Q16898189",
"lat": 46.78,
"lng": 23.559444444444,
"judet": {
"cod": "CJ",
"nume": "Cluj"
},
"uat": {
"cod_siruta": 54975,
"nume": "Cluj-Napoca",
"tip": "municipiu"
},
"populatie": 286598,
"secundare": [
{
"nume": "Andrei Mureșanu",
"tip": "cartier",
"lat": 46.75922,
"lng": 23.60612,
"distanta_m": 4248,
"sursa": "geonames"
}
]
},
"meta": {
"actualizat": {
"administrativ": "2026-08-15T16: 39: 14+03: 00",
"geo": "2026-09-04T21: 24: 20+03: 00",
"populatie": "2026-08-15T16: 40: 07+03: 00"
},
"distanta": {
"metoda": "linie_dreapta",
"detaliu": "Distanţele sunt geodezice, în linie dreaptă pe suprafaţa Pământului (WGS84) — nu pe drum."
}
}
}
Error codes
| Code | Slug | When it occurs |
|---|---|---|
| 401 | neautentificat | Token missing, invalid, expired or revoked. |
| 403 | feature_indisponibil | The current plan does not include the feature the route depends on. |
| 404 | negasit | The locality does not exist. |
| 422 | parametri_invalizi | An unknown include. |
| 429 | cota_depasita | The 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": "An unknown include.",
"detalii": {
"cod": [
"The value sent does not satisfy the parameter rule."
]
}
}
}