internetdata 2.20.1 → 2.21.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 +4 -4
- data/README.md +11 -10
- data/lib/internetdata/api/database_v2_api.rb +1 -1
- data/lib/internetdata/api_client.rb +1 -1
- data/lib/internetdata/api_error.rb +1 -1
- data/lib/internetdata/api_model_base.rb +1 -1
- data/lib/internetdata/asn_result.rb +35 -25
- data/lib/internetdata/cache.rb +5 -5
- data/lib/internetdata/client.rb +12 -12
- data/lib/internetdata/configuration.rb +1 -1
- data/lib/internetdata/domain_result.rb +23 -22
- data/lib/internetdata/middleware/core.rb +6 -6
- data/lib/internetdata/models/abuse_contact.rb +9 -9
- data/lib/internetdata/models/asn.rb +2 -2
- data/lib/internetdata/models/asn_hosted_domains.rb +2 -2
- data/lib/internetdata/models/asn_lookup_response.rb +20 -20
- data/lib/internetdata/models/asn_prefix.rb +1 -1
- data/lib/internetdata/models/batch_lookup_error.rb +1 -1
- data/lib/internetdata/models/bit_torrent_detail.rb +1 -1
- data/lib/internetdata/models/bot_detail.rb +1 -1
- data/lib/internetdata/models/carrier_detail.rb +1 -1
- data/lib/internetdata/models/class_detail.rb +1 -1
- data/lib/internetdata/models/client_registration.rb +1 -1
- data/lib/internetdata/models/cohosted_domains.rb +2 -2
- data/lib/internetdata/models/company.rb +4 -4
- data/lib/internetdata/models/database.rb +1 -1
- data/lib/internetdata/models/database_checksums_response.rb +1 -1
- data/lib/internetdata/models/database_format.rb +1 -1
- data/lib/internetdata/models/database_list.rb +1 -1
- data/lib/internetdata/models/database_metadata.rb +1 -1
- data/lib/internetdata/models/database_metadata_column.rb +1 -1
- data/lib/internetdata/models/database_version.rb +1 -1
- data/lib/internetdata/models/db_checksums.rb +1 -1
- data/lib/internetdata/models/device_authorization.rb +1 -1
- data/lib/internetdata/models/disposable_detail.rb +1 -1
- data/lib/internetdata/models/dns_address_record.rb +1 -1
- data/lib/internetdata/models/dns_cname_record.rb +1 -1
- data/lib/internetdata/models/dns_mx_record.rb +1 -1
- data/lib/internetdata/models/dns_ns_record.rb +1 -1
- data/lib/internetdata/models/dns_resolver_detail.rb +1 -1
- data/lib/internetdata/models/domain_backlinks.rb +2 -2
- data/lib/internetdata/models/domain_dns.rb +2 -2
- data/lib/internetdata/models/domain_host.rb +1 -1
- data/lib/internetdata/models/domain_ip_range.rb +1 -1
- data/lib/internetdata/models/domain_ip_ranges.rb +2 -2
- data/lib/internetdata/models/domain_lookup_response.rb +6 -6
- data/lib/internetdata/models/domain_redirects.rb +2 -2
- data/lib/internetdata/models/domain_web.rb +2 -2
- data/lib/internetdata/models/domain_web_links.rb +1 -1
- data/lib/internetdata/models/download.rb +1 -1
- data/lib/internetdata/models/download_list.rb +1 -1
- data/lib/internetdata/models/entitlement.rb +1 -1
- data/lib/internetdata/models/entitlement_apikey.rb +1 -1
- data/lib/internetdata/models/entitlement_plan.rb +3 -3
- data/lib/internetdata/models/entitlement_usage.rb +4 -4
- data/lib/internetdata/models/error_envelope.rb +1 -1
- data/lib/internetdata/models/hosted_domains.rb +2 -2
- data/lib/internetdata/models/location.rb +11 -11
- data/lib/internetdata/models/lookup_response.rb +33 -67
- data/lib/internetdata/models/oauth_metadata.rb +1 -1
- data/lib/internetdata/models/proxy_detail.rb +2 -2
- data/lib/internetdata/models/pubproxy_detail.rb +1 -1
- data/lib/internetdata/models/rwhois.rb +2 -2
- data/lib/internetdata/models/satellite_detail.rb +1 -1
- data/lib/internetdata/models/smtp_detail.rb +1 -1
- data/lib/internetdata/models/ssh_detail.rb +1 -1
- data/lib/internetdata/models/standing.rb +1 -1
- data/lib/internetdata/models/token_response.rb +1 -1
- data/lib/internetdata/models/user_agent_verdict.rb +1 -1
- data/lib/internetdata/models/web_detail.rb +1 -1
- data/lib/internetdata/models/whois.rb +2 -2
- data/lib/internetdata/result.rb +70 -58
- data/lib/internetdata/transport.rb +6 -6
- data/lib/internetdata/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5ffb036f8d9a9d5580bee8eed53d36d64bf5527946dea423df6a348ba926aa9a
|
|
4
|
+
data.tar.gz: fb7537f99dbfdfef3f593bafb9caab8fa0556a1be6cc776aca1964609db1d583
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc91a8296a714763639de2e1914d98f1cbbb3b6efb9c468d8c1e4cb7acf7691744bac8d7621ffdb42bbbf102764869afeab17188b7d5652fd90793a9001bd5de
|
|
7
|
+
data.tar.gz: 9823af087d0151cd057b846ad99dcff7e203b032cf86494f2d25b2e244f9cfde1b197176a78b5fb1c4035ec6ec21467c137d2005e93e8561c12071e34e53d9ea
|
data/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Requires Ruby 3.3 or newer, and libcurl at runtime, which the `curl` package bri
|
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
25
25
|
|
|
26
|
-
**No API key needed to
|
|
26
|
+
**No API key needed to try it.** A lookup without one answers the basics: an address's location, network and reverse DNS, and its Tor, relay and anycast flags. The address's company and its abuse contact are not in the basics: they come with a free key's full answers or a paid plan. A free key answers every field on its organization's first lookups each UTC day, then the basics.
|
|
27
27
|
|
|
28
28
|
```ruby
|
|
29
29
|
require 'internetdata'
|
|
@@ -38,7 +38,7 @@ result.is_tor # => false
|
|
|
38
38
|
|
|
39
39
|
### With an API key
|
|
40
40
|
|
|
41
|
-
A paid plan answers every field: the VPN, proxy, hosting and CDN flags as well, the detail behind each flag, and an address's city, Whois, RWHOIS and hosted domains. A free
|
|
41
|
+
A paid plan answers every field: the VPN, proxy, hosting and CDN flags as well, the detail behind each flag, and an address's city, Whois, RWHOIS and hosted domains. A free key answers every field on its organization's first lookups each UTC day, then the basics. Create a key in the [console](https://app.internetdata.io), then pass it in:
|
|
42
42
|
|
|
43
43
|
```ruby
|
|
44
44
|
client = InternetData::Client.new(api_key: ENV['INTERNETDATA_API_KEY'])
|
|
@@ -82,13 +82,13 @@ acct.usage.requests # => 580
|
|
|
82
82
|
acct.usage.window_end # => when the allowance resets
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
Usage counts against the anniversary of your subscription on a paid plan, not the calendar month and not the billing period, and against
|
|
85
|
+
Usage counts against the anniversary of your subscription on a paid plan, not the calendar month and not the billing period, and against the UTC day on the free plan; it is the same number a lookup is gated on. `hard_limit` is `nil` on an uncapped plan, which is not the same as zero.
|
|
86
86
|
|
|
87
87
|
Show `plan.name` and compare against `plan.key`: a plan's name can change, and its key never does. A value the API adds later to a plan's `tier`, a database's `standing` or `license_type`, a format or a download's `outcome` comes back as the string it served (from 2.20.0), so check for the values you know rather than assuming the list is complete.
|
|
88
88
|
|
|
89
89
|
### Is that crawler who it says it is?
|
|
90
90
|
|
|
91
|
-
Pass the `User-Agent` of the request you are deciding on, and with every field (a paid plan, or a free
|
|
91
|
+
Pass the `User-Agent` of the request you are deciding on, and with every field (a paid plan, or a free key's full answers) the answer says whose agent it names and whether this address bears that out:
|
|
92
92
|
|
|
93
93
|
```ruby
|
|
94
94
|
result = client.lookup('66.249.66.1', user_agent: request.user_agent)
|
|
@@ -97,7 +97,7 @@ result.user_agent # => {"agent"=>"Googlebot", "kind"=>"bot", "verdict"=>"verifi
|
|
|
97
97
|
results = client.lookup_batch(ips, user_agents: { '66.249.66.1' => request.user_agent })
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
`verdict` is `verified` where the agent's operator vouches for the address, `spoofed` where it does not, `unverifiable` for a bot nothing published can confirm, and `not_bot` for a browser, an app or a script. `my_ip` takes `user_agent:` too. A batch's `user_agents` is keyed by each address as you list it, and an address with no agent, or an empty one, is looked up plainly. An answer with an agent is cached apart from the address's plain answer and from another agent's.
|
|
100
|
+
`verdict` is `verified` where the agent's operator vouches for the address, `spoofed` where it does not, `unverifiable` for a bot nothing published can confirm, and `not_bot` for a browser, an app or a script. `my_ip` takes `user_agent:` too. A batch's `user_agents` is keyed by each address as you list it, and an address with no agent, or an empty one, is looked up plainly. An answer with an agent is cached apart from the address's plain answer and from another agent's. The basics, a private address's answer and a lookup that sent none carry no `user_agent` (`nil`).
|
|
101
101
|
|
|
102
102
|
### Batch lookup
|
|
103
103
|
|
|
@@ -268,7 +268,7 @@ end
|
|
|
268
268
|
|
|
269
269
|
`kind` is one of `:bad_request`, `:unauthorized`, `:forbidden`, `:rate_limited`, `:quota_exceeded`, `:server_error` or `:network`. A lookup's `message` is the API's own words; a database call's refusal also carries `rc`, the API's result code, such as `NOT_LICENSED` or `LICENSE_EXPIRED`.
|
|
270
270
|
|
|
271
|
-
Note that `:rate_limited` and `:quota_exceeded` both arrive as HTTP 429 and are not the same thing. A rate limit is when the API faces extreme traffic bursts and so retrying later works; but a 429 without `Retry-After` is `:quota_exceeded`, which the library never retries. The API
|
|
271
|
+
Note that `:rate_limited` and `:quota_exceeded` both arrive as HTTP 429 and are not the same thing. A rate limit is when the API faces extreme traffic bursts and so retrying later works; but a 429 without `Retry-After` is `:quota_exceeded`, which the library never retries. The API sends one when a source address's lookups without a key are used up for the day, and a free key answers past it; something in between, such as a proxy, may send one too. A paid key past its overage cap gets `cap_reached` instead. It waits the `Retry-After` the API sent, or its own backoff from 250 ms when that's past about 24.8 days.
|
|
272
272
|
|
|
273
273
|
### Sign in with OAuth (device flow)
|
|
274
274
|
|
|
@@ -317,13 +317,14 @@ Each redirect URI must be https on a public host name, or http on a loopback add
|
|
|
317
317
|
|
|
318
318
|
### Absent is not false
|
|
319
319
|
|
|
320
|
-
|
|
320
|
+
The basics leave out the VPN, proxy, hosting, CDN, bot, carrier, satellite, SSH, SMTP, web, DNS resolver and BitTorrent flags and their detail (`bot` names the bot behind `is_bot`), the network's type, an address's company and its abuse contact, an address's city and the rest of its paid location, its Whois, RWHOIS and hosted domains, and the paid members inside each shared object, such as `location['city']`. A free key's answer carries `trial_expired`, which keeps that name: true once its organization's full answers for the UTC day are used, when the answer has the basics. A paid key's carries `cap_reached`, true once its organization's overage cap is reached, when the answer has the basics and isn't billed. A field is present when your plan includes it and `nil` when it does not. `nil` means "not in your plan"; `false` means "we checked, and no".
|
|
321
321
|
|
|
322
322
|
```ruby
|
|
323
323
|
result.vpn? # false when absent, for when you only want the flag
|
|
324
|
-
result.included?(:is_vpn) # false on
|
|
325
|
-
result.
|
|
326
|
-
result.
|
|
324
|
+
result.included?(:is_vpn) # false on the basics: not in your plan
|
|
325
|
+
result.company # nil on the basics, and so is result.abuse
|
|
326
|
+
result.location.key?('city') # false on the basics
|
|
327
|
+
result.trial_expired == true # a free key's full answers for the day are used
|
|
327
328
|
result.cap_reached == true # a paid key is past its overage cap
|
|
328
329
|
```
|
|
329
330
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.28
|
|
7
7
|
Contact: support@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.28
|
|
7
7
|
Contact: support@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.28
|
|
7
7
|
Contact: support@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.28
|
|
7
7
|
Contact: support@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -4,11 +4,11 @@ module InternetData
|
|
|
4
4
|
# What a lookup of an AS answers.
|
|
5
5
|
#
|
|
6
6
|
# As with {Result}, an absent member is one your plan does not include, and
|
|
7
|
-
# reads as `nil`, never as 0 or an empty string:
|
|
7
|
+
# reads as `nil`, never as 0 or an empty string: the basics are the AS's
|
|
8
8
|
# registration (`asn`, `name`, `country`, `registry`, `allocated`, `domain`),
|
|
9
|
-
# and paid plans and
|
|
10
|
-
# wire values with their original string keys, as are
|
|
11
|
-
# the neighbor lists.
|
|
9
|
+
# and paid plans and a free key's full answers add the rest. `whois` and
|
|
10
|
+
# `prefixes` are the wire values with their original string keys, as are
|
|
11
|
+
# `hosted_domains` and the neighbor lists.
|
|
12
12
|
class AsnResult
|
|
13
13
|
include Answer
|
|
14
14
|
|
|
@@ -43,61 +43,64 @@ module InternetData
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
# The kind of network it runs, or nil when your plan does not include it.
|
|
46
|
-
# Paid plans and
|
|
46
|
+
# Paid plans and a free key's full answers.
|
|
47
47
|
def type
|
|
48
48
|
@raw['type']
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
# IPv4 addresses it announces. Paid plans and
|
|
51
|
+
# IPv4 addresses it announces. Paid plans and a free key's full answers.
|
|
52
52
|
def num_ips
|
|
53
53
|
@raw['num_ips']
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
# IPv4 prefixes it announces. Paid plans and
|
|
56
|
+
# IPv4 prefixes it announces. Paid plans and a free key's full answers.
|
|
57
57
|
def num_prefixes4
|
|
58
58
|
@raw['num_prefixes4']
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
# IPv6 prefixes it announces. Paid plans and
|
|
61
|
+
# IPv6 prefixes it announces. Paid plans and a free key's full answers.
|
|
62
62
|
def num_prefixes6
|
|
63
63
|
@raw['num_prefixes6']
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
# Its announcements RPKI calls valid. Paid plans and
|
|
66
|
+
# Its announcements RPKI calls valid. Paid plans and a free key's full
|
|
67
|
+
# answers.
|
|
67
68
|
def rpki_valid
|
|
68
69
|
@raw['rpki_valid']
|
|
69
70
|
end
|
|
70
71
|
|
|
71
|
-
# Its announcements RPKI calls invalid. Paid plans and
|
|
72
|
+
# Its announcements RPKI calls invalid. Paid plans and a free key's full
|
|
73
|
+
# answers.
|
|
72
74
|
def rpki_invalid
|
|
73
75
|
@raw['rpki_invalid']
|
|
74
76
|
end
|
|
75
77
|
|
|
76
|
-
# Its announcements with no RPKI record. Paid plans and
|
|
78
|
+
# Its announcements with no RPKI record. Paid plans and a free key's full
|
|
79
|
+
# answers.
|
|
77
80
|
def rpki_not_found
|
|
78
81
|
@raw['rpki_not_found']
|
|
79
82
|
end
|
|
80
83
|
|
|
81
84
|
# Its ASN Whois record, every column, empty where the registry states
|
|
82
|
-
# nothing. Paid plans and
|
|
85
|
+
# nothing. Paid plans and a free key's full answers.
|
|
83
86
|
def whois
|
|
84
87
|
@raw['whois']
|
|
85
88
|
end
|
|
86
89
|
|
|
87
90
|
# What it announces, IPv4 then IPv6, up to 20000 a family, each with its
|
|
88
|
-
# RPKI status. Paid plans and
|
|
91
|
+
# RPKI status. Paid plans and a free key's full answers.
|
|
89
92
|
def prefixes
|
|
90
93
|
@raw['prefixes']
|
|
91
94
|
end
|
|
92
95
|
|
|
93
|
-
# Its rank in ASN Extended by customer cone, 1 the largest; 0 for an AS
|
|
94
|
-
#
|
|
96
|
+
# Its rank in ASN Extended by customer cone, 1 the largest; 0 for an AS seen
|
|
97
|
+
# in no AS path. Paid plans and a free key's full answers.
|
|
95
98
|
def rank
|
|
96
99
|
@raw['rank']
|
|
97
100
|
end
|
|
98
101
|
|
|
99
102
|
# Whether it is one of the transit-free networks at the top of the
|
|
100
|
-
# hierarchy. Paid plans and
|
|
103
|
+
# hierarchy. Paid plans and a free key's full answers.
|
|
101
104
|
def tier1
|
|
102
105
|
@raw['tier1']
|
|
103
106
|
end
|
|
@@ -107,45 +110,52 @@ module InternetData
|
|
|
107
110
|
@raw['tier1'] == true
|
|
108
111
|
end
|
|
109
112
|
|
|
110
|
-
# How many AS numbers it gets transit from. Paid plans and
|
|
113
|
+
# How many AS numbers it gets transit from. Paid plans and a free key's full
|
|
114
|
+
# answers.
|
|
111
115
|
def num_upstreams
|
|
112
116
|
@raw['num_upstreams']
|
|
113
117
|
end
|
|
114
118
|
|
|
115
|
-
# Those AS numbers, ascending, up to 20000. Paid plans and
|
|
119
|
+
# Those AS numbers, ascending, up to 20000. Paid plans and a free key's full
|
|
120
|
+
# answers.
|
|
116
121
|
def upstreams
|
|
117
122
|
@raw['upstreams']
|
|
118
123
|
end
|
|
119
124
|
|
|
120
125
|
# How many AS numbers it exchanges its own and its customers' routes with.
|
|
121
|
-
# Paid plans and
|
|
126
|
+
# Paid plans and a free key's full answers.
|
|
122
127
|
def num_peers
|
|
123
128
|
@raw['num_peers']
|
|
124
129
|
end
|
|
125
130
|
|
|
126
|
-
# Those AS numbers, ascending, up to 20000. Paid plans and
|
|
131
|
+
# Those AS numbers, ascending, up to 20000. Paid plans and a free key's full
|
|
132
|
+
# answers.
|
|
127
133
|
def peers
|
|
128
134
|
@raw['peers']
|
|
129
135
|
end
|
|
130
136
|
|
|
131
|
-
# How many AS numbers it provides transit to. Paid plans and
|
|
137
|
+
# How many AS numbers it provides transit to. Paid plans and a free key's
|
|
138
|
+
# full answers.
|
|
132
139
|
def num_downstreams
|
|
133
140
|
@raw['num_downstreams']
|
|
134
141
|
end
|
|
135
142
|
|
|
136
|
-
# Those AS numbers, ascending, up to 20000. Paid plans and
|
|
143
|
+
# Those AS numbers, ascending, up to 20000. Paid plans and a free key's full
|
|
144
|
+
# answers.
|
|
137
145
|
def downstreams
|
|
138
146
|
@raw['downstreams']
|
|
139
147
|
end
|
|
140
148
|
|
|
141
149
|
# How many registered domains it hosts (`total`) and the 10 most popular
|
|
142
|
-
# (`domains`), with the wire's string keys. Paid plans and
|
|
150
|
+
# (`domains`), with the wire's string keys. Paid plans and a free key's full
|
|
151
|
+
# answers.
|
|
143
152
|
def hosted_domains
|
|
144
153
|
@raw['hosted_domains']
|
|
145
154
|
end
|
|
146
155
|
|
|
147
156
|
# On answers to a key on the free plan only: false while its organization's
|
|
148
|
-
#
|
|
157
|
+
# lookups of the UTC day answer every field, true once those are used and
|
|
158
|
+
# the answer has the basics; nil on any other.
|
|
149
159
|
def trial_expired
|
|
150
160
|
@raw['trial_expired']
|
|
151
161
|
end
|
|
@@ -157,7 +167,7 @@ module InternetData
|
|
|
157
167
|
|
|
158
168
|
# On answers to a key on a paid plan only: false while the answer has every
|
|
159
169
|
# field, true once its organization's overage cap is reached and the answer
|
|
160
|
-
# has
|
|
170
|
+
# has the basics, which is not billed; nil on any other.
|
|
161
171
|
def cap_reached
|
|
162
172
|
@raw['cap_reached']
|
|
163
173
|
end
|
data/lib/internetdata/cache.rb
CHANGED
|
@@ -10,12 +10,12 @@ module InternetData
|
|
|
10
10
|
# serve one of them the other's shape. Errors are never stored and bogons
|
|
11
11
|
# never reach it.
|
|
12
12
|
#
|
|
13
|
-
# A reduced answer, a
|
|
14
|
-
# allowance's window (on the free plan,
|
|
15
|
-
# stays a minute at most rather than the TTL. It
|
|
16
|
-
# process would send every repeat to the API.
|
|
13
|
+
# A reduced answer, one past a free key's full answers for the day or a
|
|
14
|
+
# reached cap's, ends with the allowance's window (on the free plan, the UTC
|
|
15
|
+
# day) or a raised cap, so it stays a minute at most rather than the TTL. It
|
|
16
|
+
# is still cached, or a busy process would send every repeat to the API.
|
|
17
17
|
class Cache
|
|
18
|
-
# The longest a
|
|
18
|
+
# The longest a reduced answer is held, in seconds.
|
|
19
19
|
REDUCED_TTL = 60
|
|
20
20
|
|
|
21
21
|
def initialize(max_size:, ttl:)
|
data/lib/internetdata/client.rb
CHANGED
|
@@ -23,12 +23,12 @@ module InternetData
|
|
|
23
23
|
# Signing a person in with OAuth, which needs no API key at all.
|
|
24
24
|
attr_reader :oauth
|
|
25
25
|
|
|
26
|
-
# @param api_key [String, nil] without one a lookup
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
# plan, and the databases a key carrying the
|
|
31
|
-
# trimmed, and a key of blanks alone is no key.
|
|
26
|
+
# @param api_key [String, nil] without one a lookup answers the basics: an
|
|
27
|
+
# address's location, network, reverse DNS and its Tor, relay and anycast
|
|
28
|
+
# flags, an AS's registration and a domain's. A free key answers every
|
|
29
|
+
# field on its organization's first lookups each UTC day, then the basics.
|
|
30
|
+
# A batch needs a key on a paid plan, and the databases a key carrying the
|
|
31
|
+
# `db.download` scope. It is trimmed, and a key of blanks alone is no key.
|
|
32
32
|
# @param base_url [String] the API; {#oauth} signs in at its apex, `api.`
|
|
33
33
|
# dropped and `api-<env>.` becoming `<env>.`, and at any other URL as given.
|
|
34
34
|
# @param cache [Boolean] pass false to disable caching.
|
|
@@ -89,11 +89,11 @@ module InternetData
|
|
|
89
89
|
# @param retries [Integer, nil] extra attempts, for THIS call only.
|
|
90
90
|
# @param timeout [Numeric, nil] seconds each attempt may take, for THIS call only.
|
|
91
91
|
# @param user_agent [String, nil] the `User-Agent` of the request you are
|
|
92
|
-
# deciding on. With every field (a paid plan, or
|
|
93
|
-
# carries {Result#user_agent}: the agent it names,
|
|
94
|
-
# bears that out. An empty one is none. An answer
|
|
95
|
-
# from the address's plain answer and from another
|
|
96
|
-
# answered locally, with no `user_agent`.
|
|
92
|
+
# deciding on. With every field (a paid plan, or a free key's full
|
|
93
|
+
# answers) the answer then carries {Result#user_agent}: the agent it names,
|
|
94
|
+
# and whether this address bears that out. An empty one is none. An answer
|
|
95
|
+
# with one is cached apart from the address's plain answer and from another
|
|
96
|
+
# agent's. A bogon is still answered locally, with no `user_agent`.
|
|
97
97
|
# @raise [Error] `:bad_request`, before any request, for anything but an IP
|
|
98
98
|
# address: {#lookup_asn} and {#lookup_domain} look an AS and a domain up.
|
|
99
99
|
# @raise [ArgumentError] for a `user_agent` that is not a String.
|
|
@@ -197,7 +197,7 @@ module InternetData
|
|
|
197
197
|
#
|
|
198
198
|
# Usage counts against the ALLOWANCE WINDOW - on a paid plan the
|
|
199
199
|
# anniversary of the subscription, not the calendar month and not the
|
|
200
|
-
# billing period, and on the free plan
|
|
200
|
+
# billing period, and on the free plan the UTC day - and it is the same
|
|
201
201
|
# number a lookup is gated on. It can lag by a few seconds, because
|
|
202
202
|
# requests are counted in memory and flushed in aggregate.
|
|
203
203
|
#
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.28
|
|
7
7
|
Contact: support@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -4,13 +4,13 @@ module InternetData
|
|
|
4
4
|
# What a lookup of a domain answers.
|
|
5
5
|
#
|
|
6
6
|
# As with {Result}, an absent member is one your plan does not include, and
|
|
7
|
-
# reads as `nil`, never as false:
|
|
8
|
-
# registered and which record types it has, and paid plans and
|
|
9
|
-
# the records themselves, the network announcing each
|
|
10
|
-
# domains on its first IPv4 address, its organization's IP
|
|
11
|
-
# Domain, its home page and the domains redirecting or
|
|
12
|
-
# Each flag has the three readers {Result}'s have:
|
|
13
|
-
# `disposable?` and `included?(:is_disposable)`.
|
|
7
|
+
# reads as `nil`, never as false: the basics are whether the domain is
|
|
8
|
+
# registered and which record types it has, and paid plans and a free key's
|
|
9
|
+
# full answers add the records themselves, the network announcing each
|
|
10
|
+
# address, the other domains on its first IPv4 address, its organization's IP
|
|
11
|
+
# ranges, Disposable Domain, its home page and the domains redirecting or
|
|
12
|
+
# linking to it. Each flag has the three readers {Result}'s have:
|
|
13
|
+
# `is_disposable`, `disposable?` and `included?(:is_disposable)`.
|
|
14
14
|
class DomainResult
|
|
15
15
|
include Answer
|
|
16
16
|
|
|
@@ -30,7 +30,7 @@ module InternetData
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Whether it is a disposable email domain (Disposable Domain), or nil when
|
|
33
|
-
# your plan does not include it. Paid plans and
|
|
33
|
+
# your plan does not include it. Paid plans and a free key's full answers.
|
|
34
34
|
def is_disposable
|
|
35
35
|
@raw['is_disposable']
|
|
36
36
|
end
|
|
@@ -91,60 +91,61 @@ module InternetData
|
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
# Its records in Domain DNS, up to 100 a type, as a wire hash
|
|
94
|
-
# (`result.dns['mx']`). Paid plans and
|
|
94
|
+
# (`result.dns['mx']`). Paid plans and a free key's full answers.
|
|
95
95
|
def dns
|
|
96
96
|
@raw['dns']
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
# The network announcing each address in `dns.a` and then `dns.aaaa`, from
|
|
100
100
|
# IP ASN, as wire hashes (`result.hosting.first['asn']['name']`); `[]` where
|
|
101
|
-
# it resolves to none. Paid plans and
|
|
101
|
+
# it resolves to none. Paid plans and a free key's full answers.
|
|
102
102
|
def hosting
|
|
103
103
|
@raw['hosting']
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
# From IP Hosted Domains, as a wire hash: the other registered domains on
|
|
107
107
|
# its first IPv4 address (`ip`), how many (`total`) and up to 10, the most
|
|
108
|
-
# popular first (`domains`). Paid plans and
|
|
108
|
+
# popular first (`domains`). Paid plans and a free key's full answers.
|
|
109
109
|
def cohosted_domains
|
|
110
110
|
@raw['cohosted_domains']
|
|
111
111
|
end
|
|
112
112
|
|
|
113
|
-
# Its organization's IP ranges, from Domain IP Ranges. Paid plans and
|
|
114
|
-
#
|
|
113
|
+
# Its organization's IP ranges, from Domain IP Ranges. Paid plans and a free
|
|
114
|
+
# key's full answers.
|
|
115
115
|
def ip_ranges
|
|
116
116
|
@raw['ip_ranges']
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
# Detail for `is_disposable`, `{}` when it is false. Paid plans and
|
|
120
|
-
#
|
|
119
|
+
# Detail for `is_disposable`, `{}` when it is false. Paid plans and a free
|
|
120
|
+
# key's full answers.
|
|
121
121
|
def disposable
|
|
122
122
|
@raw['disposable']
|
|
123
123
|
end
|
|
124
124
|
|
|
125
|
-
# What our crawl last read of its home page, as a wire hash: `url`,
|
|
126
|
-
# `
|
|
127
|
-
#
|
|
125
|
+
# What our crawl last read of its home page, as a wire hash: `url`, `title`,
|
|
126
|
+
# `description`, `last_seen` and the external hosts it links to (`links`),
|
|
127
|
+
# each empty where it holds none. Paid plans and a free key's full answers.
|
|
128
128
|
def web
|
|
129
129
|
@raw['web']
|
|
130
130
|
end
|
|
131
131
|
|
|
132
132
|
# The registered domains whose home page redirects to it, as a wire hash:
|
|
133
133
|
# how many (`total`) and up to 10, the most popular first (`domains`). Paid
|
|
134
|
-
# plans and
|
|
134
|
+
# plans and a free key's full answers.
|
|
135
135
|
def redirects
|
|
136
136
|
@raw['redirects']
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
# The registered domains whose home page links to it, as a wire hash: how
|
|
140
140
|
# many (`total`) and up to 10, the most popular first (`domains`). Paid
|
|
141
|
-
# plans and
|
|
141
|
+
# plans and a free key's full answers.
|
|
142
142
|
def backlinks
|
|
143
143
|
@raw['backlinks']
|
|
144
144
|
end
|
|
145
145
|
|
|
146
146
|
# On answers to a key on the free plan only: false while its organization's
|
|
147
|
-
#
|
|
147
|
+
# lookups of the UTC day answer every field, true once those are used and
|
|
148
|
+
# the answer has the basics; nil on any other.
|
|
148
149
|
def trial_expired
|
|
149
150
|
@raw['trial_expired']
|
|
150
151
|
end
|
|
@@ -156,7 +157,7 @@ module InternetData
|
|
|
156
157
|
|
|
157
158
|
# On answers to a key on a paid plan only: false while the answer has every
|
|
158
159
|
# field, true once its organization's overage cap is reached and the answer
|
|
159
|
-
# has
|
|
160
|
+
# has the basics, which is not billed; nil on any other.
|
|
160
161
|
def cap_reached
|
|
161
162
|
@raw['cap_reached']
|
|
162
163
|
end
|
|
@@ -68,9 +68,9 @@ module InternetData
|
|
|
68
68
|
# only be `not_bot`. One address is looked up with at most
|
|
69
69
|
# {MAX_AGENTS_PER_ADDRESS} crawler agents an hour: past those, the lookup
|
|
70
70
|
# sends none, and the request passes as a crawler only where the answer's
|
|
71
|
-
# `bot.verified` is true. A keyless client, or a free key past its
|
|
72
|
-
# never gets a verdict, so nothing is let through
|
|
73
|
-
# warned of once under `on_missing_field`.
|
|
71
|
+
# `bot.verified` is true. A keyless client, or a free key past its full
|
|
72
|
+
# answers for the day, never gets a verdict, so nothing is let through
|
|
73
|
+
# there, and that is warned of once under `on_missing_field`.
|
|
74
74
|
def initialize(default_ip_selector, user_agent_of = DEFAULT_USER_AGENT, **options)
|
|
75
75
|
Condition.validate!(options[:block_condition])
|
|
76
76
|
@condition = options[:block_condition]
|
|
@@ -196,14 +196,14 @@ module InternetData
|
|
|
196
196
|
end
|
|
197
197
|
|
|
198
198
|
# An agent went with the lookup and the served answer carries no verdict:
|
|
199
|
-
# a keyless client, or a free key past its
|
|
200
|
-
# so allow_bots lets no crawler through.
|
|
199
|
+
# a keyless client, or a free key past its full answers for the day, is
|
|
200
|
+
# never answered one, so allow_bots lets no crawler through.
|
|
201
201
|
def report_unanswered_agent(result)
|
|
202
202
|
return if @on_missing_field == :ignore || result.included?(:user_agent)
|
|
203
203
|
|
|
204
204
|
report('allow_bots sends the request\'s User-Agent, but the answer carries no user_agent ' \
|
|
205
205
|
'verdict, which your plan does not include, so no crawler is let through. A key on ' \
|
|
206
|
-
'a paid plan, or
|
|
206
|
+
'a paid plan, or a free key within its full answers, is answered one.')
|
|
207
207
|
end
|
|
208
208
|
|
|
209
209
|
def report(message)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.28
|
|
7
7
|
Contact: support@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -16,28 +16,28 @@ require 'time'
|
|
|
16
16
|
module InternetData
|
|
17
17
|
# Where to report abuse, from IP Abuse Contact.
|
|
18
18
|
class AbuseContact < ApiModelBase
|
|
19
|
-
# Where to report abuse from the address.
|
|
19
|
+
# Where to report abuse from the address. On a paid plan or a free key's full answers.
|
|
20
20
|
attr_accessor :email
|
|
21
21
|
|
|
22
|
-
# The contact. On a paid plan or
|
|
22
|
+
# The contact. On a paid plan or a free key's full answers.
|
|
23
23
|
attr_accessor :name
|
|
24
24
|
|
|
25
|
-
# Its phone number. On a paid plan or
|
|
25
|
+
# Its phone number. On a paid plan or a free key's full answers.
|
|
26
26
|
attr_accessor :phone
|
|
27
27
|
|
|
28
|
-
# Its postal address. On a paid plan or
|
|
28
|
+
# Its postal address. On a paid plan or a free key's full answers.
|
|
29
29
|
attr_accessor :address
|
|
30
30
|
|
|
31
|
-
# ISO 3166 country code. On a paid plan or
|
|
31
|
+
# ISO 3166 country code. On a paid plan or a free key's full answers.
|
|
32
32
|
attr_accessor :country
|
|
33
33
|
|
|
34
|
-
# The registry block it was derived from. On a paid plan or
|
|
34
|
+
# The registry block it was derived from. On a paid plan or a free key's full answers.
|
|
35
35
|
attr_accessor :network
|
|
36
36
|
|
|
37
|
-
# ARIN reports the contact answered its yearly validation. On a paid plan or
|
|
37
|
+
# ARIN reports the contact answered its yearly validation. On a paid plan or a free key's full answers.
|
|
38
38
|
attr_accessor :validated
|
|
39
39
|
|
|
40
|
-
# Since when it has not. On a paid plan or
|
|
40
|
+
# Since when it has not. On a paid plan or a free key's full answers.
|
|
41
41
|
attr_accessor :unvalidated_since
|
|
42
42
|
|
|
43
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.28
|
|
7
7
|
Contact: support@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -25,7 +25,7 @@ module InternetData
|
|
|
25
25
|
# Its operator's domain.
|
|
26
26
|
attr_accessor :domain
|
|
27
27
|
|
|
28
|
-
# The kind of network it runs. On a paid plan or
|
|
28
|
+
# The kind of network it runs. On a paid plan or a free key's full answers.
|
|
29
29
|
attr_accessor :type
|
|
30
30
|
|
|
31
31
|
# The announced prefix covering the address.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
#The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.28
|
|
7
7
|
Contact: support@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module InternetData
|
|
17
|
-
# From ASN Hosted Domains: how many registered domains the AS hosts, and the 10 most popular. Its database lists up to 1,000 an AS. On a paid plan or
|
|
17
|
+
# From ASN Hosted Domains: how many registered domains the AS hosts, and the 10 most popular. Its database lists up to 1,000 an AS. On a paid plan or a free key's full answers.
|
|
18
18
|
class AsnHostedDomains < ApiModelBase
|
|
19
19
|
# How many registered domains resolve to an address the AS announces.
|
|
20
20
|
attr_accessor :total
|