Skip to content

Commit 80d723b

Browse files
authored
Merge pull request #44 from ipinfo/silvano/eng-606-update-readme-documentation-for-ipinfoperl
Add documentation for Core and Plus bundles and resproxy
2 parents 7aad94f + 4f479d3 commit 80d723b

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

README.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,66 @@ The returned details are slightly different from the Core API.
168168
use Geo::IPinfoLite;
169169

170170
$access_token = '123456789abc';
171-
$ipinfo = Geo::IPinfo->new($access_token);
171+
$ipinfo = Geo::IPinfoLite->new($access_token);
172172

173173
$ip_address = '216.239.36.21';
174174
$details = $ipinfo->info($ip_address);
175175
$country_code = $details->country_code; # US
176176
$country = $details->country; # United States
177177
```
178178

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.
200+
201+
```perl
202+
use Geo::IPinfoPlus;
203+
204+
$access_token = '123456789abc';
205+
$ipinfo = Geo::IPinfoPlus->new($access_token);
206+
207+
$details = $ipinfo->info('8.8.8.8');
208+
$ip = $details->ip; # 8.8.8.8
209+
$city = $details->geo->{city}; # Mountain View
210+
$mobile = $details->mobile; # mobile carrier info
211+
$is_proxy = $details->anonymous->{is_proxy}; # false
212+
```
213+
214+
### Residential Proxy API
215+
216+
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.
217+
218+
```perl
219+
use Geo::IPinfo;
220+
221+
$access_token = '123456789abc';
222+
$ipinfo = Geo::IPinfo->new($access_token);
223+
224+
$resproxy = $ipinfo->get_resproxy('175.107.211.204');
225+
$ip = $resproxy->{ip}; # 175.107.211.204
226+
$last_seen = $resproxy->{last_seen}; # 2025-01-20
227+
$percent_days_seen = $resproxy->{percent_days_seen}; # 0.85
228+
$service = $resproxy->{service}; # Bright Data
229+
```
230+
179231
#### Caching
180232

181233
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

Comments
 (0)