Git Product home page Git Product logo

psgc-api's Introduction

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

psgc-api's People

Contributors

mlab817 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

appcrafts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.