GoGoDuk

GET /v1/admin-boundaries

Vietnam provincial and ward/district polygons in GeoJSON or WKT.

Returns Vietnam administrative boundary polygons (level 4 provinces/cities and level 8 wards/communes/districts) as GeoJSON or WKT, along with optional population, area, centroid, and pre-merge administrative metadata.

Required scope: admin_boundaries:read

Request

GET /v1/admin-boundaries?levels=4,8&format=geojson&countryCode=VN&tolerance=0.005
X-API-Key: gdk_live_xxxxxxxxxxxxxxxxxxxxxxxx
curl -G "https://api.gogoduk.com/v1/admin-boundaries" -H "X-API-Key: $GOGODUK_API_KEY" --data-urlencode "levels=4,8" --data-urlencode "format=geojson" --data-urlencode "countryCode=VN" --data-urlencode "tolerance=0.005"

Query parameters

NameRequiredDescription
levelsnoComma-separated admin levels (4 for province, 8 for ward/district). Default 4,8.
formatnoGeometry format: geojson (default) or wkt.
countryCodenoISO alpha-2 country code. Default VN.
tolerancenoPostGIS ST_SimplifyPreserveTopology tolerance in degrees (e.g. 0.001–0.01) to reduce payload size.

Response

{
  "admin_level_4": [
    {
      "id": 1,
      "name": "Thành phố Hà Nội",
      "province_name": "Thành phố Hà Nội",
      "population": 8500000,
      "area_km2": 3359.8,
      "pre_merge_info": null,
      "admin_center": { "lat": 21.0285, "lon": 105.8542 },
      "centroid": { "lat": 21.003, "lon": 105.691 },
      "boundary": {
        "type": "MultiPolygon",
        "coordinates": []
      }
    }
  ],
  "admin_level_8": []
}

Response fields

FieldTypeDescription
admin_level_4 / admin_level_8arrayRequested boundary arrays keyed by level.
[].namestringOfficial boundary name.
[].province_namestring | nullParent province name (present on level 8 units).
[].populationnumber | nullPopulation count if available.
[].area_km2number | nullArea in square kilometers if available.
[].pre_merge_infoobject | nullPre-merger administrative reference metadata if applicable.
[].admin_centerobject | null{ lat, lon } of the administrative center.
[].centroidobject | null{ lat, lon } geometric centroid.
[].boundaryobject | stringGeoJSON geometry object or WKT string depending on format.

Common errors

  • 400 BAD_REQUEST — invalid levels, format, or tolerance.
  • 401 INVALID_API_KEY — key not recognized.
  • 403 INSUFFICIENT_SCOPE — key is missing admin_boundaries:read.
  • 429 RATE_LIMIT_MINUTE — back off using the retry_after field.

On this page