You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,14 +168,66 @@ The returned details are slightly different from the Core API.
168
168
use Geo::IPinfoLite;
169
169
170
170
$access_token = '123456789abc';
171
-
$ipinfo = Geo::IPinfo->new($access_token);
171
+
$ipinfo = Geo::IPinfoLite->new($access_token);
172
172
173
173
$ip_address = '216.239.36.21';
174
174
$details = $ipinfo->info($ip_address);
175
175
$country_code = $details->country_code; # US
176
176
$country = $details->country; # United States
177
177
```
178
178
179
+
### Core API
180
+
181
+
The library also supports the [Core API](https://ipinfo.io/developers/data-types#core-data), which provides city-level geolocation with nested geo and AS objects. Authentication with your token is required.
182
+
183
+
```perl
184
+
use Geo::IPinfoCore;
185
+
186
+
$access_token = '123456789abc';
187
+
$ipinfo = Geo::IPinfoCore->new($access_token);
188
+
189
+
$details = $ipinfo->info('8.8.8.8');
190
+
$ip = $details->ip; # 8.8.8.8
191
+
$city = $details->geo->{city}; # Mountain View
192
+
$country = $details->geo->{country}; # United States
193
+
$asn = $details->as->{asn}; # AS15169
194
+
$as_name = $details->as->{name}; # Google LLC
195
+
```
196
+
197
+
### Plus API
198
+
199
+
The library also supports the [Plus API](https://ipinfo.io/developers/data-types#plus-data), which provides enhanced data including mobile carrier info and privacy detection. Authentication with your token is required.
The library also supports the [Residential Proxy API](https://ipinfo.io/developers/residential-proxy-api), which allows you to check if an IP address is a residential proxy. Authentication with your token is required.
In-memory caching of `Details` data is provided by default via the [Cache::LRU](https://metacpan.org/pod/Cache::LRU) package. This uses an LRU (least recently used) cache with a TTL (time to live) by default. This means that values will be cached for the specified duration; if the cache's max size is reached, cache values will be invalidated as necessary, starting with the oldest cached value.
0 commit comments