oneapi
Sign in
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/la does 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"
    }
}

Error codes

CodeSlugWhen it occurs
401neautentificatToken missing, invalid, expired or revoked.
403feature_indisponibilThe current plan does not include the feature the route depends on.
404negasitThe street or one of the crossing streets does not exist.
422fara_intersectieOne of the crossing streets does not intersect the street.
422geometrie_discontinuaThe street's geometry is discontinuous.
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": "fara_intersectie",
        "mesaj": "One of the crossing streets does not intersect the street.",
        "detalii": {
            "id": [
                "The value sent does not satisfy the parameter rule."
            ]
        }
    }
}