IPinfo 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fdee7360c5440bb6a71dcfca62b1b006688952535a1f594c3b9c3105505665b
4
- data.tar.gz: a177efbb1348e47dfe3ea6c1cdaef9327a33db6b0233db1884b1b27379ed49b5
3
+ metadata.gz: d6282eb576fc945234aef7ca9c295f9a89d93fa215d167424fb99e9752a331dc
4
+ data.tar.gz: 884beb9ffbae642674f7f1c96483f161d6be4df0fe2d3d4c0e2cc01971dd4693
5
5
  SHA512:
6
- metadata.gz: b4f01041c106a9c69d155ab4981090b94d14cc1637dc2bd522920defb87552640bf8b5e9c540b43e221a76bab8ba961ac7241fe9b602de44167606409440d8c4
7
- data.tar.gz: 9f7d2ecce9daf619edf12564690a0281f49f8152b1e3159e34d2e43048862cecae4b55c87baae79e21a3b0371d4cbc2ecdeb3549ec6ee16f18f7327a122e401a
6
+ metadata.gz: a747d32ed94ba0e2876f81d88081843022dc47ab61495a01f609ed020edbe5f9809ddd39020a273629cacc1c41fdbfa773e7bb9216981b71f65a51f95ad72830
7
+ data.tar.gz: 44a438d67208c694e779de9faec0ea6ed2be9a6427b45cec456018d68af2b0c88612f59c7f656cb363041b2ce400696f2b74127b0d1d63cb37b93058a1552a5e
data/Gemfile CHANGED
@@ -10,4 +10,5 @@ group :development do
10
10
  gem 'minitest-reporters'
11
11
  gem 'rake'
12
12
  gem 'rubocop'
13
+ gem 'webmock'
13
14
  end
data/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # [<img src="https://ipinfo.io/static/ipinfo-small.svg" alt="IPinfo" width="24"/>](https://ipinfo.io/) IPinfo Ruby Client Library
2
2
 
3
3
  This is the official Ruby client library for the [IPinfo.io](https://ipinfo.io) IP address API, allowing you to look up your own IP address, or get any of the following details for an IP:
4
- - [IP geolocation data](https://ipinfo.io/ip-geolocation-api) (city, region, country, postal code, latitude, and longitude)
5
- - [ASN information](https://ipinfo.io/asn-api) (ISP or network operator, associated domain name, and type, such as business, hosting, or company)
6
- - [Firmographic data](https://ipinfo.io/ip-company-api) (the name and domain of the business that uses the IP address)
7
- - [Carrier details](https://ipinfo.io/ip-carrier-api) (the name of the mobile carrier and MNC and MCC for that carrier if the IP is used exclusively for mobile traffic)
4
+
5
+ - [IP geolocation data](https://ipinfo.io/ip-geolocation-api) (city, region, country, postal code, latitude, and longitude)
6
+ - [ASN information](https://ipinfo.io/asn-api) (ISP or network operator, associated domain name, and type, such as business, hosting, or company)
7
+ - [Firmographic data](https://ipinfo.io/ip-company-api) (the name and domain of the business that uses the IP address)
8
+ - [Carrier details](https://ipinfo.io/ip-carrier-api) (the name of the mobile carrier and MNC and MCC for that carrier if the IP is used exclusively for mobile traffic)
8
9
 
9
10
  Check all the data we have for your IP address [here](https://ipinfo.io/what-is-my-ip).
10
11
 
@@ -234,6 +235,58 @@ details.country_code # US
234
235
  details.country # United States
235
236
  ```
236
237
 
238
+ ### Core API
239
+
240
+ 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.
241
+
242
+ ```ruby
243
+ require 'ipinfo_core'
244
+
245
+ access_token = '123456789abc'
246
+ handler = IPinfoCore::create(access_token)
247
+
248
+ details = handler.details('8.8.8.8')
249
+ details.ip # 8.8.8.8
250
+ details.geo['city'] # Mountain View
251
+ details.geo['country'] # United States
252
+ details.as['asn'] # AS15169
253
+ details.as['name'] # Google LLC
254
+ ```
255
+
256
+ ### Plus API
257
+
258
+ 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.
259
+
260
+ ```ruby
261
+ require 'ipinfo_plus'
262
+
263
+ access_token = '123456789abc'
264
+ handler = IPinfoPlus::create(access_token)
265
+
266
+ details = handler.details('8.8.8.8')
267
+ details.ip # 8.8.8.8
268
+ details.geo['city'] # Mountain View
269
+ details.mobile # mobile carrier info
270
+ details.anonymous['is_proxy'] # false
271
+ ```
272
+
273
+ ### Residential Proxy API
274
+
275
+ 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.
276
+
277
+ ```ruby
278
+ require 'ipinfo'
279
+
280
+ access_token = '123456789abc'
281
+ handler = IPinfo::create(access_token)
282
+
283
+ resproxy = handler.get_resproxy('175.107.211.204')
284
+ resproxy.ip # 175.107.211.204
285
+ resproxy.last_seen # 2025-01-20
286
+ resproxy.percent_days_seen # 0.85
287
+ resproxy.service # Bright Data
288
+ ```
289
+
237
290
  #### Caching
238
291
 
239
292
  In-memory caching of `details` data is provided by default via the
@@ -250,9 +303,9 @@ Cache behavior can be modified by setting the `cache_options` keyword argument.
250
303
  specified in the `cachetools` library. The nesting of keyword arguments is to
251
304
  prevent name collisions between this library and its dependencies.
252
305
 
253
- * Default maximum cache size: 4096 (multiples of 2 are recommended to increase
306
+ - Default maximum cache size: 4096 (multiples of 2 are recommended to increase
254
307
  efficiency)
255
- * Default TTL: 24 hours (in seconds)
308
+ - Default TTL: 24 hours (in seconds)
256
309
 
257
310
  ```ruby
258
311
  token = '1234'
@@ -559,7 +559,7 @@ module CountriesData
559
559
  "BD" => {"code" => "BDT" ,"symbol" => "৳"},
560
560
  "BE" => {"code" => "EUR" ,"symbol" => "€"},
561
561
  "BF" => {"code" => "XOF" ,"symbol" => "CFA"},
562
- "BG" => {"code" => "BGN" ,"symbol" => "лв"},
562
+ "BG" => {"code" => "EUR" ,"symbol" => ""},
563
563
  "BH" => {"code" => "BHD" ,"symbol" => ".د.ب"},
564
564
  "BI" => {"code" => "BIF" ,"symbol" => "FBu"},
565
565
  "BJ" => {"code" => "XOF" ,"symbol" => "CFA"},
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IPinfo
4
- VERSION = '2.5.0'
4
+ VERSION = '2.6.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: IPinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - IPinfo releases
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-01-22 00:00:00.000000000 Z
11
+ date: 2026-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday