|Should be fairly compliant of HTTP 1.1 standards.|
|Needs to use an appropriate "approved" user-agent string. If this is not followed, you will be forced to screen scrape data out of a human readable HTML table. E-mail email@example.com with the user-agent that you are developing with, and ask nicely for it to be added. One of the WiGLE admins might do it for you. NOTICE: This user-agent string restriction will be removed in the near future due to authentication being required.|
|Needs to support cookies. This is to handle authentication. Authentication is currently not necessary, but will be in the near future, so your client should support it.|
|Should cache data whenever possible. Bandwidth is not cheap.|
Querying WiGLE is a piece of cake. Or key lime pie should you prefer that instead. I think I'll take coconut cream myself. At any rate, it's easy. You need to do an HTTP GET request and then parse the result. GET this URL:
Replace upperLeftX, lowerRightX, upperLeftY, and lowerRightY with the appropriate decimal latitude and longitude coordinates. This will return a ~ delimited result set. See parsing result set below. I should also point out that this URL will also accept a POST and PUT method. WiGLE is flexible.
There are various other variables that can be passed on in the GET request. Here's a list of all known variables.
|longrange1||double||Y*||Minimum longitude for square of area being queried.||-89.54321|
|longrange2||double||Y*||Maximum longitude for square of area being queried.||-89.12345|
|latrange1||double||Y*||Maximum latitude for square of area being queried.||41.54321|
|latrange2||double||Y*||Minimum latitude for square of area being queried.||41.12345|
|addresscode||strings||Y*||Query center address**||1600+Pennsylvania+Ave|
|statecode||string||Y*||Query center state**||DC|
|zipcode||integer||Y*||Query center zip (no +4)**||20502|
|variance||double||Y*||+/- degrees, 0.010 to 0.2||0.12345|
|simple||boolean||N||Specifies the type of output the server should send. See the parsing result set section.||true|
|lastupdt||N||Only return networks who have been updated since a specified time. The format is YYYYMMDDHHMMSS.||20041201143918|
|netid||string||N||Only return networks with the specified BSSID or MAC||0A:2C:EF:3D:25:1B|
|freenet||boolean||N||Only return networks that are specifically indicated as freenets.||true|
|paynet||boolean||N||Only return networks that are specifically indicated as paynets.||true|
|dhcp||boolean||N||Only return networks that have DHCP enabled.||true|
|onlymine||boolean||N||Only return networks found by the current authenticated user. (See authentication)||true|
|pagestart||integer||N||Set the offset to begin returning data, when not in simple mode. (Regular mode only returns 1000 per page. Specify the offset to get to the other pages of the resulting query.)||1000|
* Only one method of location needs to be specified. If you are using lat/lon ranges, do not specify an addresscode, statecode, zipcode, or variance. If you are using addresscode, statecode, zipcode, and variance fields, do not specify lat/lon ranges.
** The geocoding for addresses is only valid for the United States, and is based on 2002 US Census Bureau data.
Assuming you are using the simple query mode, you'll get some data back that looks something like this:
netid~ssid~comment~name~type~freenet~paynet~firsttime~flags~wep~trilat~trilong~dhcp~lastupdt~channel~active~bcninterval~qos~userfound 00:02:2d:58:ff:ff~tsunami~ ~ ~????~?~?~0000-00-00 00:00:00~0001~?~41.12345447~-90.55546570~?~20050121224702~0~Y~100~1~N 00:06:25:e6:ff:ff~ana~ ~ ~ ~?~?~0000-00-00 00:00:00~0005~N~41.12345021~-90.55596161~?~20050121225402~6~Y~100~0~Y 00:80:c8:2b:ff:ff~default~ ~ ~ ~?~?~0000-00-00 00:00:00~1025~N~41.12345514~-90.55197906~?~20050121225402~ ~Y~100~0~Y 00:06:25:54:ff:ff~WaveLan Network~ ~ ~ ~?~?~0000-00-00 00:00:00~0001~N~41.12345807~-90.54991913~?~20050121225402~ ~Y~100~0~Y 00:02:2d:0b:ff:ff~Education Department~ ~ ~ ~?~?~0000-00-00 00:00:00~17~Y~41.12345796~-90.54699707~?~20050121225402~ ~Y~100~0~Y 00:06:25:7f:ff:ff~linksys~ ~ ~ ~?~?~0000-00-00 00:00:00~1~Y~41.12345775~-90.12345322~?~20050121225402~ ~Y~100~0~Y
Fields are delimited with a ~. Empty fields contain a space (ASCII HEX 20). It's also to note that question marks (?) are known to appear in empty fields as well. These fields have been known to change in the past. It's recommended that the client parse this first line to know the order and availability of columns.
Here's a chart with all of the current fields that seem to be returned.
|netid||string||BSSID or MAC|
|comment||string||Comment that was left on the network. Comments can currently only be entered manually on the WiGLE.net site.|
|name||string||Some access points allow you to enter a name for your own organizational purposes, not related to the SSID.|
|type||string||Type of wireless network. Possible values include|
|freenet||boolean*||Whether or not the network is indicated as a freenet|
|paynet||boolean||Whether or not the network is indicated as a paynet|
|firsttime||Date/Time when the network was first located as defined in the log files uploaded by users. Format is YYYY-MM-DD HH:MM:SS|
|flags||802.11 capability flags as formatted by NetStumbler|
|wep||boolean||Whether or not WEP encryption is enabled|
|trilat||double||The estimated decimal latitude of the network based on a weighted average of signal strength and other factors|
|trilong||double||The estimated decimal longitude of the network based on a weighted average of signal strength and other factors|
|dhcp||boolean||Whether or not the network has a DHCP server enabled|
|lastupdt||Date/Time of last update on WiGLE.net. Usually when the file is parsed. Format is YYYYMMDDHHMMSS.|
|channel||integer||What channel the network is using.|
|bcninterval||integer||The interval in milliseconds between SSID beacons.|
|qos||integer||A value created by WiGLE based on the number of observations and other factors. (0-7?)|
|userfound||boolean||This returns Y if the network was first found by the currently authenticated user. If no user is logged in, it will always be N.|
*Boolean values are specified as either Y or N if present.
According to 802.11 specifications, it's entirely possible to have any value for an SSID, printable characters or not. This may present a problem in parsing, particularly if ~ is used in the SSID. WiGLE does escape some characters, but it is unknown what method is used.
To login, you simply need to send a POST request to http://WiGLE.net/gps/gps/GPSDB/login with the following variables:
|credential_0||This is the username.|
|credential_1||This is the password.|
|noexpire||Set to on or off, this specifies how long the cookie should last. If set to on, the cookie will expire in 10 years.|
If authentication succeeds, WiGLE will return with a 302 Moved, and a cookie. Hang on to this cookie and send it with your queries.
If authentication fails,WiGLE will return with a 200 OK, and no cookie for you.
Tack on gzip to your Accept-Encoding string, and WiGLE will GZip all of it's results for faster downloading.
If your client supports it, you can use SSL for everything. Just use https on port 443, instead of http for your requests.
It's possible to retrieve a list of points that a network was observed at. Sometimes this query will also return points that make a geometric shape approximating the coverage area of a network. The URL is as follows:
netid is a string representing the BSSID or MAC of the network you're querying for. This will return some data like this:
latitude~longitude~lining 0.00000010~-0.00000010~-1 0.00000320~-0.00000680~-1 0.00000320~-0.00000680~-1
The variables latitude and longitude are the decimal lat and long for the observation points of the network. If the lining is -1, they are observation points. Any other lining value is what is used to draw the coverage polygon. It's important to note that not all (very few actually) networks have a coverage area calculated for them.
No special user-agent string is needed to retrieve the simple mode output for this script. Setting simple to false still returns simple mode. If you want the human readable output, leave the simple variable out of the URL.
Musatcha is pronounced moo-SA-cha. I have no
idea where it originated.