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