oneapi
Sign in
Locations v1 / Căutare & rezolvare

Resolve (dispatcher)

„What is this string?" — it classifies the input (postal code / SIRUTA code / name) and returns the resolved entity, plus alternatives when the name is ambiguous. An endpoint for „the user typed something and pressed Enter".

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

Query parameters

NameTypeDescriptionAccepted values
qrequired text Minimum 1, maximum 100. max 100 car.

How it behaves

  • A dispatcher: it classifies the input (six-digit postal code → SIRUTA code → name) and returns the resolved entity.
  • An address-shaped string resolves the locality inside it (the last token). Nothing found → interpretare: null.
  • Resolving by name can also return a secondary place (hamlet/neighbourhood) when no official entity shares the name — with cod_siruta: null and parte_din pointing at the parent administrative unit.

What it is for

  • A search bar with Enter: the user types anything (postal code, SIRUTA code or name) and you show the entity directly, without making them pick the input type.
  • Normalising a mixed column in a CSV (some rows postal codes, others locality names) into unique entities.
  • Deep links: from a URL parameter (?loc=cluj-napoca or ?loc=400001) you resolve the entity and load its page.

Response structure

FieldTypeDescription
data.interpretare string | null cod_postal | cod_siruta | nume | null.
data.rezultat object The resolved entity (the same shape as a result from /cauta).
data.rezultat.cod_siruta integer | null The SIRUTA code (the entity's public key).
data.rezultat.nume string The name of the entity.
data.rezultat.nume_afisare string The name prepared for display (with the rank, where that helps).
data.rezultat.nivel string The entity level: region, county, administrative unit or locality.
data.rezultat.tip string | null Entity type (raw code; the full names are at /nomenclatoare/tipuri).
data.rezultat.judet string | null The county of the resolved entity.
data.rezultat.judet_cod string | null The county's vehicle registration prefix.
data.rezultat.lat number | null Latitude (WGS 84).
data.rezultat.lng number | null Longitude (WGS 84).
data.alternative[] array Other matches, when the name is ambiguous.
data.alternative[].cod_siruta integer | null The SIRUTA code (the entity's public key).
data.alternative[].nume string The name of the entity.
data.alternative[].nume_afisare string The name prepared for display.
data.alternative[].nivel string The entity level: region, county, administrative unit or locality.
data.alternative[].tip string | null Entity type (raw code; the full names are at /nomenclatoare/tipuri).
data.alternative[].judet string | null The county of the alternative.
data.alternative[].judet_cod string | null The vehicle registration prefix of the alternative's county.
data.alternative[].lat number | null Latitude (WGS 84).
data.alternative[].lng number | null Longitude (WGS 84).
meta.actualizat object Prospețimea datelor pe domenii (dată ISO 8601).

Response examples

GEThttps://oneapi.ro/api/locations/v1/rezolva?q=400001
{
    "data": {
        "interpretare": "cod_postal",
        "rezultat": {
            "cod_siruta": 54984,
            "nume": "Cluj-Napoca",
            "nume_afisare": "Cluj-Napoca",
            "nume_ascii": "Cluj-Napoca",
            "nivel": "localitate",
            "tip": "resedinta_municipiu",
            "populatie": 286598,
            "judet": "Cluj",
            "judet_cod": "CJ",
            "uat": "Cluj-Napoca",
            "lat": 46.78,
            "lng": 23.559444444444,
            "parte_din": null,
            "potrivit_ca": null,
            "cod_postal": "400001"
        },
        "alternative": []
    },
    "meta": {
        "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_invaliziq is missing (the input to resolve is required).
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": "q is missing (the input to resolve is required).",
        "detalii": {
            "q": [
                "The value sent does not satisfy the parameter rule."
            ]
        }
    }
}