Author Archive

Skyhook Wireless: Wifi-Based Location Detection (and the handy API)

Posted on Monday, February 15, 2010 at 4:44 pm

Skyhook Wireless is a company that does one thing, and does it well: wardriving. They send vans equipped with wifi-detecting equipment and GPSs (wait, is that the plural of GPS? Is it GPSii?) and log the data. Unfortunately, they do not make their data publicly available. What they do have, however, is a XML API.

With a simple HTTP POST, you can (quite accurately) determine the location of a computer based on the BSSIDs (MAC addresses) and signal strengths of the networks it sees. You receive back an easily-parsed XML document containing latitude, longitude, and street address. However, Skyhook is quite bad at figuring out street addresses; the latitude-longitude data is much more helpful.

Skyhook has a Javascript API for web apps with a special browser plugin. The C API is handy for C apps (even has a Linux version!). But those are both wrappers over the simple XML protocol.

OATT is a Sourceforge project to create an open antitheft tracker for stolen laptops. Full disclosure: I am the admin of the project. For laptops without (insert plural of GPS here), I decided to use Skyhook and created a handy Python wrapper.

To use this wrapper in other Python apps, you must do three things (not including downloading the code and cd’ing into the source.)

  1. From a shell, run “sudo”. This will save network information accessible only to root to a file. To update location, you must rerun this command.
  2. In your Python program (the OATT source must be in your $PYTHONPATH), add “import lookup” to the top of the source.
  3. In your Python program, read the contents of “lookup.results”. This is a dictionary with the following keys:
    • “address”: This is a tuple containing the house number, street, city, state, country, and zipcode, in that order.
    • “latlong”: This is a tuple containing the latitude and longitude (both with very many digits after the decimal) in that order.
    • “accuracy”: This is a value taken from the raw Skyhook data. It represents the accuracy in some sort of units.

I am not affiliated in any way with Skyhook. However, they are quite technically impressive and I believe the API should be in much wider use.

Recent Entries

Popular Posts