Barangays Database

PSGC Barangays API

Barangays are the smallest administrative divisions in the Philippines. Use our endpoints to perform advanced filtering, search, and upward traversal to their parent entities.

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 Endpoints

Provide helper endpoints to dynamically climb the geographic hierarchy upward from any individual barangay to its parent city, municipality, province, and region:

  • GET /api/v1/barangays/{barangay}/city
  • GET /api/v1/barangays/{barangay}/municipality
  • GET /api/v1/barangays/{barangay}/province
  • GET /api/v1/barangays/{barangay}/region

Developer Code Samples

List Barangays

cURL
curl -s https://psgc.cloud/api/v1/barangays
fetch API
fetch('https://psgc.cloud/api/v1/barangays')
  .then(res => res.json())
  .then(console.log)
Axios
import axios from 'axios';
axios.get('https://psgc.cloud/api/v1/barangays')
  .then(res => console.log(res.data))
PHP (Guzzle)
<?php
$client = new \GuzzleHttp\Client(['base_uri' => 'https://psgc.cloud']);
$res = $client->get('/api/v1/barangays');
$body = json_decode($res->getBody(), true);
print_r($body);

Show Barangay

cURL
curl -s https://psgc.cloud/api/v1/barangays/012801001
fetch API
fetch('https://psgc.cloud/api/v1/barangays/012801001')
  .then(res => res.json())
  .then(console.log)
Axios
import axios from 'axios';
axios.get('https://psgc.cloud/api/v1/barangays/012801001')
  .then(res => console.log(res.data))
PHP (Guzzle)
<?php
$client = new \GuzzleHttp\Client(['base_uri' => 'https://psgc.cloud']);
$res = $client->get('/api/v1/barangays/012801001');
$body = json_decode($res->getBody(), true);
print_r($body);