2

For a college project for my course on Introduction to Programming, I decided to make a small software that traces the IP address and puts them nicely on a GUI (PyQt). Not a big deal I know, but still I like the idea.

So I Googled around and found MaxMind's IP and their free offering and the pygeoip, which is an API for the MaxMind GeoIP databases. Pretty cool, eh!

But the downside is that to query their database, I have to download individual databases for country city. This is not good cause I have to make the end user download additional files (in MBs) just to look up an IP address.

So I am wondering, is there another method of doing this? How do I trace IP addresses? Note that I need them down to the city level, if possible. Something like this guy aruljohn.com/track.pl

Thanks!

2 Answers 2

2

I would have preferred "pygeoip", because it allows you to develop a complete solution locally. Of course, you will need to keep the database.

If you do not want to keep the database locally, you will have to depend on an external service to query for location of an IP. This will keep your solution small but dependent on this service.

For this check out: ipinfodb.com

They provide JSON and XML APIs interface which should be sufficiently easy to build.

Check out more information at : http://ipinfo.info/html/geolocation_2.php

Sign up to request clarification or add additional context in comments.

3 Comments

The problem with a local solution is that I would want to distribute my app within my friends and I really don't want them downloading the databases just to look up IP addresses. I hope you understand my point. I am going to check out the link and maybe learn JSON in the process ;) Thanks!
@Brian: Yup, I would prefer JSON API but to get started you can use XML API to at least test the waters. See, if this works for you.
But you want them to download your application, possibly along with Qt and Python... :)
1

I have even better idea. Why don't you make a very simple web app, which will do the actual look up; and you PyQt client would do HTTP request to that. Or maybe in that case you don't even need a client. Just make a web page to get IP address and show city.

2 Comments

I don't want to involve a web browser.
Then make both, client and server. BTW, both Apache and Lighttpd have geolocation modules. You'll just need to return the location to your client.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.