WebService::IPStack - Perl library for using IPStack, https://ipstack.com.
use WebService::IPStack; my $ipstack = WebService::IPStack->new(api_key => 'foobar'); $ipstack->query('8.8.8.8'); # Only for Pro plan. $ipstack->query(['8.8.8.8', '8.8.4.4']);
WebService::IPStack is a Perl library for obtaining information on IPv4 or IPv6 address.
Source repo at https://github.com/kianmeng/webservice-ipstack.
How to contribute? Follow through the CONTRIBUTING.md document to setup your development environment.
Construct a new WebService::IPStack instance.
Compulsory. The API access key used to make request through web service.
Optional. The API subscription plan used when accessing the API. There are four subscription plans: free, standard, pro, and pro_plus. By default, the subscription plan is 'free'. The main difference between free and non-free subscription plans are HTTPS encryption protocol support and additional information.
# The API request URL is http://api.ipstack.com/ my $ipstack = WebService::IPStack->new(api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx32'); print $ipstack->api_url; # The API request URL is https://api.ipstack.com/ my $ipstack = WebService::IPStack->new(api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx32', api_plan => 'paid'); print $ipstack->api_url;
The default API hostname and path. The protocol depends on the subscription plan.
Query and get an IP address information. Optionally you can add more settings to adjust the output.
my $ipstack = WebService::IPStack->new(api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx32'); $ipstack->query('8.8.8.8'); # With optional parameters. $ipstack->query('8.8.8.8', {hostname => 1, security => 1, output => 'xml'});
Only for Paid subscription plan. Query and get multiple IP addresses information. Optionally you can add more settings to adjust the output.
my $ipstack = WebService::IPStack->new(api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx32', api_plan => 'paid'); $ipstack->query(['8.8.8.8', '8.8.4.4']); # With optional parameters. $ipstack->query(['8.8.8.8', '8.8.4.4'], {language => 'zh'});
Look up the IP address details of the client which made the web service call. Optionally you can add more settings to adjust the output.
my $ipstack = WebService::IPStack->new(api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx32'); $ipstack->check(); # With optional parameters. $ipstack->check({hostname => 1, security => 1, output => xml});
This software is Copyright (c) 2019 Kian Meng, Ang.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Kian Meng, Ang <kianmeng@users.noreply.github.com>
To install WebService::IPStack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::IPStack
CPAN shell
perl -MCPAN -e shell install WebService::IPStack
For more information on module installation, please visit the detailed CPAN module installation guide.