Class: PassiveTotal::Client::WHOIS

Inherits:
Base
  • Object
show all
Defined in:
lib/passivetotal/clients/whois.rb

Constant Summary

Constants inherited from Base

Base::BASE_URL, Base::HOST, Base::VERSION

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PassiveTotal::Client::Base

Instance Method Details

#get(query, compact_record: nil, history: nil) ⇒ Hash

Retrieves the WHOIS data for the specified query api.passivetotal.org/api/docs/#api-WHOIS-GetV2Whois

Parameters:

  • query (String)

    the domain being queried

  • compact_record (String, nil) (defaults to: nil)

    whether to compress the results

  • history (String, nil) (defaults to: nil)

    whether to return historical results

Returns:

  • (Hash)


16
17
18
19
20
21
22
23
24
# File 'lib/passivetotal/clients/whois.rb', line 16

def get(query, compact_record: nil, history: nil)
  params = {
    query: query,
    compact_record: compact_record,
    history: history,
  }.compact

  _get("/whois", params) { |json| json }
end

#keyword(query) ⇒ Hash

Parameters:

  • query (String)

    being queried

Returns:

  • (Hash)


34
35
36
37
38
39
40
# File 'lib/passivetotal/clients/whois.rb', line 34

def keyword(query)
  params = {
    query: query,
  }.compact

  _get("/whois/search/keyword", params) { |json| json }
end

#search(query:, field:) ⇒ Hash

Searches WHOIS data by field and query. api.passivetotal.org/api/docs/#api-WHOIS-GetV2WhoisSearch

Parameters:

  • query (String)

    the value of the field being queried

  • field (String)

    the field to query

Returns:

  • (Hash)


51
52
53
54
55
56
57
58
# File 'lib/passivetotal/clients/whois.rb', line 51

def search(query:, field:)
  params = {
    query: query,
    field: field,
  }.compact

  _get("/whois/search", params) { |json| json }
end