A REST api for Ghana's Global Positioning System (GPS) written with Python Django 🐍🐍
Get GhanaPostGPS Address from PlaceName or GPSName.
End Point URL: https://gh-gps.herokuapp.com/api/get-address
Method: POST
Content-Type: application/json
{
"name": "KNUST Guesthouse"
}
{
"name": "AE-0147-4625"
}
1. When Address exists, it returns an address field which contains a list of Addresses
{
"status": "Address found",
"address": [
{
"Place_Name": "KNUST Guesthouse",
"CenterLatitude": "5.5677456",
"CenterLongitude": "-0.1863609",
"Region": "Greater Accra",
"District": "Korley Klote",
"Area": "RINGWAY ESTATES",
"StreetName": "Nuumo Klotey Street",
"GPSName": "GA0315033",
"PostCode": "GA031",
"PlaceName": "KNUST Guesthouse, GA-031-5033, Korley Klote",
"Street": "KNUST Guesthouse, Nuumo Klotey Street"
}
],
"count": 1
}
- No Address was found
{
"status": "No Address found"
}
- Encounter an error
{
"error": "Request is missing name in the body"
}
Get GhanaPostGPS Address from Position (Latitude and Longitude)
End Point URL: https://gh-gps.herokuapp.com/api/get-gps
Method: POST
Content-Type: application/json
{
"lat": "6.1250",
"long": "-1.94872"
}
1. When Address exists, it returns an address field which contains a list of Addresses
{
"status": "Address found",
"address": [
{
"GPSName": "AV31641332",
"Region": "Ashanti",
"District": "Amansie Central",
"PostCode": "AV3164",
"NLat": 6.12502457351701,
"SLat": 6.12497965404504,
"WLong": -1.94876026156099,
"Elong": -1.94871534579679,
"Area": ".",
"Street": ".[Unknown Street]",
"PlaceName": ""
}
],
"count": 1
}
- No Address was found
{
"status": "No Address found"
}
- Encounter an error
{
"error": "Request is missing latitude or longitude in the body"
}
Technologies
Installation
-
Make sure you've got Python installed.
-
Install virtualenv globally with:
$ pip install virtualenv
-
Clone this repo
$ git clone https://github.com/EngineerDanny/GH-GPS-REST-API.git
-
- Cd into your the cloned repo as such:
$ cd GH-GPS-API
- Create and fire up your virtual environment:
$ virtualenv venv -p python3 $ source venv/bin/activate
- Install the dependencies needed to run the app:
$ pip install -r requirements.txt
- Cd into your the cloned repo as such:
Running
- Start the server with:
$ python manage.py runserver
- You can access the local server by using the following ENDPOINTS:
http://localhost:8000/api/ http://localhost:8000/api/get-address http://localhost:8000/api/get-gps
This project is under license from MIT. For more details, see the LICENSE file.
Made with ❤️ by EngineerDanny