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