Monday, February 16, 2009

Getting Location From Google Latitude

Location based applications would sometimes need to track locations continuously to plot some paths or trigger certain actions. If Google had exposed Google Latitude with APIs, it would have become so much more easier to build applications on it. But alas, it does not yet have any APIs. Probably they are waiting to see if it gathers momentum greater than that Dodgeball did.

Here is a small observation on how to still do it, though in a smaller scale. It is not very elegant, and I lack deeper knowledge of Google APIs to dig deeper. But here it is nevertheless:

Trace the requests that your browser makes when you view Google Latitude through iGoogle. Here's what you see:


Response (Uncompressed):
throw 1; <>
"": {
[,[,\"some_number\",3,1,1,,0]\n,\"\",\"Name\",,12914044,77600009,\"some_number\",150,[\"\",\"Location Text\"]\n,\"\",\"some_number\",,\"/photos/private/photo_id\",\"180906\",\"some_number\",0]\n,
[,[,\"some_number\",3,1,1,,0]\n,\"\",\"Name\",,12889499,77601873,\"some_number\",573,[\"\",\"Location Text\"]\n,\"\",\"some_number\",,\"/photos/private/photo_id\",\"261704650\",\"some_number\",1]\n,

some other stuff...}

The response JSON has the gmail IDs (marked in green above) and latitude-longitude combination (marked in red above) for you and all your friends.

So log on to iGoogle through a proxy that logs all responses, pass it through a parser to extract the information out. Better still, create a firefox plugin that does it.


Tanmay said...

Self comment...
Two interesting articles on this:

The Cellphone, Navigating Our Lives from The New York Times
Google Is Tracking Your Every Move from Esquire

Anonymous said...

basic API now available