Endpoints
GET/geo/provincesList of provinces and citiesGET/geo/districtsList of districtsGET/geo/communesList of communesList of provinces and cities
GET
/geo/provincesGet list of provinces and cities
Query parameters
country_codestringrequiredCountry code (for example, Vietnam country code is 84)
is_newbooleanNew province (for country Viet Nam)
allbooleanAll provinces including old and new (for country Viet Nam)
Responses
object
dataarray<object>Request
curl "https://pos.pages.fm/api/v1/geo/provinces?api_key=API_KEY&country_code=84"Response 200
{
"data": [
{
"id": "101",
"name": "Hà Nội",
"name_en": "ha noi",
"new_id": "84_VN101"
},
{
"id": "701",
"name": "Hồ Chí Minh",
"name_en": "ho chi minh",
"new_id": "84_VN129"
}
]
}List of districts
GET
/geo/districtsGet list of districts
Query parameters
province_idstringrequiredProvince ID of districts you want to retrieve. Get province ID in api GET /geo/provinces
Responses
object
dataarray<object>Request
curl "https://pos.pages.fm/api/v1/geo/districts?api_key=API_KEY&province_id=101"Response 200
{
"data": [
{
"id": "10101",
"name": "Quận Ba Đình",
"name_en": "ba dinh",
"province_id": "101"
}
]
}List of communes
GET
/geo/communesGet list of communes
Query parameters
district_idstringrequiredDistrict ID of communes you want to retrieve. Get district ID in api GET /geo/districts
province_idstringrequiredProvince ID of communes you want to retrieve. Get province ID in api GET /geo/provinces
Responses
object
dataarray<object>Request
curl "https://pos.pages.fm/api/v1/geo/communes?api_key=API_KEY&district_id=DISTRICT_ID&province_id=PROVINCE_ID"Response 200
{
"data": [
{
"district_id": "10101",
"id": "1010115",
"name": "Phường Cống Vị",
"name_en": "cong vi",
"new_id": null,
"postcode": null,
"province_id": "101"
}
]
}