Get Client’s Physical Location from IP Address via GeoMapLookUp.Net

Posted on: July 5th, 2011 by
Comments Requested

It’s becoming more and more popular for sites to tell you where you are. And, aside from being a neat thing to do, it is very useful in honing in onto what your users will find relevant even before the page is loaded. One method of retrieving the browser’s location is through using GeoMapLookUp.Net, however, there are many services out there. Drop down for a list of other location lookup methods.

In a previous post I’ve already described how to get the IP address of a browser using ServerVariables. We’ll use this method here. We’ll also be using a method provided by You can view what this method returns by simply going to Will be using the same url to download an kml file with the addition of ‘?kml=true&ip=‘. Here’s what we need.

XmlDocument doc = new XmlDocument();
WebClient myclient = new WebClient();
string str = myclient.DownloadString(“
kml=true&ip=” + GetIP());

The bulk of the code downloads a kml file from geomaplookup api and loads into into a xml document. The string to call is ‘’ with the IP address at the end of the url. You can see what you get as the result by going to that url and inputing any old IP address. You can get yours from

And that’s pretty much it.
Here’s some references for other methods of retrieving the physical location from IP Address.

Tags: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>