How to get the Country according to a certain IP?

DylanJ picture DylanJ · Aug 4, 2008 · Viewed 16.9k times · Source

Does anyone know any simple way to retrieve the country from a given IP Address, preferably in ISO_3166-1 format?

Answer

Warren Blanchet picture Warren Blanchet · Sep 15, 2008

There are two approaches: using an Internet service and using some kind of local list (perhaps wrapped in a library). What you want will depend on what you are building.

For services:

For lists: