List of Philippine regions, provinces, cities, municipalities, and their barangays as of the 2019 national elections
Get the version 4(2019v2) file here: philippine_provinces_cities_municipalities_and_barangays_2019v2.json
The file is in json format, and should be accessible to most languages. For python users, it can be loaded using the json library.
import json
with open("/path/to/file/philippine_provinces_cities_municipalities_and_barangays_2019v2.json") as myjsonfile:
mydata = json.load(myjsonfile)
An overview of the structure:
Region keys are of the string values "01", "02", "03", "4A", "4B, "05", "06", "07", "08", "09", "10", "11", "12", "13", "BARMM", "CAR", "NCR", (including "NIR" for version 2, and ARMM for version 3 and 3.1).
Each region has the following properties:
"region_name": "REGION XIII"
"province_list": { BATANGAS:{ ... }, "CAVITE":{ ... }, ... }
Each province has the following property:
"municipality_list": { "BACOLOD CITY": { ... }, "BAGO CITY": { ... }, "BINALBAGAN" { ... }, ...}
Each municipality has the following property:
"barangay_list": ["AMPUCAO", "DALUPIRIP", "GUMATDANG", ...]
This is a nested list of Philippine regions, provinces, cities/municipalities and barangays in json format.
Getting an authoritative list of Philippine geographical areas can be pretty tedious and challenging.
Short answer: Yes, it is accurate.
Long answer:
Several municipalities have been renamed, some barangays have been moved, and some barangays not present in the previous version have been introduced. ARMM has also been changed to BARMM. Running a diff between the properly formatted version 3.1 (2017) and version 4 (May 15, 2019v1) (prior to the correction of Ñ characters on July 29, 2019), should show which portions have changed (there should be around 14 material differences).
Get the version 4 (2019v2) file. philippine_provinces_cities_municipalities_and_barangays_2019v2.json
Please file an issue or make a pull request. I can also be reached at the email address associated with this github account.
Data is provided as is and without guarantees. It should however be fairly accurate, as it is based on the 2019 Comelec election data.