oneapi
Sign in
Locations v1 / Geo & reverse

Nearest street

From a point (lat/lng) → the nearest street plus the distance. An OSM fact.

GET
https://oneapi.ro/api/locations/v1/strada-apropiata

Query parameters

NameTypeDescriptionAccepted values
latrequired number Latitude, WGS 84. -90 – 90
lngrequired number Longitude, WGS 84. -180 – 180

How it behaves

  • The street nearest to a point (KNN over the OSM geometry), plus the distance.

What it is for

  • Snapping a courier's GPS position to the nearest street while tracking.
  • Identifying the street from an imprecise point before asking for the full address.
  • Validating that a pin the user placed corresponds to a real street.

Response structure

FieldTypeDescription
data.id integer The street's internal id — the key for /strazi/{id}.
data.nume string The name of the nearest street.
data.tip string Thoroughfare type code (names at /nomenclatoare/tipuri).
data.localitate.cod_siruta integer The locality's SIRUTA code — chainable to /localitati/{cod}.
data.localitate.nume string The name of the locality.
data.distanta_m integer Distance (metres) from the queried point to the street.
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/strada-apropiata?lat=46.77&lng=23.59
{
    "data": {
        "id": 14994,
        "nume": "Unirii",
        "tip": "piata",
        "localitate": {
            "cod_siruta": 54984,
            "nume": "Cluj-Napoca"
        },
        "distanta_m": 25
    },
    "meta": {
        "actualizat": {
            "administrativ": "2026-08-15T16: 39: 14+03: 00",
            "geo": "2026-09-04T21: 24: 20+03: 00"
        },
        "atribuire": "© OpenStreetMap contributors",
        "distanta": {
            "metoda": "linie_dreapta",
            "detaliu": "Distanţele sunt geodezice, în linie dreaptă pe suprafaţa Pământului (WGS84) — nu pe drum."
        }
    }
}

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_invalizilat/lng 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": "lat/lng missing or invalid.",
        "detalii": {
            "lat": [
                "The value sent does not satisfy the parameter rule."
            ]
        }
    }
}