API Usage - Jaques08/geolocation GitHub Wiki

Welcome to the geolocation wiki!

API Usage

The Geolocation API is a wrapper API that calls the Google Geolocation API to return data as expected.

Usage

Post

Upon doing a post the API will check if old results exist and return that result, or get new resutls. If some of the entries doesn't have existing results it will also add the results to that entry and save it. Example: post to http://127.0.0.1:8000/georesults/ using the following data as example:

{
	"apscan_data": [
		{
			"band": "2.4",
			"bssid": "aa:aa:aa:aa:aa:aa",
			"channel": "5",
			"frequency": 2432,
			"rates": "1.0 - 135.0 Mbps",
			"rssi": -44,
			"security": "wpa-psk",
			"ssid": "HUAWEI-B315-C1BE",
			"timestamp": 1522886948.0,
			"vendor": "HUAWEI TECHNOLOGIES CO.,LTD",
			"width": "20"
		}
	]
}

This will return the following as an example:

{
  "location": {
    "lat": -33.9204726,
    "lng": 25.5911083
  },
  "accuracy": 30
}

Get

Doing a get on Example: get to http://127.0.0.1:8000/georesults/ will return the following data as example:

[
  {
    "id": 1,
    "bssid": "aa:aa:aa:aa:aa:aa",
    "ssid": "HUAWEI-B315-C1BE",
    "vendor": "HUAWEI TECHNOLOGIES CO.,LTD",
    "geolocation": {
      "accuracy": 30,
      "location": {
        "lat": -33.9204726,
        "lng": 25.5911083
      }
    }
]