Skip to content

Barangays API

Philippine barangays (lowest admin unit in this hierarchy).

GET /v1/barangays

Province is always required for list.

ModeExtra parent rulesPagination
format=json (default)municipality optionalYes (page / limit)
format=geojsonmunicipality required (with province)No — full FeatureCollection for that LGU

Province-wide barangay GeoJSON dumps are not supported (payload / cost safety).

ParameterTypeRequiredDescription
provincestringYesExact (case-insensitive) province name.
municipalitystringConditionalStarts-with municipality/city name. Required when format=geojson.
namestringNoStarts-with barangay name.
pageintegerNoPage number (default: 1). JSON only.
limitintegerNoItems per page (default: 10, max: 100). JSON only.
formatjson | geojsonNoResponse shape. Default json.
outputjson | geojsonNoDeprecated alias of format.
geometrysimple | medium | detailedNoFor json: omit = no geometry. For geojson: defaults to simple.
Terminal window
curl -H "Authorization: Bearer <token>" \
"https://api.gis.ph/v1/barangays?province=Cebu&municipality=Poro&limit=5"
Terminal window
curl -H "Authorization: Bearer <token>" \
"https://api.gis.ph/v1/barangays?province=Bohol&municipality=Tagbilaran&format=geojson"
  • Body: RFC 7946 FeatureCollection
  • Header: Content-Type: application/geo+json
  • Not paginated

Example — rejected GeoJSON (missing municipality)

Section titled “Example — rejected GeoJSON (missing municipality)”
Terminal window
curl -H "Authorization: Bearer <token>" \
"https://api.gis.ph/v1/barangays?province=Bohol&format=geojson"
# → 400 { "message": "...", "code": "parent_required" }

GET /v1/barangays/search

Global free-text search. JSON only (no format=geojson in v1).

Multi-word queries are tokenized on spaces/commas; every token must match name, municipality, province, region, or full address (fullName). Examples: poblacion cebu, Lahug NIR, Poblacion, Batangas.

Used by the Vue and Laravel search components.

ParameterTypeRequiredDescription
qstringYesFree text (min 2 chars).
limitintegerNoMax results (default: 20).
Terminal window
curl -H "Authorization: Bearer <token>" \
"https://api.gis.ph/v1/barangays/search?q=Lahug%20Cebu"
{
"data": [
{
"id": 75322,
"name": "Lahug",
"municipality": "City of Cebu",
"province": "Cebu",
"region": "Region VII (Central Visayas)",
"fullName": "Lahug, City of Cebu, Cebu, Region VII (Central Visayas)",
"code": "0730600041",
"lCode": "0730600000",
"pCode": "0702200000",
"rCode": "0700000000"
}
],
"error": null
}
FieldDescription
nameBarangay name
municipalityCity or municipality name
provinceProvince name
regionRegion name
fullNameBarangay, LGU, province, region (comma-separated)
codeBarangay 10-digit PSGC (use this for get-by-id)
lCodeCity / municipality PSGC
pCodeProvince PSGC
rCodeRegion PSGC
idInternal row id (not used in URLs)

GET /v1/barangays/{id}

Returns detailed information about a single barangay. {id} is the PSGC code (not the internal serial row id). Prefer the 10-digit form (e.g. 0730600041); 9-digit variants are expanded when possible.

ParameterTypeRequiredDescription
idstringYesBarangay PSGC code (digits only), e.g. 0730600041.
ParameterTypeRequiredDescription
formatjson | geojsonNoDefault json. geojson → bare Feature.
geometrysimple | medium | detailedNoDefaults to simple when format=geojson.
Terminal window
curl -H "Authorization: Bearer <token>" \
"https://api.gis.ph/v1/barangays/0730600041"
Terminal window
curl -H "Authorization: Bearer <token>" \
"https://api.gis.ph/v1/barangays/0730600041?format=geojson"
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [ ... ]
},
"properties": {
"id": 75322,
"name": "Lahug",
"type": "Urban",
"code": "0730600041",
"l_code": "0730600000",
"p_code": "0702200000",
"r_code": "0700000000"
}
}

POST /v1/barangays/search

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

FieldTypeRequiredDescription
codesstring[]YesList of PSGC barangay codes (e.g. "0701201001").
geometrystringNoGeometry level to include: simple (default), medium, or detailed.
formatstringNoOutput format: json or geojson.
outputstringNoDeprecated alias of format.
Terminal window
curl -X POST \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"codes":["0701201001","0701201006"],"geometry":"simple","format":"geojson"}' \
"https://api.gis.ph/v1/barangays/search"
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Polygon", "coordinates": [ ... ] },
"properties": {
"id": 12345,
"name": "Bahi",
"code": "0701201001"
}
}
]
}

Example Response (JSON, Legacy fallback when format omitted)

Section titled “Example Response (JSON, Legacy fallback when format omitted)”
[
{
"id": 12345,
"name": "Bahi",
"type": "Rural",
"code": "0701201001",
"l_code": "0701201000",
"p_code": "0701200000",
"r_code": "0700000000",
"municity_name": "Alburquerque",
"province_name": "Bohol"
}
]