Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jkrmarmol/ph-location-api
This is a RESTful API built with Node.js, Express.js, and TypeScript that allows you to locate places in the Philippines.
https://github.com/jkrmarmol/ph-location-api
Last synced: 15 days ago
JSON representation
This is a RESTful API built with Node.js, Express.js, and TypeScript that allows you to locate places in the Philippines.
- Host: GitHub
- URL: https://github.com/jkrmarmol/ph-location-api
- Owner: jkrmarmol
- License: mit
- Created: 2023-09-25T12:55:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-14T14:42:34.000Z (about 1 year ago)
- Last Synced: 2023-10-15T23:42:50.423Z (about 1 year ago)
- Language: TypeScript
- Size: 284 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Philippines Location API
This is a RESTful API built with Node.js, Express.js, and TypeScript that allows you to locate places in the Philippines.
## Features
- **Location Lookup:** Search for places in the Philippines using various parameters such as region, province, or province.
## Installation
1. Clone the repository:
2. Install dependencies `npm install`
3. Start server `npm run dev`## How to use
The API provides the following endpoints for locating places in the Philippines:### Get region in a philippines
**Request:**
GET /api**Examples:**
GET /api
**Response:**
```js
[
{
"name": "REGION I (ILOCOS REGION)",
"reg_code": "01"
},
{
"name": "REGION II (CAGAYAN VALLEY)",
"reg_code": "02"
},
...
```### Get provinces in a region
**Request:**
GET /api/:region
**Examples:**
GET /api/13
**Response:**
```js
[
{
"name": "NCR, CITY OF MANILA, FIRST DISTRICT",
"reg_code": "13",
"prov_code": "1339"
},
{
"name": "CITY OF MANILA",
"reg_code": "13",
"prov_code": "1339"
},
{
"name": "NCR, SECOND DISTRICT",
"reg_code": "13",
"prov_code": "1374"
},
{
"name": "NCR, THIRD DISTRICT",
"reg_code": "13",
"prov_code": "1375"
},
...
```### Get municipality in a provinces
**Request:**
GET /api/:region/:province
**Examples:**
GET /api/13/1374
**Response:**
```js
[
{
"name": "CITY OF MANDALUYONG",
"prov_code": "1374",
"mun_code": "137401"
},
{
"name": "CITY OF MARIKINA",
"prov_code": "1374",
"mun_code": "137402"
},
{
"name": "CITY OF PASIG",
"prov_code": "1374",
"mun_code": "137403"
},
...
```### Get barangay in a municipality
**Request:**
GET /api/:region/:province/:municipality
**Examples:**
GET /api/13/1374/137402
**Response:**
```js
[
{
"name": "Barangka",
"mun_code": "137402"
},
{
"name": "Calumpang",
"mun_code": "137402"
},
{
"name": "Concepcion Uno",
"mun_code": "137402"
},
{
"name": "Malanday",
"mun_code": "137402"
},
...
```## Author
**Kurt Russelle Marmol**GitHub: [@jkrmarmol](https://github.com/jkrmarmol)
LinkedIn: [@jkrmarmol](https://www.linkedin.com/in/jkrmarmol/)