Locations v1 / Străzi
Street segment between two crossings
⭐ The stretch of street between the intersections with the de and la streets (each an id or a name), with the two endpoints and the segment's length — „from Unirii to Napoca". An OSM fact.
GET
https://oneapi.ro/api/locations/v1/strazi/{id}/segment
Path parameters
NameTypeDescriptionExample
idrequired
string
Internal identifier of the street — obtained from a street search.
Query parameters
NameTypeDescriptionAccepted values
derequired
string
The first crossing street (id or name).
max 200 car.
larequired
string
The second crossing street (id or name).
max 200 car.
How it behaves
- The stretch of street between the intersections with two crossing streets — „from Unirii to Napoca".
- Computed on the OSM geometry: the positions of the intersections along the line (ST_LineLocatePoint) plus the sub-line between them (ST_LineSubstring).
- The order of
de/ladoes not matter. Each can be an internal id or a name.
What it is for
- Estimating the length of a street stretch when drawing delivery zone boundaries.
- Describing a „from X to Y" stretch in instructions to a courier.
- Delimiting a parking or roadworks area between two intersections.
Response structure
FieldTypeDescription
data.strada.id
integer
The id of the street the segment was cut from.
data.strada.nume
string
The name of the street.
data.de
object
The end at the first crossing street: that street plus the intersection coordinates.
data.de.strada
string
The street the segment starts at.
data.de.lat
number
Latitude (WGS 84).
data.de.lng
number
Longitude (WGS 84).
data.la
object
The end at the second crossing street.
data.la.strada
string
The street the segment ends at.
data.la.lat
number
Latitude (WGS 84).
data.la.lng
number
Longitude (WGS 84).
data.lungime_m
integer
The length of the stretch, in metres (a fact computed from the OSM geometry).
meta.actualizat
object
Prospețimea datelor pe domenii (dată ISO 8601).
Response examples
GEThttps://oneapi.ro/api/locations/v1/strazi/7/segment?de=Constantin%20Tănase&la=Teiului
{
"data": {
"strada": {
"id": 7,
"nume": "Albacului"
},
"de": {
"strada": "Constantin Tănase",
"lat": 47.0470246,
"lng": 21.9328958
},
"la": {
"strada": "Teiului",
"lat": 47.04508,
"lng": 21.9381973
},
"lungime_m": 460
},
"meta": {
"actualizat": {
"administrativ": "2026-08-15T16: 39: 14+03: 00",
"strazi": "2026-10-04T19: 50: 09+03: 00",
"geo": "2026-10-06T16: 33: 40+03: 00"
},
"atribuire": "© OpenStreetMap contributors"
}
}
GEThttps://oneapi.ro/api/locations/v1/strazi/1/segment?de=Arinului&la=Livezilor
{
"data": {
"strada": {
"id": 1,
"nume": "Adevărului"
},
"de": {
"strada": "Arinului",
"lat": 47.06432744830709,
"lng": 21.963953163962508
},
"la": {
"strada": "Livezilor",
"lat": 47.0684152,
"lng": 21.9784091
},
"lungime_m": 1277
},
"meta": {
"actualizat": {
"administrativ": "2026-08-15T16: 39: 14+03: 00",
"strazi": "2026-10-04T19: 50: 09+03: 00",
"geo": "2026-10-06T16: 33: 40+03: 00"
},
"atribuire": "© OpenStreetMap contributors"
}
}
GEThttps://oneapi.ro/api/locations/v1/strazi/14612/segment?de=Romulus%20Vuia&la=Gruia
{
"data": {
"strada": {
"id": 14612,
"nume": "11 Octombrie"
},
"de": {
"strada": "Romulus Vuia",
"lat": 46.7803502,
"lng": 23.5765667
},
"la": {
"strada": "Gruia",
"lat": 46.777611,
"lng": 23.5768591
},
"lungime_m": 310
},
"meta": {
"actualizat": {
"administrativ": "2026-08-15T16: 39: 14+03: 00",
"strazi": "2026-10-04T19: 50: 09+03: 00",
"geo": "2026-10-06T16: 33: 40+03: 00"
},
"atribuire": "© OpenStreetMap contributors"
}
}
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 street or one of the crossing streets does not exist. |
| 422 | fara_intersectie | One of the crossing streets does not intersect the street. |
| 422 | geometrie_discontinua | The street's geometry is discontinuous. |
| 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": "fara_intersectie",
"mesaj": "One of the crossing streets does not intersect the street.",
"detalii": {
"id": [
"The value sent does not satisfy the parameter rule."
]
}
}
}