Vietnam admin boundaries: 34 provinces, 3,323 districts, and rich metadata
How GoGoDuk's admin-boundary endpoint works today — province and district polygons plus population, area, contact info, and centroids.
Vietnam has three administrative levels below the country: tỉnh / thành phố (province or centrally-governed city), huyện / quận (district), and xã / phường / thị trấn (ward or commune). Knowing them precisely is the difference between an address that geocodes and one that doesn't.
GoGoDuk ships the upper two levels today via /v1/admin-boundaries
— 34 provinces and 3,323 districts, sourced from bando.com.vn and
cleaned in our own dataset. Wards are coming.
What you get today
The endpoint returns polygon geometry per administrative unit, keyed by OSM admin level:
Response shape:
Every field besides name and boundary is optional — the API only
emits them when the underlying record has a value. If you're upgrading
from the original release that only returned name + boundary, no code
changes are needed. The TypeScript SDK ships these as optional fields in
@gogoduk/[email protected].
| Param | Default | Notes |
|---|---|---|
levels | 4,8 | Comma-separated OSM admin levels. 4 = province, 8 = district. |
format | geojson | geojson returns coordinate arrays; wkt returns OGC strings. |
country_code | VN | ISO-3166-1 alpha-2. Vietnam is the only country we ship today. |
tolerance | 0.001 | Douglas-Peucker simplification in degrees. Lower = more detail = bigger payload. |
Polygons are derived from authoritative provincial GIS sources, then run through our own QA pipeline to catch sliver gaps and self-intersecting geometries (more common than you'd think in published government datasets).
Why ward-level matters — and what we have today
Most Vietnamese addresses disambiguate at the ward, not the street. "Đường số 7" (Street No. 7) exists in dozens of HCMC wards. Without ward context, a geocoder picks the wrong one.
For now, ward-level geometry isn't exposed through /v1/admin-boundaries.
But you can already reverse-geocode a point to its containing
province + district via the related endpoint:
Returns:
Both endpoints are backed by the same PostGIS ST_Contains query against
our boundary table — same accuracy, different shape.
What's in every record
Each polygon now ships with the metadata the dataset has carried all along — no JOIN by hand needed:
province_name+province_id— parent province for districts; matchesnamefor provinces themselvespopulation+area_km2— useful for service-area planning, density rollups, and choropleth maps without a second API calladmin_center— the seat-of-government city/town for the unitphone+website— official contact channels for the local administration, where publishedpre_merge_info— human-readable note about the unit's most recent reorganisation. Vietnam consolidated provinces and districts in 2025; old addresses with the previous names still circulate. This field tells you what merged into what so you can cross-reference.centroid— a single[lng, lat]point per unit. Useful for labelling on maps without measuring polygon centroids client-side.
Field coverage is 100% for both levels at the time of writing (34/34 provinces, 3,323/3,323 districts).
Still on the roadmap
Ward-level polygons (admin_level=10) — Vietnam has 10,500+ wards
across its 3,323 districts after the 2025 reorganization, and we're
working through the dataset. Watch the changelog for the
ship.
Try it
Should print 34. If you hit a polygon that looks wrong — sliver gap,
missing district, outdated boundary after a recent merge — please email
[email protected] with the unit name and we'll
investigate. The dataset is hand-cleaned, not magical.
Want to use GoGoDuk?
Free forever — 100 requests/day per account, no credit card. Higher limits on request.
Sign up →