GeoIP2...Postal(3pm)
π NAME π
GeoIP2::Record::Postal β bestie, this is the lil record that holds all the postal code data tied to an IP address π€β¨
It's part of the GeoIP2 Perl fam, and the manual page you're reading rn is GeoIP2...Postal(3pm), so hi, you're in the right place π
πΈ VERSION πΈ
version 2.006002 β that's the one, no cap π«Ά
β¨ SYNOPSIS β¨
okay so here's the whole vibe in code form, copy-paste ready:
use 5.008;
use GeoIP2::WebService::Client;
my $client = GeoIP2::WebService::Client->new(
account_id => 42,
license_key => 'abcdef123456',
);
my $insights = $client->insights( ip => '24.24.24.24' );
my $postal_rec = $insights->postal();
print $postal_rec->code(), "\n";
like. you spin up a client, you ask for insights on an IP, you grab the postal record, you print the code. main character behavior fr π
π¦ DESCRIPTION π¦
This class contains the postal code data associated with an IP address. That's the whole job. It's giving "small but mighty" π
Heads up tho: this record is returned by all the end points except the Country end point. So if you're hitting Country, don't come looking for a postal code, she's not there π
π METHODS π
This class provides the following methods, and honestly? Short list. Iconic. We love efficiency.
π $postal_rec->code()
This returns the postal code associated with the IP address.
But listen β postal codes are not available for all countries. And in some countries, this will only contain part of the postal code. So don't be shocked if it's a lil incomplete, it's not broken, that's just how it be π
This attribute is returned by all end points except the Country end point.
π $postal_rec->confidence()
This returns a value from 0-100 indicating MaxMind's confidence that the postal code is correct. Slay, a whole percentage of certainty π―
β οΈ This attribute is only available from the Insights end point and the GeoIP2 Enterprise database. If you're on anything else, she simply does not exist. Don't @ me.
π«Ά SUPPORT π«Ά
Found a bug? Bestie, same. Bugs may be submitted through <https://github.com/maxmind/GeoIP2-perl/issues> β go off, report it, we appreciate you ππ
π AUTHORS π
These absolute legends made this happen:
- Dave Rolsky <drolsky@maxmind.com>
- Greg Oschwald <goschwald@maxmind.com>
- Mark Fowler <mfowler@maxmind.com>
- Olaf Alders <oalders@maxmind.com>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2013 - 2019 by MaxMind, Inc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. fr fr, go wild π
okay that's the whole page, thanks for coming to my TED talk π this was GeoIP2...Postal(3pm), built for perl v5.36.0 and dated 2022-11-21 β stay iconic, bestie, and may your postal codes always resolve πβ¨
π¦ where this page comes from
- debian bookworm: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgeoip2-perl 2.006002-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms