Vietnam Provinces online API (0.5.0)

Download OpenAPI specification:Download

Show All Divisions

query Parameters
depth
integer (Show down to subdivisions) [ 1 .. 3 ]
Default: 1

2: show districts; 3: show wards

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List Provinces

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search Provinces

query Parameters
q
required
string (Query string for search)
Example: q=Hiền Hòa

Follow lunr syntax.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Province

path Parameters
code
required
integer (Code)
query Parameters
depth
integer (Show down to subdivisions) [ 1 .. 3 ]
Default: 1

2: show districts; 3: show wards

Responses

Response samples

Content type
application/json
{
  • "code": 1,
  • "codename": "thanh_pho_ha_noi",
  • "districts": [
    ],
  • "division_type": "thành phố trung ương",
  • "name": "Thành phố Hà Nội",
  • "phone_code": 24
}

List Districts

query Parameters
Province code to filter (integer) or Province code to filter (null) (Province code to filter)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search Districts

query Parameters
q
required
string (Query string for search)
Example: q=Hiền Hòa

Follow lunr syntax.

Province code to filter (integer) or Province code to filter (null) (Province code to filter)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get District

path Parameters
code
required
integer (Code)
query Parameters
depth
integer (Show down to subdivisions) [ 1 .. 2 ]
Default: 1

2: show wards

Responses

Response samples

Content type
application/json
{
  • "code": 1,
  • "codename": "quan_ba_dinh",
  • "division_type": "quận",
  • "name": "Quận Ba Đình",
  • "province_code": 1,
  • "wards": [
    ]
}

List Wards

query Parameters
District code to filter (integer) or District code to filter (null) (District code to filter)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Search Wards

query Parameters
q
required
string (Query string for search)
Example: q=Hiền Hòa

Follow lunr syntax.

District code to filter (integer) or District code to filter (null) (District code to filter)
Province code to filter, ignored if district is given (integer) or Province code to filter, ignored if district is given (null) (Province code to filter, ignored if district is given)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Ward

path Parameters
code
required
integer (Code)

Responses

Response samples

Content type
application/json
{
  • "code": 1,
  • "codename": "phuong_phuc_xa",
  • "district_code": 1,
  • "division_type": "phường",
  • "name": "Phường Phúc Xá"
}

Get Version

Responses

Response samples

Content type
application/json
{
  • "data_version": "string"
}