oneapi
Sign in
Locations v1 / Geometrie & hărți

Geometry of a county

The county's official (ANCPI) polygon as GeoJSON. ?simplificat=1 = a small payload for the web.

GET
https://oneapi.ro/api/locations/v1/judete/{cod}/geometrie

Path parameters

NameTypeDescriptionExample
codrequired string County code, two letters (e.g. CJ). Bucharest is B.

Query parameters

NameTypeDescriptionAccepted values
simplificatoptional string | null Geometry with fewer points. e.g. 1

How it behaves

  • The official ANCPI polygon, as standard GeoJSON — hand it straight to Leaflet or Mapbox.
  • ?simplificat=1 cuts the payload dramatically (e.g. a county: ~1 MB → ~21 kB), ideal for the web.

What it is for

  • Drawing a county's outline on a Leaflet or Mapbox map, as an administrative overlay.
  • A choropleth by county: each polygon gets a colour from a metric (sales, density).
  • Geographic clipping or masking — restricting a layer or a query to the county boundary.

Response structure

FieldTypeDescription
data.cod string The entity code (the public key of that level).opțional
data.cod_siruta integer The SIRUTA code (the entity's public key).opțional
data.nume string The name of the entity.
data.simplificat boolean The polygon returned is the simplified one (fewer points), not the full one.
data.geometrie object GeoJSON geometry (MultiPolygon): type + coordinates.
data.geometrie.type string The GeoJSON geometry type (Polygon or MultiPolygon).
data.geometrie.coordinates[] mixed The polygon's coordinates, in GeoJSON order (lng, lat).
meta.actualizat object Prospețimea datelor pe domenii (dată ISO 8601).

Response examples

Coordonatele sunt scurtate aici.

GEThttps://oneapi.ro/api/locations/v1/judete/CJ/geometrie?simplificat=1
{
    "data": {
        "cod": "CJ",
        "nume": "Cluj",
        "simplificat": true,
        "geometrie": {
            "type": "MultiPolygon",
            "coordinates": [
                [
                    [
                        [
                            23.595830529,
                            46.48709052
                        ]
                    ]
                ]
            ]
        }
    },
    "meta": {
        "actualizat": {
            "administrativ": "2026-08-15T16: 39: 14+03: 00",
            "geo": null
        }
    }
}

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 county does not exist.
422validareA parameter failed validation (simplificat); 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 (simplificat); detalii says which and why.",
        "detalii": {
            "cod": [
                "The value sent does not satisfy the parameter rule."
            ]
        }
    }
}