Barangays API
Returns a paginated list of Philippine barangays.
Endpoints
Section titled “Endpoints”List Barangays
Section titled “List 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.
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
province | string | Yes | Exact (case-insensitive) name of the province. |
municipality | string | No | Starts-with search for municipality or city name. |
name | string | No | Starts-with search for the barangay name. |
page | integer | No | Page number (default: 1). |
limit | integer | No | Items per page (default: 10, max: 100). |
Example Request
Section titled “Example Request”curl -H "Authorization: Bearer <token>" \ "https://api.gis.ph/v1/barangays?province=Cebu&municipality=Poro&limit=5"Search Barangays by Code
Section titled “Search Barangays by Code”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.
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
codes | string[] | Yes | List of PSGC barangay codes (e.g. "0701201001"). |
geometry | string | No | Geometry level to include: simple (default), medium, or detailed. |
output | string | No | Output format: json (default) or geojson. |
Example Request
Section titled “Example Request”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"Example Response (GeoJSON)
Section titled “Example Response (GeoJSON)”{ "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [ ... ] }, "properties": { "id": "49156", "name": "Bahi", "code": "0701201001" } } ]}Example Response (JSON)
Section titled “Example Response (JSON)”[ { "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 Single Barangay
Section titled “Get Single Barangay”GET /v1/barangays/{id}
Returns detailed information about a single barangay.
Parameters
Section titled “Parameters”id(path): The unique identifier of the barangay.
Example Request
Section titled “Example Request”curl -H "Authorization: Bearer <token>" \ "https://api.gis.ph/v1/barangays/12345"Example Response
Section titled “Example Response”{ "data": { "id": 12345, "name": "Poblacion", "code": "072210001", "population": 2500, "municipality_id": 1595 }, "error": null}