Acme-Free-API-Geodata-GeoIP

 view release on metacpan or  search on metacpan

lib/Acme/Free/API/Geodata/GeoIP.pm  view on Meta::CPAN

  my $geodata = $agent->lookup('24.48.0.1');

  if(!defined($geodata)) {
      die("Lookup failed");
  }

  print "$ip is hosted by ", $geodata->{org}, " in ", $geodata->{city}, " (", $geodata->{country}, ")\n";

=head1 DESCRIPTION

This module looks up GeoIP data through a public API, see L<https://www.freepublicapis.com/ip-geolocation-api>.

It returns a hashref on success, undefined on failure. To see what went wrong, set debug to a true value in new().

=head1 SEE ALSO

Call for API implementations on PerlMonks: L<https://perlmonks.org/?node_id=11161472>

=head1 AUTHOR

Rene Schickbauer, E<lt>cavac@cpan.orgE<gt>

=head1 SOURCECODE

Source code is available on my mercurial repo: L<https://cavac.at/public/mercurial/Acme-Free-API-Geodata-GeoIP/>

And no, i do NOT use GitHub for my projects, so don't ask.

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2024 by Rene Schickbauer

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.38.2 or,
at your option, any later version of Perl 5 you may have available.



( run in 0.385 second using v1.01-cache-2.11-cpan-c6e0e5ac2a7 )