views:

90

answers:

3

I use PHP and I want to know if there's a free web service that can detect the countries of my visitors. Right now i can get their IPs and I have downloaded some IPtables that relate some locations but i don.t think they're quite accurate. So if you are aware of some free webservice it would be just great. Thanks!

+2  A: 

You could look around at MaxMind's open source solutions.

fabrik
i tried the GeoIP Country link... but it says that i have to pay a 50$USD license fee :(
leanyo martinet
You'll need to use GeoLite libraries at the Open Source section.
fabrik
A: 

You could download and use this database http://software77.net/geo-ip/

NixNinja
cool, but i was actually looking for a web service, thanks anyways
leanyo martinet
+2  A: 

I have used the following SOAP GeoIPService to good effect from webservicex.net.

You will also of course need to enable SOAP support in your PHP config.

You could then try something like:

$client = new SoapClient("http://www.webservicex.net/geoipservice.asmx?WSDL");
$params = new stdClass;
$params->IPAddress = 'xxx.xxx.xxx.xxx';
$result = $client->GetGeoIP($params);
// Check for errors...
$country = $result->GetGeoIPResult->CountryName;
hydrogen
it looks niche, i'll try it at home and if everything's OK i'll check this one as the best answer :)
leanyo martinet
You could also try http://ipinfodb.com/ip_location_api.php which is another good free one if the above doesn't work out for you. I would take the results with a grain of salt though as it is free so you can't expect them to be 100% accurate.
hydrogen