GeoIP2...Postal(3pm)

πŸ“¦
version 2.006002 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’Œ 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>

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