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."
}
}
}
GEThttps://oneapi.ro/api/locations/v1/strada-apropiata?lat=44.4268&lng=26.1025
{
"data": {
"id": 222730,
"nume": "Unirii",
"tip": "bulevard",
"localitate": {
"cod_siruta": 179169,
"nume": "București Sectorul 3"
},
"distanta_m": 31
},
"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."
}
}
}
GEThttps://oneapi.ro/api/locations/v1/strada-apropiata?lat=47.1585&lng=27.6014
{
"data": {
"id": 28069,
"nume": "Tudor Vladimirescu",
"tip": "bulevard",
"localitate": {
"cod_siruta": 95079,
"nume": "Iași"
},
"distanta_m": 4
},
"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."
}
}
}
GEThttps://oneapi.ro/api/locations/v1/strada-apropiata?lat=46.7712&lng=23.6236
{
"data": {
"id": 15607,
"nume": "Slănic",
"tip": "alee",
"localitate": {
"cod_siruta": 54984,
"nume": "Cluj-Napoca"
},
"distanta_m": 44
},
"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
| 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. |
| 422 | parametri_invalizi | lat/lng missing or invalid. |
| 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": "lat/lng missing or invalid.",
"detalii": {
"lat": [
"The value sent does not satisfy the parameter rule."
]
}
}
}