Open Source REST API that allows users to retrieve information of all states and geopolitical zones in Nigeria
NGLocations
-->
## 1. Overview
The NGLocations is an Open Source REST API that allows users to retrieve information of all states and geopolitical zones in Nigeria. Informations include states, cities, local government areas, geopolical zones etc. For an interactive flow and more, visit documentations.
## 2. Table of Contents
- 1. Overview
- 2. Table of Contents
- 3. Installation
- 3.1. Run locally
- 3.2. Deploy to heroku
- 4. Usage
- 4.1 Get list of states
- 4.2. Get a single state
- 4.3. List cities in a state
- 4.4. List Local Governament Areas in a state
- 4.4. Get list of Local Governament Areas
- 4.4. Get a single Local Government Area
- 4.5. Get list of zones
- 5. Operations
- 5.1. Custom Querystring Params
- 6. License
## 3. Installation
### 3.1. Run locally
To run app locally, make sure you have `PHP >= 7.1.3` and `composer` installed.
```bash
git clone
github.com # or clone your own fork
cd nglocations
composer install
cp .env.example .env
php artisan key:generate
```
Pre-fill `DB_HOST`, `DB_PORT`, `DB_USERNAME`, `DB_PASSWORD` with database credentials. Then run:
```bash
php artisan migrate --seed
php artisan serve # spin up server at
localhost
```
### 3.2. Deploy to heroku
Alternatively, you can deploy your own copy of the app using the web-based flow:
## 4. Usage
### 4.1 Get list of states
API endpoint that represents a list of states
- **URL Endpoint:** `/api/v1/states`
- **Method:** `GET`
- **URL Params:** `None`
- **Request Body:** `None`
- **Success Response**
- **Code:** `200`
- **Content:**
```http
[
{
"code": "AB",
"name": "Abia",
"alias": "abia",
"href": "
nglocations.me"
}
]
```
- **Usage Sample:**
```http
GET
nglocations.me
HTTP/1.1
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"code": "AB",
"name": "Abia",
"alias": "abia",
"href": "
nglocations.me"
},
{
"code": "AD", …