FREE for Open Source Commercial Use
Use right away in PHP with the official library.
No extra SQL database or table needed.

Documentation

Usage

If your programming language is supported, all you need to do is pass the library method an IP address in dotted decimal notation format.

Default PHP

  <?php
      require_once("Ip2.php");
      
      $ip2 = new \ip2iq\Ip2();
      $country_code = $ip2->country('54.166.172.33');
      //$country_code === 'US'
  ?>

Composer

Add to the require object in your composer.json file:

  "require": {
      "ip2iq/ip2" : "1.0.0"
  }

Code:

  <?php
      require_once(dirname(__FILE__)."/vendor/autoload.php");
      
      $ip2 = new \ip2iq\Ip2();
      $country_code = $ip2->country('54.166.172.33');
      //$country_code === 'US'
  ?>

Official IP2IQ client libraries are primarily developed keeping in mind size, API and performance.

Not ready for a enterprise license yet?

Try our Free Open Source IP To Country Database For Personal or Commercial Use.
Creative Commons License
Open IP2-Country Database by IP2IQ is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.