Barangays
Barangays are the smallest administrative units. Endpoints allow filtering and upward traversal to parents.
GET
/api/v1/barangays
List barangays (paginated)
Params:
q
, city_code
, municipality_code
, province_code
,
region_code
, per_page
.
GET
/api/v1/barangays/{barangay}
Show a barangay
Parent Traversal
If supported, provide helper endpoints to climb the hierarchy from a barangay to its city / municipality, province, and region.
/api/v1/barangays/{barangay}/city
/api/v1/barangays/{barangay}/municipality
/api/v1/barangays/{barangay}/province
/api/v1/barangays/{barangay}/region
Code Samples
List Barangays
curl -s https://api.example.com/api/v1/barangays
fetch('https://api.example.com/api/v1/barangays')
.then(r => r.json())
.then(console.log)
axios.get('https://api.example.com/api/v1/barangays')
.then(r => console.log(r.data))
<?php
$client = new \GuzzleHttp\Client(['base_uri' => 'https://api.example.com']);
$res = $client->get('/api/v1/barangays');
$body = json_decode($res->getBody(), true);
print_r($body);
Show Barangay
curl -s https://api.example.com/api/v1/barangays/012801001
fetch('https://api.example.com/api/v1/barangays/012801001')
.then(r => r.json())
.then(console.log)
axios.get('https://api.example.com/api/v1/barangays/012801001')
.then(r => console.log(r.data))
<?php
$client = new \GuzzleHttp\Client(['base_uri' => 'https://api.example.com']);
$res = $client->get('/api/v1/barangays/012801001');
$body = json_decode($res->getBody(), true);
print_r($body);