oneapi
Sign in
Locations v1 / Proximitate & zone

Distance between two places

The straight-line (geodesic) distance between two landmarks de/la, each either a locality's cod_siruta or a „lat,lng" point. An unresolvable landmark → 404.

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

Query parameters

NameTypeDescriptionAccepted values
derequired string The first landmark (cod_siruta or „lat,lng"). max 50 car.
larequired string The second landmark. max 50 car.

How it behaves

  • Each landmark (de/la) is either a locality's cod_siruta or a „lat,lng" point. The distance is a straight line (geodesic).

What it is for

  • Computing a delivery fee based on the warehouse → customer distance.
  • Sorting suppliers or couriers by proximity to a landmark.
  • A quick estimate of transport cost or time between two localities.

Response structure

FieldTypeDescription
data.de.cod_siruta integer | null The cod_siruta of the origin landmark; null when it was given as a „lat,lng" point.
data.de.nume string | null The name of the origin landmark.
data.de.lat number Latitude (WGS 84).
data.de.lng number Longitude (WGS 84).
data.la.cod_siruta integer | null The cod_siruta of the destination landmark; null when it was given as a raw point.
data.la.nume string | null The name of the destination landmark.
data.la.lat number Latitude (WGS 84).
data.la.lng number Longitude (WGS 84).
data.distanta_m integer The straight-line (geodesic) distance, in metres.
data.distanta_km number The same distance expressed in kilometres.
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/distanta?de=54984&la=179196
{
    "data": {
        "de": {
            "cod_siruta": 54984,
            "nume": "Cluj-Napoca",
            "lat": 46.78,
            "lng": 23.559444444444
        },
        "la": {
            "cod_siruta": 179196,
            "nume": "București Sectorul 6",
            "lat": 44.43527778,
            "lng": 26.10277778
        },
        "distanta_m": 327491,
        "distanta_km": 327.49
    },
    "meta": {
        "actualizat": {
            "administrativ": "2026-08-15T16: 39: 14+03: 00",
            "geo": "2026-09-04T21: 24: 20+03: 00"
        },
        "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.
404negasitOne of the landmarks could not be resolved.
422validareA parameter failed validation (de, la); detalii says which and why.
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": "validare",
        "mesaj": "A parameter failed validation (de, la); detalii says which and why.",
        "detalii": {
            "de": [
                "The value sent does not satisfy the parameter rule."
            ]
        }
    }
}