23

We're looking for a fast and accurate way to get the visitors location based on their IP.

We have tried ipinfodb.com but their API made our website severely lag when making the API call.

What else can I do?

1

1 Answer 1

3

Try this one http://ip.codehelper.io/

Here is PHP code. The code will caching your request automatic, so your server will not send multiple request. Return IP Address, Country, City and more information.

<?php
// Required Libraries
require_once("ip.codehelper.io.php");
require_once("php_fast_cache.php");

// New Class
$_ip = new ip_codehelper();

// Detect Real IP Address & Location
$real_client_ip_address = $_ip->getRealIP();
$visitor_location       = $_ip->getLocation($real_client_ip_address);

// Output result
echo $visitor_location['Country']."";
echo "<pre>";
print_r($visitor_location);

Not the answer you're looking for? Browse other questions tagged or ask your own question.