This is a simple API that provides a list of local government areas in Nigeria with their GPS coordinates. It's written in Python with Flask Framework and uses MongoDB as DataStore.
All LGAs have the following properties:
Field | Description |
---|---|
stateCode | State Code of the State the LGA belongs |
state | State the LGA belongs to |
lga | Name of the Local Government Area |
latitude | Latitude of the Local Government Area |
longitude | Longitude of the Local Government Area |
For example, Zurmi Local Goverment in Zamfara:
{
"stateCode": "ZM",
"state": "Zamfara",
"lga": "Zurmi",
"latitude": 12.1844159,
"longitude": 6.2375947
}
- clone this repo
- Create a Virtual Environment for the application
virtualenv env
- Activate your virtual environment
source env/bin/activate
- Install all the project's requirements
pip install -r requirements.txt
The Application runs on port 8080
To run, enter command :
python run.py
Anc check the endpoints in your favourite REST Client
Returns data about a single LGA.
-
URL
/api/v1/lgas/:state_name_or_code
-
Method:
GET
-
URL Params
Required:
state_name_or_code=[string]
-
Data Params
None
-
Success Response:
- Code: 200
Content:{ "stateCode": "ZM", "state": "Zamfara", "lga": "Zurmi", "latitude": 12.1844159, "longitude": 6.2375947}
- Code: 200
-
Error Response:
- Code: 404 NOT FOUND
Content:{"error": "Data not Found"}
- Code: 404 NOT FOUND
For any questions or problems feel free to shoot me an email @ [email protected]