NAME

IP::Info - Interface to IP geographic and network data.

VERSION

Version 0.04

DESCRIPTION

Quova RESTful API provides the geographic location and network data for any Internet Protocol address in the public address space. The information includes:

  • Postal code, city, state, region, country, and continent

  • Area code (US and Canada only) and time zone

  • Longitude and latitude

  • DMA (Designated Market Area) and MSA (Metropolitan Statistical Area)

  • Network information, including type, speed, carrier, and registering organization

CONSTRUCTOR

The constructor requires the following parameters as listed below:

+--------+----------+---------------------------------------+
| Key    | Required | Description                           |
+--------+----------+---------------------------------------+
| apikey |   Yes    | API Key given by Quova                |
| secret |   Yes    | Allocated share secret given by Quova |
| format |   No     | xml or json. Default is xml           |
+--------+----------+---------------------------------------+

To obtain your Quova API key (apikey) and the shared secret, register your application here at http://developer.quova.com/

use strict; use warnings;
use IP::Info;

my ($apikey, $secret, $format, $info);
$apikey = 'Your_API_Key';
$secret = 'Your_shared_secret';
$format = 'json';

$info  = IP::Info->new($apikey, $secret);
# or
$info  = IP::Info->new($apikey, $secret, $format);
# or
$info  = IP::Info->new({ apikey => $apikey, secret => $secret});
# or
$info  = IP::Info->new({ apikey => $apikey, secret => $secret, format => $format});

METHODS

ipaddress()

If an IP address is specified in the correct format, then the call returns an object of type IP::Info::Response object which can be queried further to look for specific information for that IP.

The IP must be a standard, 32-bit IPv4 address. The allowed IP formats are

  • dot-decimal e.g. 4.2.2.2

  • decimal notation e.g. 67240450

use strict; use warnings;
use IP::Info;

my $apikey = 'Your_API_Key';
my $secret = 'Your_shared_secret';
my $ipaddress = '4.2.2.2';
my $info = IP::Info->new($apikey, $secret);
my $response = $info->ipaddress($ipaddress);
print "Country: [".$response->country(). "]\n";

schema()

It returns the XML Schema Document (.xsd file).

use strict; use warnings;
use IP::Info;

my $apikey = 'Your_API_Key';
my $secret = 'Your_shared_secret';
my $info  = IP::Info->new($apikey, $secret);
print $info->schema();

AUTHOR

Mohammad S Anwar, <mohammad.anwar at yahoo.com>

BUGS

Please report any bugs or feature requests to bug-ip-info at rt.cpan.org or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=IP-Info. I will be notified and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc IP::Info

You can also look for information at:

LICENSE AND COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

DISCLAIMER

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.