What services can I used to find a user's location based on their IP address?

Michael Pryor picture Michael Pryor · Aug 31, 2008 · Viewed 26.3k times · Source

If you need to locate a user based on their IP address, what services are available (free and not free services are fine)?

P.S. I understand that some users use proxies etc., that means the result is not 100% accurate. That's ok.

Answer

Michael Pryor picture Michael Pryor · Aug 31, 2008

Most geolocation services allow you to download a database full of IP Address to city or country maps. Some also provide web service apis for free (limited number of requests) or a paid subscription.

MaxMind has one such service that you can use which is free to determine the user's location. Their minFraud service allows 500 free queries per day.

A sample for their web service in ASP

Dim objHttp, strQuery
strQuery = "http://geoip1.maxmind.com/a?l=" & license_key & _
    "&i=" & ipaddress
set objHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objHttp.open "GET", strQuery, false
objHttp.send
Response.Write objHttp.ResponseText
Set objHttp = Nothing

They also offer APIs for determing credit card fraud probability based on location, card number, etc, in their paid version.

Another service is ip2location. John Millikin

Also, IPLigence offers 50 free queries a day.

For .NET Coders, there is the IPAdressExtensions module (open source, free and no web service required) purekrome


More info about geolocation is available on wikipedia.