bkintanar / psgc-api

API for Philippine Standard Geographic Code - Updated June 2021

Home Page:https://psa.gov.ph/classification/psgc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PSGC API

Live API can be found in http://bkintanar-psgc.herokuapp.com. (Will change once I find the time to get a domain)

Postman: https://documenter.getpostman.com/view/78990/SWE3cKFB?version=latest

Data Source: https://psa.gov.ph/classification/psgc/

Notes from PSGC publication

  1. The total number of provinces in the PSGC excludes the four (4) districts of National Capital Region which have been assigned special Province Codes persuant to Presidential Decree No. 921.
  2. The City of Isabela and Cotabato City are assigned special Province Codes to show that they are not administratively part of ARMM but part of Region IX (Zamboanga Peninsula) and Region XII (SOCCSKSARGEN) repectively.
  3. The sub-municipalities of the City of Manila - Tondo I/II, Binondo, Quiapo, etc., are assigned special municipal codes but not officially considered municipalities.

Supported endpoints

+----------+------------------------------------------+
| Method   | URI                                      |
+----------+------------------------------------------+
| GET|HEAD | api/barangays                            |
| GET|HEAD | api/barangays/{barangay}                 |
| GET|HEAD | api/cities                               |
| GET|HEAD | api/cities/{city}                        |
| GET|HEAD | api/districts                            |
| GET|HEAD | api/districts/{district}                 |
| GET|HEAD | api/municipalities                       |
| GET|HEAD | api/municipalities/{municipality}        |
| GET|HEAD | api/provinces                            |
| GET|HEAD | api/provinces/{province}                 |
| GET|HEAD | api/regions                              |
| GET|HEAD | api/regions/{region}                     |
| GET|HEAD | api/sub-municipalities                   |
| GET|HEAD | api/sub-municipalities/{subMunicipality} |
+----------+------------------------------------------+

Pagination

Default pagination is set to 15 items per page. You can modify this by passing a per_page=# as a query parameter.

/api/regions?per_page=10

Includes

To include provinces

/api/regions?include=provinces
/api/regions/070000000?include=provinces

image

To include cities, municipalities in a given province

/api/provinces?include=cities
/api/provinces?include=municipalities
/api/provinces?include=cities,municipalities

image

image

To include barangays

/api/cities?include=barangays
/api/cities/072217000?include=barangays
/api/municipalities?include=barangays
/api/municipalities/072201000?include=barangays

image

About

API for Philippine Standard Geographic Code - Updated June 2021

https://psa.gov.ph/classification/psgc


Languages

Language:PHP 99.3%Language:Shell 0.7%Language:Procfile 0.0%