GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Geo::IP2Location(3) User Contributed Perl Documentation Geo::IP2Location(3)

Geo::IP2Location - Fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code and station, MCC, MNC, mobile carrier brand name, elevation and usage type from IP address by using IP2Location database. It supports both IPv4 and IPv6 addressing. Please visit http://www.ip2location.com for more information.

  use Geo::IP2Location;
        my $obj = Geo::IP2Location->open("IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE-ISP-DOMAIN-NETSPEED-AREACODE-WEATHER-MOBILE-ELEVATION-USAGETYPE.BIN");

        my $dbversion = $obj->get_database_version();
        my $moduleversion = $obj->get_module_version();
        my $countryshort = $obj->get_country_short("20.11.187.239");
        my $countrylong = $obj->get_country_long("20.11.187.239");
        my $region = $obj->get_region("20.11.187.239");
        my $city = $obj->get_city("20.11.187.239");
        my $latitude = $obj->get_latitude("20.11.187.239");
        my $longitude = $obj->get_longitude("20.11.187.239");
        my $isp = $obj->get_isp("20.11.187.239");
        my $domain = $obj->get_domain("20.11.187.239");
        my $zipcode = $obj->get_zipcode("20.11.187.239");
        my $timezone = $obj->get_timezone("20.11.187.239");
        my $netspeed = $obj->get_netspeed("20.11.187.239");
        my $iddcode = $obj->get_iddcode("20.11.187.239");
        my $areacode = $obj->get_areacode("20.11.187.239");
        my $weatherstationcode = $obj->get_weatherstationcode("20.11.187.239");
        my $weatherstationname = $obj->get_weatherstationname("20.11.187.239");
        my $mcc = $obj->get_mcc("20.11.187.239");
        my $mnc = $obj->get_mnc("20.11.187.239");
        my $brand = $obj->get_mobilebrand("20.11.187.239");
        my $elevation = $obj->get_elevation("20.11.187.239");
        my $usagetype = $obj->get_usagetype("20.11.187.239");

        ($cos, $col, $reg, $cit, $lat, $lon, $zip, $tmz, $isp, $dom, $ns, $idd, $area, $wcode, $wname, $mcc, $mnc, $brand, $elevation, $usagetype) = $obj->get_all("20.11.187.239");
        ($cos, $col, $reg, $cit, $lat, $lon, $zip, $tmz, $isp, $dom, $ns, $idd, $area, $wcode, $wname, $mcc, $mnc, $brand, $elevation, $usagetype) = $obj->get_all("2001:1000:0000:0000:0000:0000:0000:0000");

This Perl module provides fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code and station, MCC, MNC, mobile carrier brand, elevation and usage type from IP address using IP2Location database. This module uses a file based .BIN database available at http://www.ip2location.com upon subscription. This database contains IP blocks as keys and other information as values. It supports IP address in IPv4 or IPv6.

This module can be used in many types of project such as:

 1) select the geographically closest mirror
 2) analyze web server logs to determine the countries of visitors
 3) credit card fraud detection
 4) software export controls
 5) display native language and currency
 6) prevent password sharing and abuse of service
 7) geotargeting in advertisement

The complete IPv4 and IPv6 database are available at:

http://www.ip2location.com

The database will be updated in monthly basis for greater accuracy. Free sample database is available at:

http://www.ip2location.com/developers

$obj = Geo::IP2Location->open($database_file);
Constructs a new Geo::IP2Location object with the database located at $database_file.

$countryshort = $obj->get_country_short( $ip );
Returns the ISO 3166 country code of IP address or domain name. Returns "-" for unassigned or private IP address.
$countrylong = $obj->get_country_long( $ip );
Returns the full country name of IP address or domain name. Returns "-" for unassigned or private IP address.
$region = $obj->get_region( $ip );
Returns the region of IP address or domain name.
$city = $obj->get_city( $ip );
Returns the city of IP address or domain name.
$latitude = $obj->get_latitude( $ip );
Returns the latitude of IP address or domain name.
$longitude = $obj->get_longitude( $ip );
Returns the longitude of IP address or domain name.
$isp = $obj->get_isp( $ip );
Returns the ISP name of IP address or domain name.
$domain = $obj->get_domain( $ip );
Returns the domain name of IP address or domain name.
$zip = $obj->get_zipcode( $ip );
Returns the ZIP code of IP address or domain name.
$tz = $obj->get_timezone( $ip );
Returns the time zone of IP address or domain name.
$ns = $obj->get_netspeed( $ip );
Returns the connection type (DIAL, DSL or COMP) of IP address or domain name.
$idd = $obj->get_iddcode( $ip );
Returns the country IDD calling code of IP address or domain name.
$area = $obj->get_areacode( $ip );
Returns the phone area code code of IP address or domain name.
$wcode = $obj->get_weatherstationcode( $ip );
Returns the nearest weather station code of IP address or domain name.
$wname = $obj->get_weatherstationname( $ip );
Returns the nearest weather station name of IP address or domain name.
$mcc = $obj->get_mcc( $ip );
Returns the mobile carrier code (MCC) of IP address or domain name.
$mnc = $obj->get_mnc( $ip );
Returns the mobile network code (MNC) of IP address or domain name.
$brand = $obj->get_mobilebrand( $ip );
Returns the mobile carrier brand of IP address or domain name.
$elevation = $obj->get_elevation( $ip );
Returns the elevation of IP address or domain name.
$usagetype = $obj->get_usagetype( $ip );
Returns the usage type of IP address or domain name.
($cos, $col, $reg, $cit, $lat, $lon, $zip, $tmz, $isp, $dom, $ns, $idd, $area, $wcode, $wname, $mcc, $mnc, $brand, $elevation, $usagetype) = $obj->get_all( $ip );
Returns an array of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code and station, MCC, MNC, mobile carrier brand, elevation and usage type of IP address.
$dbversion = $obj->get_database_version();
Returns the version number of database.
$moduleversion = $obj->get_module_version();
Returns the version number of Perl module.

http://www.ip2location.com

8.01

Copyright (c) 2016 IP2Location.com

All rights reserved. This package is free software; It is licensed under the GPL.

Hey! The above document had some coding errors, which are explained below:
Around line 1407:
You forgot a '=back' before '=head1'
2018-03-02 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.