Using Rokubun's Jason service (https://jason.rokubun.cat), we send Android's GNSS raw data and compare the resulting coordinates with the user's provided coordinates.
Using ipinfo.io
within its free tier. Sending an IP address.
Using wigle.net
within its free tier. Sending the SSID of a WiFi
router.
There is the possibility of sending coordinates to reduce the search area.
NOTE: Response is hardcoded since they have a limitation of 5 queries per day.
POST /geolocate/ HTTP/1.1
Host: localhost:5000
Content-Type: multipart/form-data; boundary=--------------------------016850107323449250282000
Content-Length: 267119
Connection: keep-alive
Content-Disposition: form-data; name="user_file";
filename="user_log_1.txt"
Content-Disposition: form-data; name="gps_latlon"
37.386,-122.1
Content-Disposition: form-data; name="ip_address"
8.8.8.8
Content-Disposition: form-data; name="wifi_ssid"
eduroam
HTTP/1.0 200 OK
Content-Type: application/json
Server: Werkzeug/1.0.0 Python/3.7.2
{
"data": {
"info": {
"info": "Score obtained for location 37.386,-122.1",
"help": "Score between 0 and 1 (max). From correlating the different inputs given by the user",
"available_inputs": [
"gps, gnss, ip, wifi"
]
},
"gnss": {
"locations": [
"41.379515, 2.141006"
],
"score": [
0.9587
]
},
"ip": {
"locations": [
"37.3860,-122.0838"
],
"score": [
0.0001
]
},
"wifi": {
"locations": [
"41.390132,2.112898",
"41.381432,2.139105"
],
"score": [
0.9585,
0.9587
]
}
},
"error": null
}
POST /geolocate/gnss/ HTTP/1.1
Host: localhost:5000
Content-Type: multipart/form-data; boundary=--------------------------016850107323449250282000
Content-Length: 266766
Connection: keep-alive
Content-Disposition: form-data; name="user_file";
filename="user_log_1.txt"
HTTP/1.0 200 OK
Content-Type: application/json
Server: Werkzeug/1.0.0 Python/3.7.2
{"data": "41.379515, 2.141006", "error": null}
GET /geolocate/ip/8.8.8.8 HTTP/1.1
Host: localhost:5000
HTTP/1.0 200 OK
Content-Type: application/json
Server: Werkzeug/1.0.0 Python/3.7.2
{
"data": {
"ip": "8.8.8.8",
"hostname": "dns.google",
"city": "Mountain View",
"region": "California",
"country": "US",
"loc": "37.3860,-122.0838",
"org": "AS15169 Google LLC",
"postal": "94035",
"timezone": "America/Los_Angeles"
},
"error": null
}
GET /geolocate/wifi/eduroam HTTP/1.1
Host: localhost:5000
HTTP/1.0 200 OK
Content-Type: application/json
Server: Werkzeug/1.0.0 Python/3.7.2
{
"data": {
"success": true,
"totalResults": 1,
"first": 1,
"last": 2,
"resultCount": 2,
"results": [
{
"trilat": 41.390132,
"trilong": 2.112898,
"ssid": "eduroam",
"qos": 0,
"transid": "20191222-00000",
"firsttime": "2019-12-01T08:00:00.000Z",
"lasttime": "2019-12-01T16:00:00.000Z",
"lastupdt": "2019-12-01T16:00:00.000Z",
"netid": "00:02:F3:37:F8:A6",
"name": "UPC - Campus Nord",
"type": "infra",
"comment": null,
"wep": "2",
"bcninterval": 0,
"freenet": "?",
"dhcp": "?",
"paynet": "?",
"userfound": false,
"channel": 1,
"encryption": "wpa2",
"country": "ES",
"region": "CAT",
"city": "Barcelona",
"housenumber": "2, 4",
"road": "Carrer de Dulcet",
"postalcode": "08034"
},
...
],
"searchAfter": "14262474899",
"search_after": 14262474899
},
"error": null
}