
This API lets you retrieve information about provinces and their cities, municipalities, sub-municipalities, and barangays in the Philippines. The API returns data in JSON format, providing a convenient way to access the information programmatically.
Accessing All Provinces #
To access all provinces, you can make a GET request to the following endpoint:
https://psgc.cloud/api/provinces
This will return a JSON object containing information about all the provinces in the Philippines.
Accessing a Single Province #
If you want to retrieve information about a specific province, you can use either the province code or name value. For example, to access the province with code “0102900000”, you can make a GET request to the following endpoint:
https://psgc.cloud/api/provinces/0102900000
This will return a JSON object containing information about the province with the specified code.
Accessing Cities of a Province #
To access the cities within a province, you can append “/cities” to the province endpoint. For example, to retrieve the cities within the province with code “0102900000”, you can make a GET request to the following endpoint:
https://psgc.cloud/api/provinces/0102900000/cities
This will return a JSON object containing information about the cities within the specified province.
Accessing Municipalities of a Province #
To access the municipalities within a province, you can append “/municipalities” to the province endpoint. For example, to retrieve the municipalities within the province with code “0102900000”, you can make a GET request to the following endpoint:
https://psgc.cloud/api/provinces/0102900000/municipalities
This will return a JSON object containing information about the municipalities within the specified province.
Accessing Sub-Municipalities of a Province #
To access the sub-municipalities within a province, you can append “/sub-municipalities” to the province endpoint. For example, to retrieve the sub-municipalities within the province with code “0102900000”, you can make a GET request to the following endpoint:
https://psgc.cloud/api/provinces/0102900000/sub-municipalities
This will return a JSON object containing information about the sub-municipalities within the specified province.
Accessing Cities and Municipalities of a Province #
If you want to retrieve both cities and municipalities within a province, you can append “/cities-municipalities” to the province endpoint. For example, to retrieve both cities and municipalities within the province with code “0102900000”, you can make a GET request to the following endpoint:
https://psgc.cloud/api/provinces/0102900000/cities-municipalities
This will return a JSON object containing information about both cities and municipalities within the specified province.
Accessing Barangays of a Province #
To access the barangays within a province, you can append “/barangays” to the province endpoint. For example, to retrieve the barangays within the province with code “0102900000”, you can make a GET request to the following endpoint:
https://psgc.cloud/api/provinces/0102900000/barangays
This will return a JSON object containing information about the barangays within the specified province.
That’s it! You now have the necessary information to start using the PSGC Cloud Provinces API. Feel free to explore the different endpoints and retrieve the data you need for your applications.