Metro Manila API
The Metro Manila API is a simple API service that provides valuable information about the cities of Metro Manila in JSON format. It gives the following information:
- Population
- Area
- Density
- Coordinates
- Total Crime Volume
Retrieve City List
GET / city / list
This endpoint returns a list of all the cities in Metro Manila.
Endpoint URL:
patrickcajili.com/city/list
API Response:
[
"Caloocan",
"Las Piñas",
"Makati",
"Malabon",
"Mandaluyong",
"Manila",
"Marikina",
"Muntinlupa",
"Navotas",
"Parañaque",
"Pasay",
"Pasig",
"Pateros",
"Quezon",
"San Juan",
"Taguig",
"Valenzuela"
]
Search City in Database
GET / city / <city_name>
This endpoint allows a user to search for a specific city in the database.
It returns a JSON string containing the city's information.
Endpoint URL:
patrickcajili.com/city/<city_name>
Parameters:
Name | Type | Description |
city_name | string | The name of the city. It should be a city in Metro Manila. Spaces and special characters will be converted automatically. |
[
{
"name": "Taguig",
"population": {
"num": "886,722",
"percent": "6.60%"
},
"area": {
"km": "45.21",
"mi": "17.46"
},
"density": {
"km": "20,000",
"mi": "52,000"
},
"date": "2004",
"district": [
"Southern Manila District",
"4th District"
],
"coordinates": [
"14.5167",
"121.05"
],
"total crime volume": "4541"
}
]
Pick Random City
GET / city / random
This endpoint returns a JSON string containing a random city and it's information.
Endpoint URL:
patrickcajili.com/city/random
Example Response:
[
{
"name": "Taguig",
"population": {
"num": "886,722",
"percent": "6.60%"
},
"area": {
"km": "45.21",
"mi": "17.46"
},
"density": {
"km": "20,000",
"mi": "52,000"
},
"date": "2004",
"district": [
"Southern Manila District",
"4th District"
],
"coordinates": [
"14.5167",
"121.05"
],
"total crime volume": "4541"
}
]
Retrieve All Cities
GET / city / all
This endpoint returns a JSON string that contains all the cities in Metro Manila,
as well as their corresponding information.
Endpoint URL:
patrickcajili.com/city/all
API Response:
[
{
"name": "Caloocan",
"population": {
"num": "1,661,584",
"percent": "12.30%"
},
"area": {
"km": "55.8",
"mi": "21.54"
},
.
.
.
.
.
"date": "1998",
"district": [
"Northern Manila District (Camanava)",
"3rd District"
],
"coordinates": [
"14.7",
"120.983"
],
"total crime volume": "2227"
}
]