8 Replies - 884 Views - Last Post: 27 July 2012 - 04:38 AM

#1 JiminSA  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 15
  • Joined: 25-November 09

Geographical Location from IP?

Posted 13 April 2010 - 06:27 PM

Can anyone tell me the best approach to use in order to ascertain a website visitors's Geographical location in order to direct them to an appropriate homepage?
I imagine that I would have to scan a database of IP addresses, but where is it and how do I pick out the Country / State / Province / County / Shire... etc.,
Thanks in anticipation...
P.S.
This is my first time of actually using DIC and I am extremely impressed - much more fun than Facebook!

Is This A Good Question/Topic? 0
  • +

Replies To: Geographical Location from IP?

#2 jrm402  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 51
  • View blog
  • Posts: 333
  • Joined: 18-March 10

Re: Geographical Location from IP?

Posted 14 April 2010 - 07:52 AM

You're right, you will have to populate a list in a database (and quite a large one from what I've seen). http://ip-to-country...fo/book/print/5 should get you started on your quest :)
Was This Post Helpful? 0
  • +
  • -

#3 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1947
  • View blog
  • Posts: 3,488
  • Joined: 13-January 08

Re: Geographical Location from IP?

Posted 14 April 2010 - 08:21 AM

Two popular services:

GeoBytes IP Address Locator tool

IP2Location

Now, that first link told me I was in the Chicago area...and I'm really northwest of Atlanta, GA. The second one was much more accurate. Lesson to learn here is that while you can make use of these services (and some of them can be accessed as a web service) the accuracy of the data isn't 100%. I'd use if for trivia purposes or as a starting guess for a user's location as opposed to it being the rock solid definitive location.

Good luck!
Was This Post Helpful? 1
  • +
  • -

#4 JiminSA  Icon User is offline

  • New D.I.C Head

Reputation: -2
  • View blog
  • Posts: 15
  • Joined: 25-November 09

Re: Geographical Location from IP?

Posted 14 April 2010 - 10:57 AM

Wow! Craig328 and jrm402, thanks for the informative and prompt answers! I love this site!
Was This Post Helpful? 0
  • +
  • -

#5 mhollis  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 61
  • Joined: 10-April 10

Re: Geographical Location from IP?

Posted 15 April 2010 - 02:55 PM

View PostJiminSA, on 14 April 2010 - 11:57 AM, said:

Wow! Craig328 and jrm402, thanks for the informative and prompt answers! I love this site!


I am wondering if Google has such a database that is open to anyone. I am fully aware that they use locality information for Google searches and they're pulling that from IP. I use Cox, which is based in Rhode Island and I do come up with ri.cox.net as my TLD. But my IP number resolves to Hartford County, CT and I think that Google gets things even closer.
Was This Post Helpful? 0
  • +
  • -

#6 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1947
  • View blog
  • Posts: 3,488
  • Joined: 13-January 08

Re: Geographical Location from IP?

Posted 16 April 2010 - 06:05 AM

Google maps indeed has a geocoding web service. That, however, requires that you pass them a properly formatted address and they pass back a lat/lon coordinate.

I don't know if they have anything for IP addresses vs. location. I've not heard of it.
Was This Post Helpful? 0
  • +
  • -

#7 mhollis  Icon User is offline

  • D.I.C Head

Reputation: 16
  • View blog
  • Posts: 61
  • Joined: 10-April 10

Re: Geographical Location from IP?

Posted 17 April 2010 - 02:42 PM

View PostCraig328, on 16 April 2010 - 07:05 AM, said:

Google maps indeed has a geocoding web service. That, however, requires that you pass them a properly formatted address and they pass back a lat/lon coordinate.

I don't know if they have anything for IP addresses vs. location. I've not heard of it.


Craig, I know they're using something -- perhaps their own internal database -- as geocoding is not the way to deal with IP numbers and they're deadly accurate. Advertisers are allowed to pick towns to advertise in.

So, while they may not publish this information, it's pretty clear they're using something that is very accurate.
Was This Post Helpful? 0
  • +
  • -

#8 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1947
  • View blog
  • Posts: 3,488
  • Joined: 13-January 08

Re: Geographical Location from IP?

Posted 17 April 2010 - 07:55 PM

Right. As per the links I posted above, you can get a rough geographical location from an IP address...most of the time. Thing is, and surely you've seen it yourself, you'll get ads targeted at you and it comes back with a city/town that isn't where you are. They are accurate to a certain degree most of the time.

Google's GeolocationAPI is probably what you're thinking of. The data that Google does have that you have access to will likely be through that API.
Was This Post Helpful? 0
  • +
  • -

#9 michael clay  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 27-July 12

Re: Geographical Location from IP?

Posted 27 July 2012 - 04:38 AM

 you can get the detail of country at ipdetails.com ..it is easy to find by giving ip address. They produce location of that ip address with the help of google map 

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1