Twilight Universe


IP to City?

Posted in blog by Gregory on the May 11th, 2006

I’ve always liked IP2Nation: a free database that lets you find out from someones IP what country they are in. It’s a nice example of someone collating the free data out there and then distributing it in a useful format.

But what about cities?

There are lots of services that charge up to $800 for databases that allow you to look-up where city an IP is coming from. Of course these cannot be that accurate, no matter what they claim, it’s just the nature of the data. I’m in Oakland right now, most show San Mateo or San Francisco as my location. It doesn’t matter that they can give me the map co-ordinates for that position, they are still wrong: they can only go as local as the data allows.

So why should I pay that much for data that isn’t accurate? This information must be publically available, so how do I find it? I want to collect the data for everyone and then give it away for free, just like IP2Nation does, in fact it would be nice to organise it so that it worked with IP2Nation.

I’ll be the first to admit that I have no idea where to start with this, other than making up a big form and asking people to fill it in, so I’m putting out the call: Help me! Know how I should start? Know of someone that might? Please, let them know and ask them to help me do this.
This might just benefit you in the end.

6 Responses to 'IP to City?'

Subscribe to comments with RSS or TrackBack to 'IP to City?'.


  1. on August 21st, 2006 at 12:18

    hi,
    IPs are distributed to ISPS and Corporations according to geographic location. The organization known as IANA does this distribution, so basically you have the first 2 octets of the ip address corresponding to the country of origin (xxx.xxx.232.2323) - so it begins like this: if 1st octet of ip “xxx” = “y” then ip belongs to “y country”. So it beings like that, you would have a table with all the countries and corresponding subnets.

    However, this is not exhaustive and certain ips apply to multiple countries (eg: 110.x.x.x). You would then display the country to the user, and if the script doesn’t know the country (it’s not in the db, or its listed as international - meaning the ip can apply to multiple countries), then it would show a message saying “We could not locate your Country”. Under each country listing, you would display a link that would allow users to correct your script and essentially they can enter what country they are in. This data would get submitted to the database, and if several (say 20+) people correct the database - the ip is then attached to the corresponding country. In this way, you build a large database that relies on user input for correct location.

  2. Pamod said,

    on November 11th, 2006 at 11:10

    Hi nice attempt dude If i found good info i’ll mail u Best of luck with ur stuff

  3. Per said,

    on December 29th, 2007 at 12:43

    Hi,

    The info you’re requesting is to some extent available much like country. The difference is that this data seems to be a lot more prone to errors, compared to country data. The organizations and companies that charge a few hundred dollars for this information have, I assume, another way of getting the data. (One idea is to use data collected from ecommerce site or something like that.)

    Regards,

    Per


  4. on March 24th, 2008 at 12:37

    catharistic sunstone coprolaliac suction divulgater actinian vealskin gopherberry
    EDC-Wholesale
    http://www.mariposamarket.ca/


  5. on April 17th, 2008 at 21:34

    catharistic sunstone coprolaliac suction divulgater actinian vealskin gopherberry
    Claddagh House B&B
    http://cnn.com/2002/TECH/industry/06/13/microsoft.flaw.ap/index.html


  6. on April 20th, 2008 at 19:11

    catharistic sunstone coprolaliac suction divulgater actinian vealskin gopherberry
    Bridlewood Subdivision
    http://www.bracketsuk.com/

Leave a Reply