Skip to content

Barangays API

Returns a paginated list of Philippine barangays.

GET /v1/barangays

Returns a list of barangays. Filtering by province name is required. Optional starts-with search for municipality and barangay name are supported.

ParameterTypeRequiredDescription
provincestringYesExact (case-insensitive) name of the province.
municipalitystringNoStarts-with search for municipality or city name.
namestringNoStarts-with search for the barangay name.
pageintegerNoPage number (default: 1).
limitintegerNoItems per page (default: 10, max: 100).
Terminal window
curl -H "Authorization: Bearer <token>" \
"https://api.gis.ph/v1/barangays?province=Cebu&municipality=Poro&limit=5"

POST /v1/barangays/search

Accepts a list of PSGC barangay codes and returns matching barangays. Supports both JSON and GeoJSON output formats with optional boundary geometry.

FieldTypeRequiredDescription
codesstring[]YesList of PSGC barangay codes (e.g. "0701201001").
geometrystringNoGeometry level to include: simple (default), medium, or detailed.
outputstringNoOutput format: json (default) or geojson.
Terminal window
curl -X POST \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"codes":["0701201001","0701201006"],"geometry":"simple","output":"geojson"}' \
"https://api.gis.ph/v1/barangays/search"
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Polygon", "coordinates": [ ... ] },
"properties": {
"id": "49156",
"name": "Bahi",
"code": "0701201001"
}
}
]
}
[
{
"id": "49156",
"name": "Bahi",
"type": "Rural",
"code": "0701201001",
"l_code": "0701201000",
"p_code": "0701200000",
"r_code": "0700000000",
"municity_name": "Alburquerque",
"province_name": "Bohol",
"geometry": { "type": "Polygon", "coordinates": [ ... ] }
}
]

GET /v1/barangays/{id}

Returns detailed information about a single barangay.

  • id (path): The unique identifier of the barangay.
Terminal window
curl -H "Authorization: Bearer <token>" \
"https://api.gis.ph/v1/barangays/12345"
{
"data": {
"id": 12345,
"name": "Poblacion",
"code": "072210001",
"population": 2500,
"municipality_id": 1595
},
"error": null
}