Geo::IPinfo - The official Perl library for IPinfo.
Version 2.0.0 - Included support for country names and caching.
Geo::IP The official Perl library for IPinfo. IPinfo prides itself on being the most reliable, accurate, and in-depth source of IP address data available anywhere. We process terabytes of data to produce our custom IP geolocation, company, carrier and IP type data sets. You can visit our developer docs at https://ipinfo.io/developers.
A quick usage example:
$access_token = '123456789abc';
$ipinfo = Geo::IPinfo->new($access_token);
$ip_address = '18.104.22.168';
$details = $ipinfo->info($ip_address);
$city = $details->city; # Emeryville
$loc = $details->loc; # 37.8342,-122.2900
Create an ipinfo object. The 'token' (string value) and 'options' (hash value) arguments are optional.
If 'token' is specified, then it's used to overcome the default non-commercial limitation of 1,000 request/day (For more details, see https://ipinfo.io/pricing)
if 'options' is specfied, the included values will allow control over cache policies and country name localization (For more details, see https://github.com/ipinfo/perl).
Returns a reference to a Details object containing all information related to the IP address. In case of errors, returns undef, the error message can be retrieved with the function 'error_msg()'
The values can be accessed with the named methods: ip, hostname, city, region, country, country_name, loc, latitude, longitude, postal, asn, company, carrier, and all.
Returns a reference to an object containing only the geolocation related data. Returns undef in case of errors, the error message can be retrieved with the function 'error_msg'
It's usually faster than getting the full response using 'info()'
The values returned are: ip, loc, city, region, country
Returns a reference to an object containing only the field related data. Returns undef if the field is invalid
The possible values of 'field_name' are: ip, hostname, city, region, country, loc, org
Returns a string containing the error message of the last operation, it returns an empty string if the last operation was successful
Ben Dowling, <ben at ipinfo dot io>
<ben at ipinfo dot io>
Please report any bugs or feature requests to bug-geo-ipinfo at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geo-IPinfo. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-geo-ipinfo at rt.cpan.org
You can find documentation for this module with the perldoc command.
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
AnnoCPAN: Annotated CPAN documentation
Copyright 2019 ipinfo.io.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
To install Geo::IPinfo, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.