1GeoIP2::Record::Traits(U3s)er Contributed Perl DocumentatGieoonIP2::Record::Traits(3)
2
3
4
6 GeoIP2::Record::Traits - Contains data for the traits record associated
7 with an IP address
8
10 version 2.006002
11
13 use 5.008;
14
15 use GeoIP2::WebService::Client;
16
17 my $client = GeoIP2::WebService::Client->new(
18 account_id => 42,
19 license_key => 'abcdef123456',
20 );
21
22 my $insights = $client->insights( ip => '24.24.24.24' );
23
24 my $traits_rec = $insights->country();
25 print $traits_rec->name(), "\n";
26
28 This class contains the traits data associated with an IP address.
29
30 This record is returned by all the end points.
31
33 This class provides the following methods:
34
35 $traits_rec->autonomous_system_number()
36 This returns the autonomous system number
37 (<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>)
38 associated with the IP address.
39
40 This attribute is only available from the City and Insights web service
41 endpoints and the GeoIP2 Enterprise database.
42
43 $traits_rec->autonomous_system_organization()
44 This returns the organization associated with the registered autonomous
45 system number
46 (<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) for the
47 IP address.
48
49 This attribute is only available from the City and Insights web service
50 endpoints and the GeoIP2 Enterprise database.
51
52 $traits_rec->connection_type()
53 This returns the connection type associated with the IP address. It may
54 take the following values: "Dialup", "Cable/DSL", "Corporate", or
55 "Cellular". Additional values may be added in the future.
56
57 This attribute is only available in the GeoIP2 Enterprise database.
58
59 $traits_rec->domain()
60 This returns the second level domain associated with the IP address.
61 This will be something like "example.com" or "example.co.uk", not
62 "foo.example.com".
63
64 This attribute is only available from the City and Insights web service
65 endpoints and the GeoIP2 Enterprise database.
66
67 $traits_rec->ip_address()
68 This returns the IP address that the data in the model is for. If you
69 performed a "me" lookup against the web service, this will be the
70 externally routable IP address for the system the code is running on.
71 If the system is behind a NAT, this may differ from the IP address
72 locally assigned to it.
73
74 This attribute is returned by all end points.
75
76 $traits_rec->is_anonymous()
77 This returns a true value if the IP address belongs to any sort of
78 anonymous network and a false value otherwise.
79
80 This attribute is only available from the Insights web service.
81
82 $traits_rec->is_anonymous_proxy()
83 Deprecated. Please see our GeoIP2 Anonymous IP database
84 <https://www.maxmind.com/en/geoip2-anonymous-ip-database> or our GeoIP2
85 Precision Insights service
86 <https://www.maxmind.com/en/geoip2-precision-insights> to determine
87 whether the IP address is used by an anonymizing service.
88
89 This attribute is returned by all end points.
90
91 $traits_rec->is_anonymous_vpn()
92 This returns a true value if the IP address is registered to an
93 anonymous VPN provider and a false value otherwise.
94
95 If a VPN provider does not register subnets under names associated with
96 them, we will likely only flag their IP ranges using the
97 "is_hosting_provider" attribute.
98
99 This attribute is only available from the Insights web service.
100
101 $traits_rec->is_hosting_provider()
102 This returns a true value if the IP address belongs to a hosting or VPN
103 provider and a false value otherwise (see description of
104 "is_anonymous_vpn" attribute).
105
106 This attribute is only available from the Insights web service.
107
108 $traits_rec->is_legitimate_proxy()
109 This attribute returns true if MaxMind believes this IP address to be a
110 legitimate proxy, such as an internal VPN used by a corporation
111
112 This attribute is only available in the GeoIP2 Enterprise database.
113
114 $traits_rec->is_public_proxy()
115 This returns a true value if the IP address belongs to a public proxy
116 and a false value otherwise.
117
118 This attribute is only available from the Insights web service.
119
120 $traits_rec->is_satellite_provider()
121 Deprecated. Due to the increased coverage by mobile carriers, very few
122 satellite providers now serve multiple countries. As a result, the
123 output does not provide sufficiently relevant data for us to maintain
124 it.
125
126 This attribute is returned by all end points.
127
128 $traits_rec->is_tor_exit_node()
129 This returns a true value if the IP address is a Tor exit node and a
130 false value otherwise.
131
132 This attribute is only available from the Insights web service.
133
134 $traits_rec->isp()
135 This returns the name of the ISP associated with the IP address.
136
137 This attribute is only available from the City and Insights web service
138 endpoints and the GeoIP2 Enterprise database.
139
140 $traits_rec->organization()
141 This returns the name of the organization associated with the IP
142 address.
143
144 This attribute is only available from the City and Insights web service
145 endpoints and the GeoIP2 Enterprise database.
146
147 $traits_rec->user_type()
148 This returns the user type associated with the IP address. This can be
149 one of the following values:
150
151 • business
152
153 • cafe
154
155 • cellular
156
157 • college
158
159 • content_delivery_network
160
161 • dialup
162
163 • government
164
165 • hosting
166
167 • library
168
169 • military
170
171 • residential
172
173 • router
174
175 • school
176
177 • search_engine_spider
178
179 • traveler
180
181 This attribute is only available from the Insights end point and the
182 GeoIP2 Enterprise database.
183
185 Bugs may be submitted through
186 <https://github.com/maxmind/GeoIP2-perl/issues>.
187
189 • Dave Rolsky <drolsky@maxmind.com>
190
191 • Greg Oschwald <goschwald@maxmind.com>
192
193 • Mark Fowler <mfowler@maxmind.com>
194
195 • Olaf Alders <oalders@maxmind.com>
196
198 This software is copyright (c) 2013 - 2019 by MaxMind, Inc.
199
200 This is free software; you can redistribute it and/or modify it under
201 the same terms as the Perl 5 programming language system itself.
202
203
204
205perl v5.34.0 2022-01-21 GeoIP2::Record::Traits(3)