From f45f0e06c258170d59ea37cc306bbe7a2d73680d Mon Sep 17 00:00:00 2001 From: qasimleoo Date: Tue, 17 Nov 2026 15:40:18 +0500 Subject: [PATCH] docs: describe every parameter and add subdomain typosquatting Every one of the 211 parameter slots now carries a description, taken from the reviewed copy on whoisfreaks.com rather than written fresh. Two of them were shared components, which covered 19 slots at once. The seven operations that had no description have one too, so the spec lints clean apart from one pre-existing unused schema. Corrects the default of exact on /v2.1/dns/reverse: the spec said true, but RequestParameter.booleanFrom defaults to false in dns-api and the public docs say false. Adds /v3.0/subdomains/typos, which the spec never carried even though the endpoint is documented and live, with the TyposquatSubdomainsResponse and TyposquatSubdomain schemas behind it. Moves info.version off 1.0.0 to a dated version so a consumer can tell two builds of the file apart. --- README.md | 6 +- docs/authentication.md | 40 ++-- docs/endpoints/README.md | 7 +- docs/endpoints/api-solutions.md | 5 +- docs/endpoints/asn-whois.md | 16 +- docs/endpoints/databases-asn-whois.md | 8 +- docs/endpoints/databases-expiring-dropped.md | 32 +-- docs/endpoints/databases-ip-geolocation.md | 16 +- docs/endpoints/databases-ip-security.md | 8 +- docs/endpoints/databases-ip-whois.md | 8 +- docs/endpoints/databases-newly-registered.md | 48 ++-- docs/endpoints/databases-threat-feed.md | 12 + docs/endpoints/dns.md | 208 +++++++++--------- docs/endpoints/domain-availability.md | 16 +- docs/endpoints/domain-reputation.md | 8 +- docs/endpoints/geolocation.md | 8 +- docs/endpoints/ip-reputation.md | 16 +- docs/endpoints/ip-whois.md | 16 +- docs/endpoints/ssl.md | 32 +-- docs/endpoints/subdomains.md | 48 ++-- docs/endpoints/typosquatting.md | 176 +++++++++++++-- docs/endpoints/whois.md | 42 ++-- docs/languages/csharp.md | 172 +++++++++------ docs/languages/go.md | 185 ++++++++++------ docs/languages/java.md | 177 +++++++++------ docs/languages/javascript.md | 175 +++++++++------ docs/languages/kotlin.md | 169 ++++++++------ docs/languages/php.md | 183 +++++++++------ docs/languages/python.md | 174 +++++++++------ docs/languages/ruby.md | 177 +++++++++------ docs/languages/swift.md | 179 +++++++++------ docs/languages/typescript.md | 178 +++++++++------ examples/README.md | 3 +- examples/csharp/AsnWhois.cs | 4 +- examples/csharp/BulkDomainAvailabilityV2.cs | 2 +- examples/csharp/BulkWhois.cs | 2 +- examples/csharp/DbAsnWhois.cs | 2 +- examples/csharp/DbDropped.cs | 2 +- examples/csharp/DbDroppedBacklinks.cs | 2 +- examples/csharp/DbDroppedJson.cs | 2 +- examples/csharp/DbExpired.cs | 2 +- examples/csharp/DbIpCity.cs | 2 +- examples/csharp/DbIpCountry.cs | 2 +- examples/csharp/DbIpSecurity.cs | 2 +- examples/csharp/DbIpWhois.cs | 2 +- examples/csharp/DbNewlyCctld.cs | 4 +- examples/csharp/DbNewlyCctldJson.cs | 2 +- examples/csharp/DbNewlyGtld.cs | 4 +- examples/csharp/DbNewlyGtldJson.cs | 2 +- examples/csharp/DnsBulk.cs | 4 +- examples/csharp/DnsHistorical.cs | 8 +- examples/csharp/DnsHistoricalV22.cs | 8 +- examples/csharp/DnsHistoricalV23.cs | 8 +- examples/csharp/DnsLive.cs | 4 +- examples/csharp/DnsReverse.cs | 8 +- examples/csharp/DnsReverseV22.cs | 6 +- examples/csharp/DnsReverseV23.cs | 6 +- examples/csharp/DomainAvailabilityV2.cs | 2 +- examples/csharp/DomainReputation.cs | 2 +- examples/csharp/Geolocation.cs | 2 +- examples/csharp/IpReputation.cs | 2 +- examples/csharp/IpReputationV2.cs | 2 +- examples/csharp/IpWhois.cs | 4 +- examples/csharp/README.md | 1 + examples/csharp/SslLookup.cs | 8 +- examples/csharp/SubdomainTyposquatting.cs | 20 ++ examples/csharp/Subdomains.cs | 12 +- examples/csharp/Typosquatting.cs | 6 +- examples/csharp/WhoisHistory.cs | 2 +- examples/csharp/WhoisLive.cs | 4 +- examples/csharp/WhoisReverse.cs | 2 +- examples/go/AsnWhois.go | 4 +- examples/go/BulkDomainAvailabilityV2.go | 2 +- examples/go/BulkWhois.go | 2 +- examples/go/DbAsnWhois.go | 2 +- examples/go/DbDropped.go | 2 +- examples/go/DbDroppedBacklinks.go | 2 +- examples/go/DbDroppedJson.go | 2 +- examples/go/DbExpired.go | 2 +- examples/go/DbIpCity.go | 2 +- examples/go/DbIpCountry.go | 2 +- examples/go/DbIpSecurity.go | 2 +- examples/go/DbIpWhois.go | 2 +- examples/go/DbNewlyCctld.go | 4 +- examples/go/DbNewlyCctldJson.go | 2 +- examples/go/DbNewlyGtld.go | 4 +- examples/go/DbNewlyGtldJson.go | 2 +- examples/go/DnsBulk.go | 4 +- examples/go/DnsHistorical.go | 8 +- examples/go/DnsHistoricalV22.go | 8 +- examples/go/DnsHistoricalV23.go | 8 +- examples/go/DnsLive.go | 4 +- examples/go/DnsReverse.go | 8 +- examples/go/DnsReverseV22.go | 6 +- examples/go/DnsReverseV23.go | 6 +- examples/go/DomainAvailabilityV2.go | 2 +- examples/go/DomainReputation.go | 2 +- examples/go/Geolocation.go | 2 +- examples/go/IpReputation.go | 2 +- examples/go/IpReputationV2.go | 2 +- examples/go/IpWhois.go | 4 +- examples/go/README.md | 1 + examples/go/SslLookup.go | 8 +- examples/go/SubdomainTyposquatting.go | 33 +++ examples/go/Subdomains.go | 12 +- examples/go/Typosquatting.go | 6 +- examples/go/WhoisHistory.go | 2 +- examples/go/WhoisLive.go | 4 +- examples/go/WhoisReverse.go | 2 +- examples/java/AsnWhois.java | 4 +- examples/java/BulkDomainAvailabilityV2.java | 2 +- examples/java/BulkWhois.java | 2 +- examples/java/DbAsnWhois.java | 2 +- examples/java/DbDropped.java | 2 +- examples/java/DbDroppedBacklinks.java | 2 +- examples/java/DbDroppedJson.java | 2 +- examples/java/DbExpired.java | 2 +- examples/java/DbIpCity.java | 2 +- examples/java/DbIpCountry.java | 2 +- examples/java/DbIpSecurity.java | 2 +- examples/java/DbIpWhois.java | 2 +- examples/java/DbNewlyCctld.java | 4 +- examples/java/DbNewlyCctldJson.java | 2 +- examples/java/DbNewlyGtld.java | 4 +- examples/java/DbNewlyGtldJson.java | 2 +- examples/java/DnsBulk.java | 4 +- examples/java/DnsHistorical.java | 8 +- examples/java/DnsHistoricalV22.java | 8 +- examples/java/DnsHistoricalV23.java | 8 +- examples/java/DnsLive.java | 4 +- examples/java/DnsReverse.java | 8 +- examples/java/DnsReverseV22.java | 6 +- examples/java/DnsReverseV23.java | 6 +- examples/java/DomainAvailabilityV2.java | 2 +- examples/java/DomainReputation.java | 2 +- examples/java/Geolocation.java | 2 +- examples/java/IpReputation.java | 2 +- examples/java/IpReputationV2.java | 2 +- examples/java/IpWhois.java | 4 +- examples/java/README.md | 1 + examples/java/SslLookup.java | 8 +- examples/java/SubdomainTyposquatting.java | 25 +++ examples/java/Subdomains.java | 12 +- examples/java/Typosquatting.java | 6 +- examples/java/WhoisHistory.java | 2 +- examples/java/WhoisLive.java | 4 +- examples/java/WhoisReverse.java | 2 +- examples/javascript/AsnWhois.js | 4 +- .../javascript/BulkDomainAvailabilityV2.js | 2 +- examples/javascript/BulkWhois.js | 2 +- examples/javascript/DbAsnWhois.js | 2 +- examples/javascript/DbDropped.js | 2 +- examples/javascript/DbDroppedBacklinks.js | 2 +- examples/javascript/DbDroppedJson.js | 2 +- examples/javascript/DbExpired.js | 2 +- examples/javascript/DbIpCity.js | 2 +- examples/javascript/DbIpCountry.js | 2 +- examples/javascript/DbIpSecurity.js | 2 +- examples/javascript/DbIpWhois.js | 2 +- examples/javascript/DbNewlyCctld.js | 4 +- examples/javascript/DbNewlyCctldJson.js | 2 +- examples/javascript/DbNewlyGtld.js | 4 +- examples/javascript/DbNewlyGtldJson.js | 2 +- examples/javascript/DnsBulk.js | 4 +- examples/javascript/DnsHistorical.js | 8 +- examples/javascript/DnsHistoricalV22.js | 8 +- examples/javascript/DnsHistoricalV23.js | 8 +- examples/javascript/DnsLive.js | 4 +- examples/javascript/DnsReverse.js | 8 +- examples/javascript/DnsReverseV22.js | 6 +- examples/javascript/DnsReverseV23.js | 6 +- examples/javascript/DomainAvailabilityV2.js | 2 +- examples/javascript/DomainReputation.js | 2 +- examples/javascript/Geolocation.js | 2 +- examples/javascript/IpReputation.js | 2 +- examples/javascript/IpReputationV2.js | 2 +- examples/javascript/IpWhois.js | 4 +- examples/javascript/README.md | 1 + examples/javascript/SslLookup.js | 8 +- examples/javascript/SubdomainTyposquatting.js | 24 ++ examples/javascript/Subdomains.js | 12 +- examples/javascript/Typosquatting.js | 6 +- examples/javascript/WhoisHistory.js | 2 +- examples/javascript/WhoisLive.js | 4 +- examples/javascript/WhoisReverse.js | 2 +- examples/kotlin/AsnWhois.kt | 4 +- examples/kotlin/BulkDomainAvailabilityV2.kt | 2 +- examples/kotlin/BulkWhois.kt | 2 +- examples/kotlin/DbAsnWhois.kt | 2 +- examples/kotlin/DbDropped.kt | 2 +- examples/kotlin/DbDroppedBacklinks.kt | 2 +- examples/kotlin/DbDroppedJson.kt | 2 +- examples/kotlin/DbExpired.kt | 2 +- examples/kotlin/DbIpCity.kt | 2 +- examples/kotlin/DbIpCountry.kt | 2 +- examples/kotlin/DbIpSecurity.kt | 2 +- examples/kotlin/DbIpWhois.kt | 2 +- examples/kotlin/DbNewlyCctld.kt | 4 +- examples/kotlin/DbNewlyCctldJson.kt | 2 +- examples/kotlin/DbNewlyGtld.kt | 4 +- examples/kotlin/DbNewlyGtldJson.kt | 2 +- examples/kotlin/DnsBulk.kt | 4 +- examples/kotlin/DnsHistorical.kt | 8 +- examples/kotlin/DnsHistoricalV22.kt | 8 +- examples/kotlin/DnsHistoricalV23.kt | 8 +- examples/kotlin/DnsLive.kt | 4 +- examples/kotlin/DnsReverse.kt | 8 +- examples/kotlin/DnsReverseV22.kt | 6 +- examples/kotlin/DnsReverseV23.kt | 6 +- examples/kotlin/DomainAvailabilityV2.kt | 2 +- examples/kotlin/DomainReputation.kt | 2 +- examples/kotlin/Geolocation.kt | 2 +- examples/kotlin/IpReputation.kt | 2 +- examples/kotlin/IpReputationV2.kt | 2 +- examples/kotlin/IpWhois.kt | 4 +- examples/kotlin/README.md | 1 + examples/kotlin/SslLookup.kt | 8 +- examples/kotlin/SubdomainTyposquatting.kt | 17 ++ examples/kotlin/Subdomains.kt | 12 +- examples/kotlin/Typosquatting.kt | 6 +- examples/kotlin/WhoisHistory.kt | 2 +- examples/kotlin/WhoisLive.kt | 4 +- examples/kotlin/WhoisReverse.kt | 2 +- examples/php/AsnWhois.php | 4 +- examples/php/BulkDomainAvailabilityV2.php | 2 +- examples/php/BulkWhois.php | 2 +- examples/php/DbAsnWhois.php | 2 +- examples/php/DbDropped.php | 2 +- examples/php/DbDroppedBacklinks.php | 2 +- examples/php/DbDroppedJson.php | 2 +- examples/php/DbExpired.php | 2 +- examples/php/DbIpCity.php | 2 +- examples/php/DbIpCountry.php | 2 +- examples/php/DbIpSecurity.php | 2 +- examples/php/DbIpWhois.php | 2 +- examples/php/DbNewlyCctld.php | 4 +- examples/php/DbNewlyCctldJson.php | 2 +- examples/php/DbNewlyGtld.php | 4 +- examples/php/DbNewlyGtldJson.php | 2 +- examples/php/DnsBulk.php | 4 +- examples/php/DnsHistorical.php | 8 +- examples/php/DnsHistoricalV22.php | 8 +- examples/php/DnsHistoricalV23.php | 8 +- examples/php/DnsLive.php | 4 +- examples/php/DnsReverse.php | 10 +- examples/php/DnsReverseV22.php | 6 +- examples/php/DnsReverseV23.php | 6 +- examples/php/DomainAvailabilityV2.php | 2 +- examples/php/DomainReputation.php | 2 +- examples/php/Geolocation.php | 2 +- examples/php/IpReputation.php | 2 +- examples/php/IpReputationV2.php | 2 +- examples/php/IpWhois.php | 4 +- examples/php/README.md | 1 + examples/php/SslLookup.php | 8 +- examples/php/SubdomainTyposquatting.php | 29 +++ examples/php/Subdomains.php | 12 +- examples/php/Typosquatting.php | 6 +- examples/php/WhoisHistory.php | 2 +- examples/php/WhoisLive.php | 4 +- examples/php/WhoisReverse.php | 2 +- examples/python/AsnWhois.py | 4 +- examples/python/BulkDomainAvailabilityV2.py | 2 +- examples/python/BulkWhois.py | 2 +- examples/python/DbAsnWhois.py | 2 +- examples/python/DbDropped.py | 2 +- examples/python/DbDroppedBacklinks.py | 2 +- examples/python/DbDroppedJson.py | 2 +- examples/python/DbExpired.py | 2 +- examples/python/DbIpCity.py | 2 +- examples/python/DbIpCountry.py | 2 +- examples/python/DbIpSecurity.py | 2 +- examples/python/DbIpWhois.py | 2 +- examples/python/DbNewlyCctld.py | 4 +- examples/python/DbNewlyCctldJson.py | 2 +- examples/python/DbNewlyGtld.py | 4 +- examples/python/DbNewlyGtldJson.py | 2 +- examples/python/DnsBulk.py | 4 +- examples/python/DnsHistorical.py | 8 +- examples/python/DnsHistoricalV22.py | 8 +- examples/python/DnsHistoricalV23.py | 8 +- examples/python/DnsLive.py | 4 +- examples/python/DnsReverse.py | 8 +- examples/python/DnsReverseV22.py | 6 +- examples/python/DnsReverseV23.py | 6 +- examples/python/DomainAvailabilityV2.py | 2 +- examples/python/DomainReputation.py | 2 +- examples/python/Geolocation.py | 2 +- examples/python/IpReputation.py | 2 +- examples/python/IpReputationV2.py | 2 +- examples/python/IpWhois.py | 4 +- examples/python/README.md | 1 + examples/python/SslLookup.py | 8 +- examples/python/SubdomainTyposquatting.py | 23 ++ examples/python/Subdomains.py | 12 +- examples/python/Typosquatting.py | 6 +- examples/python/WhoisHistory.py | 2 +- examples/python/WhoisLive.py | 4 +- examples/python/WhoisReverse.py | 2 +- examples/ruby/AsnWhois.rb | 4 +- examples/ruby/BulkDomainAvailabilityV2.rb | 2 +- examples/ruby/BulkWhois.rb | 2 +- examples/ruby/DbAsnWhois.rb | 2 +- examples/ruby/DbDropped.rb | 2 +- examples/ruby/DbDroppedBacklinks.rb | 2 +- examples/ruby/DbDroppedJson.rb | 2 +- examples/ruby/DbExpired.rb | 2 +- examples/ruby/DbIpCity.rb | 2 +- examples/ruby/DbIpCountry.rb | 2 +- examples/ruby/DbIpSecurity.rb | 2 +- examples/ruby/DbIpWhois.rb | 2 +- examples/ruby/DbNewlyCctld.rb | 4 +- examples/ruby/DbNewlyCctldJson.rb | 2 +- examples/ruby/DbNewlyGtld.rb | 4 +- examples/ruby/DbNewlyGtldJson.rb | 2 +- examples/ruby/DnsBulk.rb | 4 +- examples/ruby/DnsHistorical.rb | 8 +- examples/ruby/DnsHistoricalV22.rb | 8 +- examples/ruby/DnsHistoricalV23.rb | 8 +- examples/ruby/DnsLive.rb | 4 +- examples/ruby/DnsReverse.rb | 8 +- examples/ruby/DnsReverseV22.rb | 6 +- examples/ruby/DnsReverseV23.rb | 6 +- examples/ruby/DomainAvailabilityV2.rb | 2 +- examples/ruby/DomainReputation.rb | 2 +- examples/ruby/Geolocation.rb | 2 +- examples/ruby/IpReputation.rb | 2 +- examples/ruby/IpReputationV2.rb | 2 +- examples/ruby/IpWhois.rb | 4 +- examples/ruby/README.md | 1 + examples/ruby/SslLookup.rb | 8 +- examples/ruby/SubdomainTyposquatting.rb | 25 +++ examples/ruby/Subdomains.rb | 12 +- examples/ruby/Typosquatting.rb | 6 +- examples/ruby/WhoisHistory.rb | 2 +- examples/ruby/WhoisLive.rb | 4 +- examples/ruby/WhoisReverse.rb | 2 +- examples/swift/AsnWhois.swift | 4 +- examples/swift/BulkDomainAvailabilityV2.swift | 2 +- examples/swift/BulkWhois.swift | 2 +- examples/swift/DbAsnWhois.swift | 2 +- examples/swift/DbDropped.swift | 2 +- examples/swift/DbDroppedBacklinks.swift | 2 +- examples/swift/DbDroppedJson.swift | 2 +- examples/swift/DbExpired.swift | 2 +- examples/swift/DbIpCity.swift | 2 +- examples/swift/DbIpCountry.swift | 2 +- examples/swift/DbIpSecurity.swift | 2 +- examples/swift/DbIpWhois.swift | 2 +- examples/swift/DbNewlyCctld.swift | 4 +- examples/swift/DbNewlyCctldJson.swift | 2 +- examples/swift/DbNewlyGtld.swift | 4 +- examples/swift/DbNewlyGtldJson.swift | 2 +- examples/swift/DnsBulk.swift | 4 +- examples/swift/DnsHistorical.swift | 8 +- examples/swift/DnsHistoricalV22.swift | 8 +- examples/swift/DnsHistoricalV23.swift | 8 +- examples/swift/DnsLive.swift | 4 +- examples/swift/DnsReverse.swift | 8 +- examples/swift/DnsReverseV22.swift | 6 +- examples/swift/DnsReverseV23.swift | 6 +- examples/swift/DomainAvailabilityV2.swift | 2 +- examples/swift/DomainReputation.swift | 2 +- examples/swift/Geolocation.swift | 2 +- examples/swift/IpReputation.swift | 2 +- examples/swift/IpReputationV2.swift | 2 +- examples/swift/IpWhois.swift | 4 +- examples/swift/README.md | 1 + examples/swift/SslLookup.swift | 8 +- examples/swift/SubdomainTyposquatting.swift | 27 +++ examples/swift/Subdomains.swift | 12 +- examples/swift/Typosquatting.swift | 6 +- examples/swift/WhoisHistory.swift | 2 +- examples/swift/WhoisLive.swift | 4 +- examples/swift/WhoisReverse.swift | 2 +- examples/typescript/AsnWhois.ts | 4 +- .../typescript/BulkDomainAvailabilityV2.ts | 2 +- examples/typescript/BulkWhois.ts | 2 +- examples/typescript/DbAsnWhois.ts | 2 +- examples/typescript/DbDropped.ts | 2 +- examples/typescript/DbDroppedBacklinks.ts | 2 +- examples/typescript/DbDroppedJson.ts | 2 +- examples/typescript/DbExpired.ts | 2 +- examples/typescript/DbIpCity.ts | 2 +- examples/typescript/DbIpCountry.ts | 2 +- examples/typescript/DbIpSecurity.ts | 2 +- examples/typescript/DbIpWhois.ts | 2 +- examples/typescript/DbNewlyCctld.ts | 4 +- examples/typescript/DbNewlyCctldJson.ts | 2 +- examples/typescript/DbNewlyGtld.ts | 4 +- examples/typescript/DbNewlyGtldJson.ts | 2 +- examples/typescript/DnsBulk.ts | 4 +- examples/typescript/DnsHistorical.ts | 8 +- examples/typescript/DnsHistoricalV22.ts | 8 +- examples/typescript/DnsHistoricalV23.ts | 8 +- examples/typescript/DnsLive.ts | 4 +- examples/typescript/DnsReverse.ts | 8 +- examples/typescript/DnsReverseV22.ts | 6 +- examples/typescript/DnsReverseV23.ts | 6 +- examples/typescript/DomainAvailabilityV2.ts | 2 +- examples/typescript/DomainReputation.ts | 2 +- examples/typescript/Geolocation.ts | 2 +- examples/typescript/IpReputation.ts | 2 +- examples/typescript/IpReputationV2.ts | 2 +- examples/typescript/IpWhois.ts | 4 +- examples/typescript/README.md | 1 + examples/typescript/SslLookup.ts | 8 +- examples/typescript/SubdomainTyposquatting.ts | 27 +++ examples/typescript/Subdomains.ts | 12 +- examples/typescript/Typosquatting.ts | 6 +- examples/typescript/WhoisHistory.ts | 2 +- examples/typescript/WhoisLive.ts | 4 +- examples/typescript/WhoisReverse.ts | 2 +- spec/whoisfreaks-openapi.yaml | 166 +++++++++++++- 414 files changed, 2636 insertions(+), 1720 deletions(-) create mode 100644 examples/csharp/SubdomainTyposquatting.cs create mode 100644 examples/go/SubdomainTyposquatting.go create mode 100644 examples/java/SubdomainTyposquatting.java create mode 100644 examples/javascript/SubdomainTyposquatting.js create mode 100644 examples/kotlin/SubdomainTyposquatting.kt create mode 100644 examples/php/SubdomainTyposquatting.php create mode 100644 examples/python/SubdomainTyposquatting.py create mode 100644 examples/ruby/SubdomainTyposquatting.rb create mode 100644 examples/swift/SubdomainTyposquatting.swift create mode 100644 examples/typescript/SubdomainTyposquatting.ts diff --git a/README.md b/README.md index 4431d25..b7b0fcb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # WhoisFreaks SDK Documentation Official documentation for the **WhoisFreaks** SDKs: one API, 10 -languages, 94 endpoints. Every SDK is generated from the same +languages, 95 endpoints. Every SDK is generated from the same [OpenAPI specification](spec/whoisfreaks-openapi.yaml) and published to its language's standard registry. @@ -11,7 +11,7 @@ its language's standard registry. - [Authentication](docs/authentication.md): get and configure your API key - [Language guides](#language-guides): install + usage for each SDK -- [Endpoint reference](docs/endpoints/README.md): all 94 endpoints, grouped by category +- [Endpoint reference](docs/endpoints/README.md): all 95 endpoints, grouped by category - [Runnable examples](examples/README.md): copy-paste, ready-to-run example for every endpoint in every language ## Language guides @@ -56,7 +56,7 @@ The equivalent for every other language is in its [language guide](#language-gui The API is organized into three sections. See the [full endpoint reference](docs/endpoints/README.md) for every operation with its URL, parameters, response fields and Python, TypeScript and Go examples. The [language guides](#language-guides) show every operation in all 10 languages. -### [API Solutions](docs/endpoints/api-solutions.md) (26 endpoints) +### [API Solutions](docs/endpoints/api-solutions.md) (27 endpoints) Real-time and on-demand lookup APIs. Query a single domain, IP, or ASN and get structured JSON (or XML) back immediately. diff --git a/docs/authentication.md b/docs/authentication.md index 84ce3ac..e2e6f82 100644 --- a/docs/authentication.md +++ b/docs/authentication.md @@ -47,8 +47,8 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.WHOISApi(client) # whois_live parameters: - # domain_name (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.whois_live("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -66,8 +66,8 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new WHOISApi(client); // whoisLive(domainName, opts) -// domainName (string, required) -// opts.format (string, optional): one of json, xml; default "json" +// domainName (string, required): Domain to look up +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.whoisLive("whoisfreaks.com"); console.log(JSON.stringify(result, null, 2)); @@ -92,8 +92,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new WHOISApi(config); // whoisLive({ domainName, format? }) -// domainName (string, required) -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.whoisLive({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -116,8 +116,8 @@ main().catch(async (err: unknown) => { // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=WhoisLive // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.WhoisApi; @@ -145,8 +145,8 @@ public class WhoisLive { // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: gradle run -PmainClass=WhoisLiveKt // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -166,8 +166,8 @@ fun main() { // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -190,8 +190,8 @@ Console.WriteLine(result.ToJson()); # Live WHOIS Lookup # # Parameters for whoisLive (GET /v2.0/whois/live): -# - domain_name (string, required) -# - format (string (one of: json, xml), optional) +# - domain_name (string, required): Domain to look up. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -219,8 +219,8 @@ end // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -256,8 +256,8 @@ func main() { // Live WHOIS Lookup // // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -288,8 +288,8 @@ do { // Live WHOIS Lookup // // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/docs/endpoints/README.md b/docs/endpoints/README.md index fb09b23..90c8d46 100644 --- a/docs/endpoints/README.md +++ b/docs/endpoints/README.md @@ -1,17 +1,17 @@ # Endpoint Reference -The WhoisFreaks API exposes **94 endpoints** across **23 categories**, organized into 3 sections. Every endpoint is available in all 10 SDKs. +The WhoisFreaks API exposes **95 endpoints** across **23 categories**, organized into 3 sections. Every endpoint is available in all 10 SDKs. ## API Solutions Real-time and on-demand lookup APIs. Query a single domain, IP, or ASN and get structured JSON (or XML) back immediately. -26 endpoints across 11 categories. See the [API Solutions overview](api-solutions.md). +27 endpoints across 11 categories. See the [API Solutions overview](api-solutions.md). - [WHOIS](whois.md): 4 endpoints - [DNS](dns.md): 8 endpoints - [Domain Availability](domain-availability.md): 2 endpoints -- [Typosquatting](typosquatting.md): 1 endpoint +- [Typosquatting](typosquatting.md): 2 endpoints - [SSL](ssl.md): 1 endpoint - [Geolocation](geolocation.md): 2 endpoints - [Subdomains](subdomains.md): 1 endpoint @@ -65,6 +65,7 @@ Manage your account, monitor API usage and credits, and rotate your API key. | API Solutions | Domain Availability | GET | `/v2.0/domain/availability` | `domainAvailabilityV2` | | API Solutions | Domain Availability | POST | `/v2.0/domain/availability` | `bulkDomainAvailabilityV2` | | API Solutions | Typosquatting | GET | `/v3.0/domain/typos` | `typosquatting` | +| API Solutions | Typosquatting | GET | `/v3.0/subdomains/typos` | `subdomainTyposquatting` | | API Solutions | SSL | GET | `/v1.0/ssl/live` | `sslLookup` | | API Solutions | Geolocation | GET | `/v1.0/geolocation` | `geolocation` | | API Solutions | Geolocation | POST | `/v1.0/geolocation` | `bulkGeolocation` | diff --git a/docs/endpoints/api-solutions.md b/docs/endpoints/api-solutions.md index f3131b6..d977600 100644 --- a/docs/endpoints/api-solutions.md +++ b/docs/endpoints/api-solutions.md @@ -2,7 +2,7 @@ Real-time and on-demand lookup APIs. Query a single domain, IP, or ASN and get structured JSON (or XML) back immediately. -**26 endpoints** across **11 categories**. Requests need your API key unless noted otherwise. See [Authentication](../authentication.md). +**27 endpoints** across **11 categories**. Requests need your API key unless noted otherwise. See [Authentication](../authentication.md). ## Categories @@ -45,9 +45,10 @@ Check domain availability Detect typo variants of brand domains -1 endpoint: +2 endpoints: - **Typosquatting Lookup**: `GET /v3.0/domain/typos` +- **Subdomain Typosquatting Lookup**: `GET /v3.0/subdomains/typos` ### [SSL](ssl.md) diff --git a/docs/endpoints/asn-whois.md b/docs/endpoints/asn-whois.md index c21119b..0e5a1b9 100644 --- a/docs/endpoints/asn-whois.md +++ b/docs/endpoints/asn-whois.md @@ -16,8 +16,8 @@ WHOIS for an ASN. 1 credit. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `asn` | query | yes | string | | | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `asn` | query | yes | string | | Autonomous system number to look up, with or without the AS prefix. | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`AsnWhoisResponse`) @@ -71,8 +71,8 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.ASNWHOISApi(client) # asn_whois parameters: - # asn (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # asn (str, required): Autonomous system number to look up, with or without the AS prefix + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.asn_whois("as15169") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -91,8 +91,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new ASNWHOISApi(config); // asnWhois({ asn, format? }) -// asn (string, required) -// format ("json" | "xml", optional): default "json" +// asn (string, required): Autonomous system number to look up, with or without the AS prefix +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.asnWhois({ asn: "as15169" }); console.log(JSON.stringify(result, null, 2)); @@ -117,8 +117,8 @@ main().catch(async (err: unknown) => { // Runnable example: ASN WHOIS Lookup (GET /v2.0/asn-whois) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main diff --git a/docs/endpoints/databases-asn-whois.md b/docs/endpoints/databases-asn-whois.md index 741959a..7f0700f 100644 --- a/docs/endpoints/databases-asn-whois.md +++ b/docs/endpoints/databases-asn-whois.md @@ -16,7 +16,7 @@ ASN WHOIS Snapshot. Returns the file/snapshot described by this operation. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `date` | query | yes | string (date) | | | +| `date` | query | yes | string (date) | | The day whose file you want, in YYYY-MM-DD format. | **Usage** @@ -40,7 +40,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesASNWHOISApi(client) # db_asn_whois parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_asn_whois(date(2026, 10, 1)) # the file's raw bytes path = "DbAsnWhois.json.gz" with open(path, "wb") as f: @@ -64,7 +64,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesASNWHOISApi(config); // dbAsnWhois({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbAsnWhois({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbAsnWhois.json.gz"; @@ -91,7 +91,7 @@ main().catch(async (err: unknown) => { // Runnable example: ASN WHOIS Snapshot (GET /v3.3/download/snapshot/asn/whois) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main diff --git a/docs/endpoints/databases-expiring-dropped.md b/docs/endpoints/databases-expiring-dropped.md index 5c29317..753e8a8 100644 --- a/docs/endpoints/databases-expiring-dropped.md +++ b/docs/endpoints/databases-expiring-dropped.md @@ -16,7 +16,7 @@ Expiring Domains. Returns the file/snapshot described by this operation. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `whois` | query | yes | boolean | | | +| `whois` | query | yes | boolean | | Set true for the file with full WHOIS records, false for domain names only. | | `date` | query | no | string (date) | | yyyy-MM-dd; omit for latest | **Usage** @@ -41,7 +41,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesExpiringDroppedApi(client) # db_expired parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest data = api.db_expired(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbExpired.csv" @@ -66,7 +66,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesExpiringDroppedApi(config); // dbExpired({ whois, date? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest async function main(): Promise { const blob = await api.dbExpired({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes @@ -94,7 +94,7 @@ main().catch(async (err: unknown) => { // Runnable example: Expiring Domains (GET /v3.1/download/domainer/expired) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest package main @@ -288,7 +288,7 @@ Dropped Domains. Returns the file/snapshot described by this operation. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `whois` | query | yes | boolean | | | +| `whois` | query | yes | boolean | | Set true for the file with full WHOIS records, false for domain names only. | | `date` | query | no | string (date) | | yyyy-MM-dd; omit for latest | **Usage** @@ -313,7 +313,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesExpiringDroppedApi(client) # db_dropped parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest data = api.db_dropped(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbDropped.csv" @@ -338,7 +338,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesExpiringDroppedApi(config); // dbDropped({ whois, date? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest async function main(): Promise { const blob = await api.dbDropped({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes @@ -366,7 +366,7 @@ main().catch(async (err: unknown) => { // Runnable example: Dropped Domains (GET /v3.1/download/domainer/dropped) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest package main @@ -427,7 +427,7 @@ Dropped Domains (JSON). Returns the file/snapshot described by this operation. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `date` | query | no | string (date) | | yyyy-MM-dd; omit for latest | -| `tlds` | query | no | string | | | +| `tlds` | query | no | string | | Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out. | **Usage** @@ -452,7 +452,7 @@ with whoisfreaks.ApiClient(config) as client: # db_dropped_json parameters: # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... domains = api.db_dropped_json(var_date=date(2026, 10, 1)) print(f"{len(domains)} domains") print("\n".join(domains[:10])) @@ -473,7 +473,7 @@ const api = new DatabasesExpiringDroppedApi(config); // dbDroppedJson({ date?, tlds? }) // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const domains = await api.dbDroppedJson({ date: new Date("2026-10-01") }); console.log(`${domains.length} domains`); @@ -500,7 +500,7 @@ main().catch(async (err: unknown) => { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main @@ -545,7 +545,7 @@ Dropped With Backlinks. Returns the file/snapshot described by this operation. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `whois` | query | no | boolean | | | +| `whois` | query | no | boolean | | Set true for the file with full WHOIS records, false for domain names only. | | `date` | query | no | string (date) | | yyyy-MM-dd; omit for latest | **Usage** @@ -570,7 +570,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesExpiringDroppedApi(client) # db_dropped_backlinks parameters: - # whois (bool, optional, keyword) + # whois (bool, optional, keyword): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest data = api.db_dropped_backlinks(var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbDroppedBacklinks.csv" @@ -595,7 +595,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesExpiringDroppedApi(config); // dbDroppedBacklinks({ whois?, date? }) -// whois (boolean, optional) +// whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest async function main(): Promise { const blob = await api.dbDroppedBacklinks({ date: new Date("2026-10-01") }); // a Blob with the file's bytes @@ -623,7 +623,7 @@ main().catch(async (err: unknown) => { // Runnable example: Dropped With Backlinks (GET /v3.3/download/domainer/dropped/backlinks) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest package main diff --git a/docs/endpoints/databases-ip-geolocation.md b/docs/endpoints/databases-ip-geolocation.md index 3e671b5..12d1794 100644 --- a/docs/endpoints/databases-ip-geolocation.md +++ b/docs/endpoints/databases-ip-geolocation.md @@ -135,7 +135,7 @@ IP to Country Snapshot. Returns the file/snapshot described by this operation. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `date` | query | yes | string (date) | | | +| `date` | query | yes | string (date) | | The day whose file you want, in YYYY-MM-DD format. | **Usage** @@ -159,7 +159,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesIPGeolocationApi(client) # db_ip_country parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_country(date(2026, 10, 1)) # the file's raw bytes path = "DbIpCountry.zip" with open(path, "wb") as f: @@ -183,7 +183,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPGeolocationApi(config); // dbIpCountry({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpCountry({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpCountry.zip"; @@ -210,7 +210,7 @@ main().catch(async (err: unknown) => { // Runnable example: IP to Country Snapshot (GET /v3.3/download/snapshot/ip/country) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main @@ -387,7 +387,7 @@ IP to City Snapshot. Returns the file/snapshot described by this operation. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `date` | query | yes | string (date) | | | +| `date` | query | yes | string (date) | | The day whose file you want, in YYYY-MM-DD format. | **Usage** @@ -411,7 +411,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesIPGeolocationApi(client) # db_ip_city parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_city(date(2026, 10, 1)) # the file's raw bytes path = "DbIpCity.zip" with open(path, "wb") as f: @@ -435,7 +435,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPGeolocationApi(config); // dbIpCity({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpCity({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpCity.zip"; @@ -462,7 +462,7 @@ main().catch(async (err: unknown) => { // Runnable example: IP to City Snapshot (GET /v3.3/download/snapshot/ip/city) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main diff --git a/docs/endpoints/databases-ip-security.md b/docs/endpoints/databases-ip-security.md index 96cddc5..b2fac94 100644 --- a/docs/endpoints/databases-ip-security.md +++ b/docs/endpoints/databases-ip-security.md @@ -16,7 +16,7 @@ IP Security Snapshot. Returns the file/snapshot described by this operation. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `date` | query | yes | string (date) | | | +| `date` | query | yes | string (date) | | The day whose file you want, in YYYY-MM-DD format. | **Usage** @@ -40,7 +40,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesIPSecurityApi(client) # db_ip_security parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_security(date(2026, 10, 1)) # the file's raw bytes path = "DbIpSecurity.csv" with open(path, "wb") as f: @@ -64,7 +64,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPSecurityApi(config); // dbIpSecurity({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpSecurity({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpSecurity.csv"; @@ -91,7 +91,7 @@ main().catch(async (err: unknown) => { // Runnable example: IP Security Snapshot (GET /v3.3/download/snapshot/ip/security) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main diff --git a/docs/endpoints/databases-ip-whois.md b/docs/endpoints/databases-ip-whois.md index 747d89f..9660868 100644 --- a/docs/endpoints/databases-ip-whois.md +++ b/docs/endpoints/databases-ip-whois.md @@ -16,7 +16,7 @@ IP WHOIS Snapshot. Returns the file/snapshot described by this operation. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `date` | query | yes | string (date) | | | +| `date` | query | yes | string (date) | | The day whose file you want, in YYYY-MM-DD format. | **Usage** @@ -40,7 +40,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesIPWHOISApi(client) # db_ip_whois parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_whois(date(2026, 10, 1)) # the file's raw bytes path = "DbIpWhois.json.gz" with open(path, "wb") as f: @@ -64,7 +64,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPWHOISApi(config); // dbIpWhois({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpWhois({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpWhois.json.gz"; @@ -91,7 +91,7 @@ main().catch(async (err: unknown) => { // Runnable example: IP WHOIS Snapshot (GET /v3.3/download/snapshot/ip/whois) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main diff --git a/docs/endpoints/databases-newly-registered.md b/docs/endpoints/databases-newly-registered.md index 83300c3..384ece7 100644 --- a/docs/endpoints/databases-newly-registered.md +++ b/docs/endpoints/databases-newly-registered.md @@ -16,9 +16,9 @@ Newly Registered gTLD (CSV). Returns the file/snapshot described by this operati | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `whois` | query | yes | boolean | | | +| `whois` | query | yes | boolean | | Set true for the file with full WHOIS records, false for domain names only. | | `date` | query | no | string (date) | | yyyy-MM-dd; omit for latest | -| `tlds` | query | no | string | | | +| `tlds` | query | no | string | | Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out. | **Usage** @@ -42,9 +42,9 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesNewlyRegisteredApi(client) # db_newly_gtld parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... data = api.db_newly_gtld(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbNewlyGtld.csv" with open(path, "wb") as f: @@ -68,9 +68,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyGtld({ whois, date?, tlds? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const blob = await api.dbNewlyGtld({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbNewlyGtld.csv"; @@ -97,9 +97,9 @@ main().catch(async (err: unknown) => { // Runnable example: Newly Registered gTLD (CSV) (GET /v3.1/download/domainer/gtld) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main @@ -158,9 +158,9 @@ Newly Registered ccTLD (CSV). Returns the file/snapshot described by this operat | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `whois` | query | yes | boolean | | | +| `whois` | query | yes | boolean | | Set true for the file with full WHOIS records, false for domain names only. | | `date` | query | no | string (date) | | yyyy-MM-dd; omit for latest | -| `tlds` | query | no | string | | | +| `tlds` | query | no | string | | Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out. | **Usage** @@ -184,9 +184,9 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesNewlyRegisteredApi(client) # db_newly_cctld parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... data = api.db_newly_cctld(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbNewlyCctld.csv" with open(path, "wb") as f: @@ -210,9 +210,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyCctld({ whois, date?, tlds? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const blob = await api.dbNewlyCctld({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbNewlyCctld.csv"; @@ -239,9 +239,9 @@ main().catch(async (err: unknown) => { // Runnable example: Newly Registered ccTLD (CSV) (GET /v3.1/download/domainer/cctld) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main @@ -569,7 +569,7 @@ Newly Registered gTLD (JSON). Returns the file/snapshot described by this operat | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `date` | query | no | string (date) | | yyyy-MM-dd; omit for latest | -| `tlds` | query | no | string | | | +| `tlds` | query | no | string | | Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out. | **Usage** @@ -594,7 +594,7 @@ with whoisfreaks.ApiClient(config) as client: # db_newly_gtld_json parameters: # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... domains = api.db_newly_gtld_json(var_date=date(2026, 10, 1)) print(f"{len(domains)} domains") print("\n".join(domains[:10])) @@ -615,7 +615,7 @@ const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyGtldJson({ date?, tlds? }) // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const domains = await api.dbNewlyGtldJson({ date: new Date("2026-10-01") }); console.log(`${domains.length} domains`); @@ -642,7 +642,7 @@ main().catch(async (err: unknown) => { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main @@ -688,7 +688,7 @@ Newly Registered ccTLD (JSON). Returns the file/snapshot described by this opera | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `date` | query | no | string (date) | | yyyy-MM-dd; omit for latest | -| `tlds` | query | no | string | | | +| `tlds` | query | no | string | | Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out. | **Usage** @@ -713,7 +713,7 @@ with whoisfreaks.ApiClient(config) as client: # db_newly_cctld_json parameters: # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... domains = api.db_newly_cctld_json(var_date=date(2026, 10, 1)) print(f"{len(domains)} domains") print("\n".join(domains[:10])) @@ -734,7 +734,7 @@ const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyCctldJson({ date?, tlds? }) // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const domains = await api.dbNewlyCctldJson({ date: new Date("2026-10-01") }); console.log(`${domains.length} domains`); @@ -761,7 +761,7 @@ main().catch(async (err: unknown) => { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main diff --git a/docs/endpoints/databases-threat-feed.md b/docs/endpoints/databases-threat-feed.md index 2a4ef8b..7551899 100644 --- a/docs/endpoints/databases-threat-feed.md +++ b/docs/endpoints/databases-threat-feed.md @@ -10,6 +10,8 @@ Daily phishing, malware and spam threat feeds `GET https://files.whoisfreaks.com/v3.4/download/threat-feed/phishing` +Download the day's phishing domain feed as a gzip-compressed CSV file. + **Parameters** | Parameter | In | Required | Type | Default | Description | @@ -141,6 +143,8 @@ func main() { `GET https://files.whoisfreaks.com/v3.4/download/threat-feed/phishing/sample` +Download an open sample of the phishing domain feed as a gzip-compressed CSV file. No API key and no date are needed. + **Parameters** None. The API key is set once on the client. @@ -267,6 +271,8 @@ func main() { `GET https://files.whoisfreaks.com/v3.4/download/threat-feed/malware` +Download the day's malware domain feed as a gzip-compressed CSV file. + **Parameters** | Parameter | In | Required | Type | Default | Description | @@ -398,6 +404,8 @@ func main() { `GET https://files.whoisfreaks.com/v3.4/download/threat-feed/malware/sample` +Download an open sample of the malware domain feed as a gzip-compressed CSV file. No API key and no date are needed. + **Parameters** None. The API key is set once on the client. @@ -524,6 +532,8 @@ func main() { `GET https://files.whoisfreaks.com/v3.4/download/threat-feed/spam` +Download the day's spam domain feed as a gzip-compressed CSV file. + **Parameters** | Parameter | In | Required | Type | Default | Description | @@ -655,6 +665,8 @@ func main() { `GET https://files.whoisfreaks.com/v3.4/download/threat-feed/spam/sample` +Download an open sample of the spam domain feed as a gzip-compressed CSV file. No API key and no date are needed. + **Parameters** None. The API key is set once on the client. diff --git a/docs/endpoints/dns.md b/docs/endpoints/dns.md index cce4c70..9c209f8 100644 --- a/docs/endpoints/dns.md +++ b/docs/endpoints/dns.md @@ -16,10 +16,10 @@ Real-time DNS record lookup. 1 credit per query. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `domainName` | query | no | string | | | +| `domainName` | query | no | string | | Domain to look up. | | `ipAddress` | query | no | string | | Use for PTR lookups | | `type` | query | yes | string | `all` | all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`DnsResponse`) @@ -83,9 +83,9 @@ with whoisfreaks.ApiClient(config) as client: # dns_live parameters: # type (str, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME; default "all" - # domain_name (str, optional, keyword) + # domain_name (str, optional, keyword): Domain to look up # ip_address (str, optional, keyword): Use for PTR lookups - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_live("A,MX,TXT", domain_name="whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -105,9 +105,9 @@ const api = new DNSApi(config); // dnsLive({ type, domainName?, ipAddress?, format? }) // type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME; default "all" -// domainName (string, optional) +// domainName (string, optional): Domain to look up // ipAddress (string, optional): Use for PTR lookups -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsLive({ type: "A,MX,TXT", domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -132,10 +132,10 @@ main().catch(async (err: unknown) => { // Runnable example: Live DNS Lookup (GET /v2.0/dns/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -180,10 +180,10 @@ All historical DNS records. 2 credits per page (100 records/page). | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `domainName` | query | yes | string | | | -| `type` | query | yes | string | `all` | | -| `page` | query | no | integer | `1` | | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `domainName` | query | yes | string | | Domain to look up. | +| `type` | query | yes | string | `all` | Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. | +| `page` | query | no | integer | `1` | Page of results to return. Defaults to 1. | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`HistoricalDnsResponse`) @@ -231,10 +231,10 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DNSApi(client) # dns_historical parameters: - # domain_name (str, required) - # type (str, required): default "all" - # page (int, optional, keyword): default 1 - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_historical("whoisfreaks.com", "A,MX,TXT", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -253,10 +253,10 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsHistorical({ domainName, type, page?, format? }) -// domainName (string, required) -// type (string, required): default "all" -// page (number, optional): default 1 -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// page (number, optional): Page of results to return. Defaults to 1; default 1 +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsHistorical({ domainName: "whoisfreaks.com", type: "A,MX,TXT", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -281,10 +281,10 @@ main().catch(async (err: unknown) => { // Runnable example: Historical DNS Lookup (GET /v2.0/dns/historical) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -330,10 +330,10 @@ Search domains by IP or DNS value. 5 credits per page. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `value` | query | yes | string | | IP, CIDR, or record value | -| `type` | query | yes | string | | (one of: a, mx, cname, ns, aaaa, txt, soa) | -| `exact` | query | no | boolean | `true` | | -| `page` | query | no | integer | `1` | | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `type` | query | yes | string | | DNS record type to search by. (one of: a, mx, cname, ns, aaaa, txt, soa) | +| `exact` | query | no | boolean | `false` | Set true to match value exactly. Defaults to false, where value is treated as a pattern and '*' matches any characters. Ignored for A and AAAA records, which always match the IP. | +| `page` | query | no | integer | `1` | Page of results to return. Defaults to 1. | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`ReverseDnsResponse`) @@ -382,10 +382,10 @@ with whoisfreaks.ApiClient(config) as client: # dns_reverse parameters: # value (str, required): IP, CIDR, or record value - # type (str, required): one of a, mx, cname, ns, aaaa, txt, soa - # exact (bool, optional, keyword): default True - # page (int, optional, keyword): default 1 - # format (str, optional, keyword): one of json, xml; default "json" + # type (str, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa + # exact (bool, optional, keyword): Set true to match value exactly. Defaults to false, where value is treated as...; default False + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_reverse("8.8.8.8", "a", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -405,10 +405,10 @@ const api = new DNSApi(config); // dnsReverse({ value, type, exact?, page?, format? }) // value (string, required): IP, CIDR, or record value -// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required) -// exact (boolean, optional): default true -// page (number, optional): default 1 -// format ("json" | "xml", optional): default "json" +// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required): DNS record type to search by +// exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as...; default false +// page (number, optional): Page of results to return. Defaults to 1; default 1 +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsReverse({ value: "8.8.8.8", type: "a", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -434,10 +434,10 @@ main().catch(async (err: unknown) => { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -481,12 +481,12 @@ Same records as /v2.0/dns/historical, with two differences. Each entry reports f | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `domainName` | query | yes | string | | | -| `type` | query | yes | string | `all` | | -| `page` | query | no | integer | `1` | | +| `domainName` | query | yes | string | | Domain to look up. | +| `type` | query | yes | string | `all` | Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. | +| `page` | query | no | integer | `1` | Page of results to return. Defaults to 1. | | `sort` | query | no | string | | Sort direction. Omit to leave the results unsorted. (one of: asc, desc) | | `sortBy` | query | no | string | `lastSeen` | Field to sort on. Only applies when sort is given. (one of: firstSeen, lastSeen) | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`HistoricalDnsResponseV2_2`) @@ -535,12 +535,12 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DNSApi(client) # dns_historical_v22 parameters: - # domain_name (str, required) - # type (str, required): default "all" - # page (int, optional, keyword): default 1 + # domain_name (str, required): Domain to look up + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_historical_v22("whoisfreaks.com", "A,MX,TXT", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -559,12 +559,12 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsHistoricalV22({ domainName, type, page?, sort?, sortBy?, format? }) -// domainName (string, required) -// type (string, required): default "all" -// page (number, optional): default 1 +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsHistoricalV22({ domainName: "whoisfreaks.com", type: "A,MX,TXT", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -589,12 +589,12 @@ main().catch(async (err: unknown) => { // Runnable example: Historical DNS Lookup (v2.2) (GET /v2.2/dns/historical) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -639,12 +639,12 @@ Same response as /v2.2/dns/historical. The difference is in error handling. Up t | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `domainName` | query | yes | string | | | -| `type` | query | yes | string | `all` | | -| `page` | query | no | integer | `1` | | +| `domainName` | query | yes | string | | Domain to look up. | +| `type` | query | yes | string | `all` | Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. | +| `page` | query | no | integer | `1` | Page of results to return. Defaults to 1. | | `sort` | query | no | string | | Sort direction. Omit to leave the results unsorted. (one of: asc, desc) | | `sortBy` | query | no | string | `lastSeen` | Field to sort on. Only applies when sort is given. (one of: firstSeen, lastSeen) | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`HistoricalDnsResponseV2_2`) @@ -693,12 +693,12 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DNSApi(client) # dns_historical_v23 parameters: - # domain_name (str, required) - # type (str, required): default "all" - # page (int, optional, keyword): default 1 + # domain_name (str, required): Domain to look up + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_historical_v23("whoisfreaks.com", "A,MX,TXT", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -717,12 +717,12 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsHistoricalV23({ domainName, type, page?, sort?, sortBy?, format? }) -// domainName (string, required) -// type (string, required): default "all" -// page (number, optional): default 1 +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsHistoricalV23({ domainName: "whoisfreaks.com", type: "A,MX,TXT", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -747,12 +747,12 @@ main().catch(async (err: unknown) => { // Runnable example: Historical DNS Lookup (v2.3) (GET /v2.3/dns/historical) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -798,12 +798,12 @@ Same search as /v2.1/dns/reverse. Each entry reports firstSeen and lastSeen inst | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `value` | query | yes | string | | IP, CIDR, or record value | -| `type` | query | yes | string | | (one of: a, mx, cname, ns, aaaa, txt, soa) | +| `type` | query | yes | string | | DNS record type to search by. (one of: a, mx, cname, ns, aaaa, txt, soa) | | `exact` | query | no | boolean | `true` | When false the value is matched as a substring, which is far slower than an exact match on a large record type. | -| `page` | query | no | integer | `1` | | +| `page` | query | no | integer | `1` | Page of results to return. Defaults to 1. | | `sort` | query | no | string | | Sort direction. Omit to leave the results unsorted. (one of: asc, desc) | | `sortBy` | query | no | string | `lastSeen` | Field to sort on. Only applies when sort is given. (one of: firstSeen, lastSeen) | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`ReverseDnsResponseV2_2`) @@ -853,12 +853,12 @@ with whoisfreaks.ApiClient(config) as client: # dns_reverse_v22 parameters: # value (str, required): IP, CIDR, or record value - # type (str, required): one of a, mx, cname, ns, aaaa, txt, soa + # type (str, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa # exact (bool, optional, keyword): When false the value is matched as a substring, which is far slower than an e...; default True - # page (int, optional, keyword): default 1 + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_reverse_v22("8.8.8.8", "a", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -878,12 +878,12 @@ const api = new DNSApi(config); // dnsReverseV22({ value, type, exact?, page?, sort?, sortBy?, format? }) // value (string, required): IP, CIDR, or record value -// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required) +// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required): DNS record type to search by // exact (boolean, optional): When false the value is matched as a substring, which is far slower than an e...; default true -// page (number, optional): default 1 +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsReverseV22({ value: "8.8.8.8", type: "a", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -909,12 +909,12 @@ main().catch(async (err: unknown) => { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -959,12 +959,12 @@ Same search as /v2.2/dns/reverse, with a bounded total. Counting every match of | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `value` | query | yes | string | | IP, CIDR, or record value | -| `type` | query | yes | string | | (one of: a, mx, cname, ns, aaaa, txt, soa) | +| `type` | query | yes | string | | DNS record type to search by. (one of: a, mx, cname, ns, aaaa, txt, soa) | | `exact` | query | no | boolean | `true` | When false the value is matched as a substring, which is far slower than an exact match on a large record type. | -| `page` | query | no | integer | `1` | | +| `page` | query | no | integer | `1` | Page of results to return. Defaults to 1. | | `sort` | query | no | string | | Sort direction. Omit to leave the results unsorted. (one of: asc, desc) | | `sortBy` | query | no | string | `lastSeen` | Field to sort on. Only applies when sort is given. (one of: firstSeen, lastSeen) | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`ReverseDnsResponseV2_3`) @@ -1015,12 +1015,12 @@ with whoisfreaks.ApiClient(config) as client: # dns_reverse_v23 parameters: # value (str, required): IP, CIDR, or record value - # type (str, required): one of a, mx, cname, ns, aaaa, txt, soa + # type (str, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa # exact (bool, optional, keyword): When false the value is matched as a substring, which is far slower than an e...; default True - # page (int, optional, keyword): default 1 + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_reverse_v23("8.8.8.8", "a", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -1040,12 +1040,12 @@ const api = new DNSApi(config); // dnsReverseV23({ value, type, exact?, page?, sort?, sortBy?, format? }) // value (string, required): IP, CIDR, or record value -// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required) +// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required): DNS record type to search by // exact (boolean, optional): When false the value is matched as a substring, which is far slower than an e...; default true -// page (number, optional): default 1 +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsReverseV23({ value: "8.8.8.8", type: "a", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -1071,12 +1071,12 @@ main().catch(async (err: unknown) => { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -1120,8 +1120,8 @@ Up to 100 domains + 100 IPs in one request. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `type` | query | yes | string | `all` | | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `type` | query | yes | string | `all` | Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Request body** (`application/json`, model `DnsBulkRequest`) @@ -1175,9 +1175,9 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DNSApi(client) # dns_bulk parameters: - # type (str, required): default "all" + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" # dns_bulk_request (DnsBulkRequest, required): request body - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" body = whoisfreaks.DnsBulkRequest(domain_names=["whoisfreaks.com", "example.com"]) result = api.dns_bulk("A,MX,TXT", body) print(json.dumps(result.to_dict(), indent=2)) @@ -1197,9 +1197,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsBulk({ type, dnsBulkRequest, format? }) -// type (string, required): default "all" +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" // dnsBulkRequest (DnsBulkRequest, required): request body -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const body: DnsBulkRequest = { domainNames: ["whoisfreaks.com", "example.com"] }; const result = await api.dnsBulk({ type: "A,MX,TXT", dnsBulkRequest: body }); @@ -1225,8 +1225,8 @@ main().catch(async (err: unknown) => { // Runnable example: Bulk DNS Lookup (POST /v2.0/dns/bulk/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object package main diff --git a/docs/endpoints/domain-availability.md b/docs/endpoints/domain-availability.md index c423ba3..bd5cd9b 100644 --- a/docs/endpoints/domain-availability.md +++ b/docs/endpoints/domain-availability.md @@ -19,7 +19,7 @@ Check availability of a single domain and optionally get suggestions across mult | `domain` | query | yes | string | | The domain name to check | | `sug` | query | no | boolean | `false` | Whether to return TLD suggestions alongside the queried domain. | | `count` | query | no | integer | `5` | Number of TLD suggestions to return when sug=true. Maximum is 100. | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`DomainAvailabilityResponse`) @@ -66,7 +66,7 @@ with whoisfreaks.ApiClient(config) as client: # domain (str, required): The domain name to check # sug (bool, optional, keyword): Whether to return TLD suggestions alongside the queried domain; default False # count (int, optional, keyword): Number of TLD suggestions to return when sug=true. Maximum is 100; default 5 - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.domain_availability_v2("google.com", sug=True, count=5) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -88,7 +88,7 @@ const api = new DomainAvailabilityApi(config); // domain (string, required): The domain name to check // sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain; default false // count (number, optional): Number of TLD suggestions to return when sug=true. Maximum is 100; default 5 -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.domainAvailabilityV2({ domain: "google.com", sug: true, count: 5 }); console.log(JSON.stringify(result, null, 2)); @@ -116,7 +116,7 @@ main().catch(async (err: unknown) => { // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -162,7 +162,7 @@ Two bulk modes. Mode 1: POST domainNames array. Mode 2: POST tld array plus doma | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `domain` | query | no | string | | Required for TLD-mode bulk check (base domain). | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Request body** (`application/json`, model `BulkDomainAvailabilityRequest`) @@ -214,7 +214,7 @@ with whoisfreaks.ApiClient(config) as client: # bulk_domain_availability_v2 parameters: # bulk_domain_availability_request (BulkDomainAvailabilityRequest, required): request body # domain (str, optional, keyword): Required for TLD-mode bulk check (base domain) - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" body = whoisfreaks.BulkDomainAvailabilityRequest(domain_names=["whoisfreaks.com", "example.com"]) result = api.bulk_domain_availability_v2(body) print(json.dumps(result.to_dict(), indent=2)) @@ -236,7 +236,7 @@ const api = new DomainAvailabilityApi(config); // bulkDomainAvailabilityV2({ bulkDomainAvailabilityRequest, domain?, format? }) // bulkDomainAvailabilityRequest (BulkDomainAvailabilityRequest, required): request body // domain (string, optional): Required for TLD-mode bulk check (base domain) -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const body: BulkDomainAvailabilityRequest = { domainNames: ["whoisfreaks.com", "example.com"] }; const result = await api.bulkDomainAvailabilityV2({ bulkDomainAvailabilityRequest: body }); @@ -263,7 +263,7 @@ main().catch(async (err: unknown) => { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object package main diff --git a/docs/endpoints/domain-reputation.md b/docs/endpoints/domain-reputation.md index 83fa932..6ac253d 100644 --- a/docs/endpoints/domain-reputation.md +++ b/docs/endpoints/domain-reputation.md @@ -17,7 +17,7 @@ Real-time domain threat assessment. Returns risk verdict, trust score, DGA analy | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `domainName` | query | yes | string | | The domain name to assess | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`DomainReputationResponse`) @@ -126,7 +126,7 @@ with whoisfreaks.ApiClient(config) as client: # domain_reputation parameters: # domain_name (str, required): The domain name to assess - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.domain_reputation("amazon.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -146,7 +146,7 @@ const api = new DomainReputationApi(config); // domainReputation({ domainName, format? }) // domainName (string, required): The domain name to assess -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.domainReputation({ domainName: "amazon.com" }); console.log(JSON.stringify(result, null, 2)); @@ -172,7 +172,7 @@ main().catch(async (err: unknown) => { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main diff --git a/docs/endpoints/geolocation.md b/docs/endpoints/geolocation.md index ce33450..773a19b 100644 --- a/docs/endpoints/geolocation.md +++ b/docs/endpoints/geolocation.md @@ -16,7 +16,7 @@ Get location, ASN, currency for an IP. 1 credit. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `ip` | query | yes | string | | | +| `ip` | query | yes | string | | IP address to look up. | **Response** (`GeolocationResponse`) @@ -108,7 +108,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.GeolocationApi(client) # geolocation parameters: - # ip (str, required) + # ip (str, required): IP address to look up result = api.geolocation("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -127,7 +127,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new GeolocationApi(config); // geolocation({ ip }) -// ip (string, required) +// ip (string, required): IP address to look up async function main(): Promise { const result = await api.geolocation({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); @@ -152,7 +152,7 @@ main().catch(async (err: unknown) => { // Runnable example: IP Geolocation Lookup (GET /v1.0/geolocation) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. package main diff --git a/docs/endpoints/ip-reputation.md b/docs/endpoints/ip-reputation.md index 6c7fbd9..62f9f3b 100644 --- a/docs/endpoints/ip-reputation.md +++ b/docs/endpoints/ip-reputation.md @@ -16,7 +16,7 @@ Threat intel for IP: VPN, proxy, Tor, bots. 1 credit. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `ip` | query | yes | string | | | +| `ip` | query | yes | string | | IP address to look up. | **Response** (`IpReputationResponse`) @@ -130,7 +130,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.IPReputationApi(client) # ip_reputation parameters: - # ip (str, required) + # ip (str, required): IP address to look up result = api.ip_reputation("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -149,7 +149,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new IPReputationApi(config); // ipReputation({ ip }) -// ip (string, required) +// ip (string, required): IP address to look up async function main(): Promise { const result = await api.ipReputation({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); @@ -174,7 +174,7 @@ main().catch(async (err: unknown) => { // Runnable example: IP Reputation Lookup (GET /v1.0/security) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. package main @@ -430,7 +430,7 @@ Same lookup as /v1.0/security on a restructured response. The ASN block moves to | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `ip` | query | yes | string | | | +| `ip` | query | yes | string | | IP address to look up. | **Response** (`IpReputationResponse`) @@ -544,7 +544,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.IPReputationApi(client) # ip_reputation_v2 parameters: - # ip (str, required) + # ip (str, required): IP address to look up result = api.ip_reputation_v2("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -563,7 +563,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new IPReputationApi(config); // ipReputationV2({ ip }) -// ip (string, required) +// ip (string, required): IP address to look up async function main(): Promise { const result = await api.ipReputationV2({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); @@ -588,7 +588,7 @@ main().catch(async (err: unknown) => { // Runnable example: IP Reputation Lookup (v2.0) (GET /v2.0/security) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. package main diff --git a/docs/endpoints/ip-whois.md b/docs/endpoints/ip-whois.md index d8927ba..ac13d16 100644 --- a/docs/endpoints/ip-whois.md +++ b/docs/endpoints/ip-whois.md @@ -16,8 +16,8 @@ WHOIS for an IP address. 1 credit. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `ip` | query | yes | string | | | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `ip` | query | yes | string | | IP address to look up. | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`IpWhoisResponse`) @@ -221,8 +221,8 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.IPWHOISApi(client) # ip_whois parameters: - # ip (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # ip (str, required): IP address to look up + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.ip_whois("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -241,8 +241,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new IPWHOISApi(config); // ipWhois({ ip, format? }) -// ip (string, required) -// format ("json" | "xml", optional): default "json" +// ip (string, required): IP address to look up +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.ipWhois({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); @@ -267,8 +267,8 @@ main().catch(async (err: unknown) => { // Runnable example: IP WHOIS Lookup (GET /v1.0/ip-whois) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main diff --git a/docs/endpoints/ssl.md b/docs/endpoints/ssl.md index 8c46064..aeebbb9 100644 --- a/docs/endpoints/ssl.md +++ b/docs/endpoints/ssl.md @@ -16,10 +16,10 @@ Real-time SSL cert with optional chain. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `domainName` | query | yes | string | | | -| `chain` | query | no | boolean | `false` | | -| `sslRaw` | query | no | boolean | `false` | | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `domainName` | query | yes | string | | Domain to look up. | +| `chain` | query | no | boolean | `false` | Set true to return the full certificate chain, ordered from the end-user certificate to the root. Defaults to false. | +| `sslRaw` | query | no | boolean | `false` | Set true to include the raw OpenSSL response for the domain. Defaults to false. | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`SslResponse`) @@ -71,10 +71,10 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.SSLApi(client) # ssl_lookup parameters: - # domain_name (str, required) - # chain (bool, optional, keyword): default False - # ssl_raw (bool, optional, keyword): default False - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # chain (bool, optional, keyword): Set true to return the full certificate chain, ordered from the end-user cert...; default False + # ssl_raw (bool, optional, keyword): Set true to include the raw OpenSSL response for the domain. Defaults to false; default False + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.ssl_lookup("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -93,10 +93,10 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new SSLApi(config); // sslLookup({ domainName, chain?, sslRaw?, format? }) -// domainName (string, required) -// chain (boolean, optional): default false -// sslRaw (boolean, optional): default false -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user cert...; default false +// sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false; default false +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.sslLookup({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -121,10 +121,10 @@ main().catch(async (err: unknown) => { // Runnable example: SSL Certificate Lookup (GET /v1.0/ssl/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main diff --git a/docs/endpoints/subdomains.md b/docs/endpoints/subdomains.md index 020220e..aa7ece1 100644 --- a/docs/endpoints/subdomains.md +++ b/docs/endpoints/subdomains.md @@ -16,12 +16,12 @@ All subdomains including nested. 2 credits per query. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `domain` | query | yes | string | | | -| `after` | query | no | string (date) | | | -| `before` | query | no | string (date) | | | -| `status` | query | no | string | | (one of: active, inactive) | -| `page` | query | no | integer | `1` | | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `domain` | query | yes | string | | Domain whose subdomains you want. | +| `after` | query | no | string (date) | | Only return records created after this date, in YYYY-MM-DD format. Defaults to the oldest record held, and must not be in the future or later than before. | +| `before` | query | no | string (date) | | Only return records created before this date, in YYYY-MM-DD format. Defaults to today, and must not be in the future. | +| `status` | query | no | string | | Limit results to active or inactive subdomains. Both are returned when the parameter is left out. (one of: active, inactive) | +| `page` | query | no | integer | `1` | Page of results to return. Defaults to 1. | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`SubdomainsResponse`) @@ -70,12 +70,12 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.SubdomainsApi(client) # subdomains parameters: - # domain (str, required) - # after (datetime.date, optional, keyword) - # before (datetime.date, optional, keyword) - # status (str, optional, keyword): one of active, inactive - # page (int, optional, keyword): default 1 - # format (str, optional, keyword): one of json, xml; default "json" + # domain (str, required): Domain whose subdomains you want + # after (datetime.date, optional, keyword): Only return records created after this date, in YYYY-MM-DD format. Defaults t... + # before (datetime.date, optional, keyword): Only return records created before this date, in YYYY-MM-DD format. Defaults ... + # status (str, optional, keyword): Limit results to active or inactive subdomains. Both are returned when the pa...; one of active, inactive + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.subdomains("whoisfreaks.com", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -94,12 +94,12 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new SubdomainsApi(config); // subdomains({ domain, after?, before?, status?, page?, format? }) -// domain (string, required) -// after (Date, optional) -// before (Date, optional) -// status ("active" | "inactive", optional) -// page (number, optional): default 1 -// format ("json" | "xml", optional): default "json" +// domain (string, required): Domain whose subdomains you want +// after (Date, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults t... +// before (Date, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults ... +// status ("active" | "inactive", optional): Limit results to active or inactive subdomains. Both are returned when the pa... +// page (number, optional): Page of results to return. Defaults to 1; default 1 +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.subdomains({ domain: "whoisfreaks.com", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -124,12 +124,12 @@ main().catch(async (err: unknown) => { // Runnable example: Subdomains Lookup (GET /v1.0/subdomains) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main diff --git a/docs/endpoints/typosquatting.md b/docs/endpoints/typosquatting.md index f1b4950..1e9d240 100644 --- a/docs/endpoints/typosquatting.md +++ b/docs/endpoints/typosquatting.md @@ -4,7 +4,7 @@ Detect typo variants of brand domains -1 endpoint. Requests need your API key unless noted otherwise. See [Authentication](../authentication.md). +2 endpoints. Requests need your API key unless noted otherwise. See [Authentication](../authentication.md). ## Typosquatting Lookup @@ -16,9 +16,9 @@ Find typo variants of a brand. 5 credits per page. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `keyword` | query | no | string | | | -| `pattern` | query | no | string | | | -| `pageToken` | query | no | string | | | +| `keyword` | query | no | string | | Brand or label to find typo variants for. Pass either keyword or pattern, not both. | +| `pattern` | query | no | string | | Wildcard search string, where '*' matches any characters. Pass either keyword or pattern, not both. | +| `pageToken` | query | no | string | | Token from nextPageToken in the previous response, needed from page 2 onward. Send it with the original keyword or pattern. | **Response** (`TyposquattingResponse`) @@ -67,9 +67,9 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.TyposquattingApi(client) # typosquatting parameters: - # keyword (str, optional, keyword) - # pattern (str, optional, keyword) - # page_token (str, optional, keyword) + # keyword (str, optional, keyword): Brand or label to find typo variants for. Pass either keyword or pattern, not... + # pattern (str, optional, keyword): Wildcard search string, where '*' matches any characters. Pass either keyword... + # page_token (str, optional, keyword): Token from nextPageToken in the previous response, needed from page 2 onward.... result = api.typosquatting(keyword="whoisfreaks") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -88,9 +88,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new TyposquattingApi(config); // typosquatting({ keyword?, pattern?, pageToken? }) -// keyword (string, optional) -// pattern (string, optional) -// pageToken (string, optional) +// keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not... +// pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword... +// pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward.... async function main(): Promise { const result = await api.typosquatting({ keyword: "whoisfreaks" }); console.log(JSON.stringify(result, null, 2)); @@ -115,9 +115,9 @@ main().catch(async (err: unknown) => { // Runnable example: Typosquatting Lookup (GET /v3.0/domain/typos) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... package main @@ -150,3 +150,153 @@ func main() { --- + +## Subdomain Typosquatting Lookup + +`GET https://api.whoisfreaks.com/v3.0/subdomains/typos` + +Find subdomains that carry a typo variant of a brand as one of their labels, such as login.paypa1.example.com. Phishing pages often hide the brand in the subdomain of an unrelated domain, so these hosts never show up in a domain typosquatting search. Pass either keyword or pattern, not both. 5 credits per page. + +**Parameters** + +| Parameter | In | Required | Type | Default | Description | +|-----------|----|----------|------|---------|-------------| +| `keyword` | query | no | string | | Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphens, a single label with no dots, and it cannot start or end with a hyphen. | +| `pattern` | query | no | string | | Wildcard search string, where '*' matches any characters and '?' matches one. At most 2 wildcards, at least 5 characters besides the wildcards, and no more than 63 characters in total. | +| `pageToken` | query | no | string | | Token from nextPageToken in the previous response, needed from page 2 onward. Send it with the original keyword or pattern. | +| `fetch_size` | query | no | integer | `100` | Subdomains per page. 100 when the parameter is left out, and values above 10000 are capped at 10000. | + +**Response** (`TyposquatSubdomainsResponse`) + +| Field | Type | Description | +|-------|------|-------------| +| `status` | boolean | | +| `totalRecords` | integer | | +| `currentPage` | integer | | +| `totalPages` | integer | | +| `hasNextPage` | boolean | | +| `nextPageToken` | string | | +| `subdomains` | array | | + +
TyposquatSubdomain object + +| Field | Type | Description | +|-------|------|-------------| +| `subdomain` | string | The matching hostname. | +| `domain` | string | The registrable domain the subdomain belongs to. | +| `status` | string | Whether the subdomain is still resolving. | +| `firstSeen` | string | Date the subdomain was first seen, in YYYY-MM-DD format. | +| `lastSeen` | string | Date the subdomain was last seen, in YYYY-MM-DD format. | +| `inactiveFrom` | string | Date the subdomain stopped resolving, absent while it is active. | + +
+ + +**Usage** + +
Python + +```python +"""Subdomain Typosquatting Lookup: GET https://api.whoisfreaks.com/v3.0/subdomains/typos + +Run it with your API key in the environment: + WHOISFREAKS_API_KEY=your_api_key python SubdomainTyposquatting.py +""" +import json +import os + +import whoisfreaks + +config = whoisfreaks.Configuration() +config.api_key["ApiKeyAuth"] = os.environ["WHOISFREAKS_API_KEY"] # set once for every request + +with whoisfreaks.ApiClient(config) as client: + api = whoisfreaks.TyposquattingApi(client) + + # subdomain_typosquatting parameters: + # keyword (str, optional, keyword): Brand or label to find typo variants for. 3 to 63 characters, letters, digits... + # pattern (str, optional, keyword): Wildcard search string, where '*' matches any characters and '?' matches one.... + # page_token (str, optional, keyword): Token from nextPageToken in the previous response, needed from page 2 onward.... + # fetch_size (int, optional, keyword): Subdomains per page. 100 when the parameter is left out, and values above 100...; default 100 + result = api.subdomain_typosquatting() + print(json.dumps(result.to_dict(), indent=2)) +``` + +
+ +
TypeScript + +```typescript +// Subdomain Typosquatting Lookup: GET https://api.whoisfreaks.com/v3.0/subdomains/typos +// Run: WHOISFREAKS_API_KEY=your_api_key npx tsx SubdomainTyposquatting.ts +import { Configuration, TyposquattingApi, ResponseError } from "whoisfreaks"; + +// Set the API key once; the client adds it to every request. +const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); +const api = new TyposquattingApi(config); + +// subdomainTyposquatting({ keyword?, pattern?, pageToken?, fetch_size? }) +// keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits... +// pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one.... +// pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward.... +// fetch_size (number, optional): Subdomains per page. 100 when the parameter is left out, and values above 100...; default 100 +async function main(): Promise { + const result = await api.subdomainTyposquatting(); + console.log(JSON.stringify(result, null, 2)); +} + +main().catch(async (err: unknown) => { + // API errors carry the HTTP response + if (err instanceof ResponseError) { + console.error(`HTTP ${err.response.status}: ${await err.response.text()}`); + } else { + console.error(err); + } + process.exitCode = 1; +}); +``` + +
+ +
Go + +```go +// Runnable example: Subdomain Typosquatting Lookup (GET /v3.0/subdomains/typos) +// Run it from the Getting Started module: save it as main.go, then `go run .` +// Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +// - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +// - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +// - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... + +package main + +import ( + "context" + "encoding/json" + "fmt" + "log" + "os" + + whoisfreaks "github.com/WhoisFreaks/whoisfreaks-go" +) + +func main() { + // Set the API key once on the context; every call made with ctx sends it. + ctx := context.WithValue(context.Background(), whoisfreaks.ContextAPIKeys, + map[string]whoisfreaks.APIKey{"ApiKeyAuth": {Key: os.Getenv("WHOISFREAKS_API_KEY")}}) + client := whoisfreaks.NewAPIClient(whoisfreaks.NewConfiguration()) + + result, _, err := client.TyposquattingAPI.SubdomainTyposquatting(ctx).Keyword("paypal").Execute() + if err != nil { + log.Fatal(err) + } + out, _ := json.MarshalIndent(result, "", " ") + fmt.Println(string(out)) +} + +``` + +
+ +--- diff --git a/docs/endpoints/whois.md b/docs/endpoints/whois.md index dcdb8c4..b68b1a0 100644 --- a/docs/endpoints/whois.md +++ b/docs/endpoints/whois.md @@ -16,8 +16,8 @@ Real-time WHOIS lookup from authoritative servers. Cost 1 credit. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `domainName` | query | yes | string | | | -| `format` | query | no | string | `json` | (one of: json, xml) | +| `domainName` | query | yes | string | | Domain to look up. | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`WhoisResponse`) @@ -152,8 +152,8 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.WHOISApi(client) # whois_live parameters: - # domain_name (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.whois_live("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -172,8 +172,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new WHOISApi(config); // whoisLive({ domainName, format? }) -// domainName (string, required) -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.whoisLive({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -198,8 +198,8 @@ main().catch(async (err: unknown) => { // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -243,7 +243,7 @@ Up to 100 domains in one request. 1 credit per successful domain. | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| -| `format` | query | no | string | `json` | (one of: json, xml) | +| `format` | query | no | string | `json` | Response format. JSON when the parameter is left out. (one of: json, xml) | **Request body** (`application/json`, model `BulkWhoisRequest`) @@ -313,7 +313,7 @@ with whoisfreaks.ApiClient(config) as client: # bulk_whois parameters: # bulk_whois_request (BulkWhoisRequest, required): request body - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" body = whoisfreaks.BulkWhoisRequest(domain_names=["whoisfreaks.com", "jfreaks.com"]) result = api.bulk_whois(body) print(json.dumps(result.to_dict(), indent=2)) @@ -334,7 +334,7 @@ const api = new WHOISApi(config); // bulkWhois({ bulkWhoisRequest, format? }) // bulkWhoisRequest (BulkWhoisRequest, required): request body -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const body: BulkWhoisRequest = { domainNames: ["whoisfreaks.com", "jfreaks.com"] }; const result = await api.bulkWhois({ bulkWhoisRequest: body }); @@ -360,7 +360,7 @@ main().catch(async (err: unknown) => { // Runnable example: Bulk WHOIS Lookup (POST /v2.0/bulkwhois/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object package main @@ -407,7 +407,7 @@ Every WHOIS record captured for the domain since 1986, in one response (no pagin | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `domainName` | query | yes | string | | Domain to fetch historical WHOIS records for | -| `format` | query | no | string | | (one of: json, xml) | +| `format` | query | no | string | | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`WhoisHistoricalResponse`) @@ -472,7 +472,7 @@ with whoisfreaks.ApiClient(config) as client: # whois_history parameters: # domain_name (str, required): Domain to fetch historical WHOIS records for - # format (str, optional, keyword): one of json, xml + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml result = api.whois_history("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -492,7 +492,7 @@ const api = new WHOISApi(config); // whoisHistory({ domainName, format? }) // domainName (string, required): Domain to fetch historical WHOIS records for -// format ("json" | "xml", optional) +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out async function main(): Promise { const result = await api.whoisHistory({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -518,7 +518,7 @@ main().catch(async (err: unknown) => { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -556,13 +556,15 @@ func main() { `GET https://api.whoisfreaks.com/v2.0/whois/reverse` +Find every domain whose WHOIS record carries a keyword, owner name, company, email or postal address. Results are paginated 100 domains per page. + **Parameters** | Parameter | In | Required | Type | Default | Description | |-----------|----|----------|------|---------|-------------| | `keyword` | query | yes | string | | Keyword to search across WHOIS records | | `page` | query | no | integer | | Page number | -| `format` | query | no | string | | (one of: json, xml) | +| `format` | query | no | string | | Response format. JSON when the parameter is left out. (one of: json, xml) | **Response** (`ReverseWhoisResponse`) @@ -628,7 +630,7 @@ with whoisfreaks.ApiClient(config) as client: # whois_reverse parameters: # keyword (str, required): Keyword to search across WHOIS records # page (int, optional, keyword): Page number - # format (str, optional, keyword): one of json, xml + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml result = api.whois_reverse("whoisfreaks", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -649,7 +651,7 @@ const api = new WHOISApi(config); // whoisReverse({ keyword, page?, format? }) // keyword (string, required): Keyword to search across WHOIS records // page (number, optional): Page number -// format ("json" | "xml", optional) +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out async function main(): Promise { const result = await api.whoisReverse({ keyword: "whoisfreaks", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -676,7 +678,7 @@ main().catch(async (err: unknown) => { // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main diff --git a/docs/languages/csharp.md b/docs/languages/csharp.md index f9a01f1..d016f18 100644 --- a/docs/languages/csharp.md +++ b/docs/languages/csharp.md @@ -73,8 +73,8 @@ See [Authentication](../authentication.md) for how to obtain a key. Minimal setu // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -93,7 +93,7 @@ Console.WriteLine(result.ToJson()); ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -105,8 +105,8 @@ All 94 endpoints are shown below, grouped by category. Each includes its method, // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -131,7 +131,7 @@ Console.WriteLine(result.ToJson()); // Runnable example: Bulk WHOIS Lookup (POST /v2.0/bulkwhois/live) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object using System; using System.Collections.Generic; @@ -160,7 +160,7 @@ Console.WriteLine(result.ToJson()); // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -187,7 +187,7 @@ Console.WriteLine(result.ToJson()); // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -214,10 +214,10 @@ Console.WriteLine(result.ToJson()); // Runnable example: Live DNS Lookup (GET /v2.0/dns/live) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -242,10 +242,10 @@ Console.WriteLine(result.ToJson()); // Runnable example: Historical DNS Lookup (GET /v2.0/dns/historical) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -271,10 +271,10 @@ Console.WriteLine(result.ToJson()); // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -299,12 +299,12 @@ Console.WriteLine(result.ToJson()); // Runnable example: Historical DNS Lookup (v2.2) (GET /v2.2/dns/historical) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -329,12 +329,12 @@ Console.WriteLine(result.ToJson()); // Runnable example: Historical DNS Lookup (v2.3) (GET /v2.3/dns/historical) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -360,12 +360,12 @@ Console.WriteLine(result.ToJson()); // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -391,12 +391,12 @@ Console.WriteLine(result.ToJson()); // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -421,8 +421,8 @@ Console.WriteLine(result.ToJson()); // Runnable example: Bulk DNS Lookup (POST /v2.0/dns/bulk/live) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object using System; using System.Collections.Generic; @@ -455,7 +455,7 @@ Console.WriteLine(result.ToJson()); // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -481,7 +481,7 @@ Console.WriteLine(result.ToJson()); // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object using System; using System.Collections.Generic; @@ -511,9 +511,9 @@ Console.WriteLine(result.ToJson()); // Runnable example: Typosquatting Lookup (GET /v3.0/domain/typos) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -530,6 +530,34 @@ Console.WriteLine(result.ToJson()); ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```csharp +// Runnable example: Subdomain Typosquatting Lookup (GET /v3.0/subdomains/typos) +// Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` +// Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +// - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +// - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +// - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... +using System; +using WhoisFreaks.Api; +using WhoisFreaks.Client; +using WhoisFreaks.Model; + +var config = new Configuration(); +var apiKey = Environment.GetEnvironmentVariable("WHOISFREAKS_API_KEY") + ?? throw new InvalidOperationException("Set the WHOISFREAKS_API_KEY environment variable"); +config.AddApiKey("apiKey", apiKey); // set once, sent with every call +var api = new TyposquattingApi(config); + +TyposquatSubdomainsResponse result = api.SubdomainTyposquatting(keyword: "paypal"); +Console.WriteLine(result.ToJson()); + +``` + ### SSL #### SSL Certificate Lookup @@ -540,10 +568,10 @@ Console.WriteLine(result.ToJson()); // Runnable example: SSL Certificate Lookup (GET /v1.0/ssl/live) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -570,7 +598,7 @@ Console.WriteLine(result.ToJson()); // Runnable example: IP Geolocation Lookup (GET /v1.0/geolocation) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -627,12 +655,12 @@ foreach (var item in result) // Runnable example: Subdomains Lookup (GET /v1.0/subdomains) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -659,7 +687,7 @@ Console.WriteLine(result.ToJson()); // Runnable example: IP Reputation Lookup (GET /v1.0/security) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -714,7 +742,7 @@ foreach (var item in result) // Runnable example: IP Reputation Lookup (v2.0) (GET /v2.0/security) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -772,7 +800,7 @@ foreach (var item in result) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -799,8 +827,8 @@ Console.WriteLine(result.ToJson()); // Runnable example: ASN WHOIS Lookup (GET /v2.0/asn-whois) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -827,8 +855,8 @@ Console.WriteLine(result.ToJson()); // Runnable example: IP WHOIS Lookup (GET /v1.0/ip-whois) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. using System; using WhoisFreaks.Api; using WhoisFreaks.Client; @@ -930,9 +958,9 @@ Console.WriteLine(result.ToJson()); // Runnable example: Newly Registered gTLD (CSV) (GET /v3.1/download/domainer/gtld) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... using System; using System.IO; using WhoisFreaks.Api; @@ -964,9 +992,9 @@ Console.WriteLine($"Saved {new FileInfo(path).Length} bytes to {path}"); // Runnable example: Newly Registered ccTLD (CSV) (GET /v3.1/download/domainer/cctld) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... using System; using System.IO; using WhoisFreaks.Api; @@ -1063,7 +1091,7 @@ Console.WriteLine($"Saved {new FileInfo(path).Length} bytes to {path}"); // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... using System; using System.Collections.Generic; using WhoisFreaks.Api; @@ -1092,7 +1120,7 @@ foreach (var item in result) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... using System; using System.Collections.Generic; using WhoisFreaks.Api; @@ -1154,7 +1182,7 @@ Console.WriteLine($"Saved {new FileInfo(path).Length} bytes to {path}"); // Runnable example: Expiring Domains (GET /v3.1/download/domainer/expired) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest using System; using System.IO; @@ -1219,7 +1247,7 @@ Console.WriteLine($"Saved {new FileInfo(path).Length} bytes to {path}"); // Runnable example: Dropped Domains (GET /v3.1/download/domainer/dropped) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest using System; using System.IO; @@ -1253,7 +1281,7 @@ Console.WriteLine($"Saved {new FileInfo(path).Length} bytes to {path}"); // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... using System; using System.Collections.Generic; using WhoisFreaks.Api; @@ -1281,7 +1309,7 @@ foreach (var item in result) // Runnable example: Dropped With Backlinks (GET /v3.3/download/domainer/dropped/backlinks) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest using System; using System.IO; @@ -1635,7 +1663,7 @@ Console.WriteLine(result.ToJson()); // Runnable example: IP to Country Snapshot (GET /v3.3/download/snapshot/ip/country) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. using System; using System.IO; using WhoisFreaks.Api; @@ -1692,7 +1720,7 @@ Console.WriteLine(result.ToJson()); // Runnable example: IP to City Snapshot (GET /v3.3/download/snapshot/ip/city) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. using System; using System.IO; using WhoisFreaks.Api; @@ -1726,7 +1754,7 @@ Console.WriteLine($"Saved {new FileInfo(path).Length} bytes to {path}"); // Runnable example: ASN WHOIS Snapshot (GET /v3.3/download/snapshot/asn/whois) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. using System; using System.IO; using WhoisFreaks.Api; @@ -1785,7 +1813,7 @@ Console.WriteLine(result.ToJson()); // Runnable example: IP WHOIS Snapshot (GET /v3.3/download/snapshot/ip/whois) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. using System; using System.IO; using WhoisFreaks.Api; @@ -1844,7 +1872,7 @@ Console.WriteLine(result.ToJson()); // Runnable example: IP Security Snapshot (GET /v3.3/download/snapshot/ip/security) // Run it from the Getting Started project: replace Program.cs with this file, then `dotnet run` // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. using System; using System.IO; using WhoisFreaks.Api; diff --git a/docs/languages/go.md b/docs/languages/go.md index f6d217a..b41aced 100644 --- a/docs/languages/go.md +++ b/docs/languages/go.md @@ -83,8 +83,8 @@ See [Authentication](../authentication.md) for how to obtain a key. Minimal setu // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -116,7 +116,7 @@ func main() { ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -128,8 +128,8 @@ All 94 endpoints are shown below, grouped by category. Each includes its method, // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -167,7 +167,7 @@ func main() { // Runnable example: Bulk WHOIS Lookup (POST /v2.0/bulkwhois/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object package main @@ -208,7 +208,7 @@ func main() { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -248,7 +248,7 @@ func main() { // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -288,10 +288,10 @@ func main() { // Runnable example: Live DNS Lookup (GET /v2.0/dns/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -330,10 +330,10 @@ func main() { // Runnable example: Historical DNS Lookup (GET /v2.0/dns/historical) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -373,10 +373,10 @@ func main() { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -414,12 +414,12 @@ func main() { // Runnable example: Historical DNS Lookup (v2.2) (GET /v2.2/dns/historical) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -458,12 +458,12 @@ func main() { // Runnable example: Historical DNS Lookup (v2.3) (GET /v2.3/dns/historical) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -503,12 +503,12 @@ func main() { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -547,12 +547,12 @@ func main() { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -590,8 +590,8 @@ func main() { // Runnable example: Bulk DNS Lookup (POST /v2.0/dns/bulk/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object package main @@ -637,7 +637,7 @@ func main() { // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -677,7 +677,7 @@ func main() { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object package main @@ -721,9 +721,9 @@ func main() { // Runnable example: Typosquatting Lookup (GET /v3.0/domain/typos) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... package main @@ -753,6 +753,47 @@ func main() { ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```go +// Runnable example: Subdomain Typosquatting Lookup (GET /v3.0/subdomains/typos) +// Run it from the Getting Started module: save it as main.go, then `go run .` +// Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +// - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +// - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +// - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... + +package main + +import ( + "context" + "encoding/json" + "fmt" + "log" + "os" + + whoisfreaks "github.com/WhoisFreaks/whoisfreaks-go" +) + +func main() { + // Set the API key once on the context; every call made with ctx sends it. + ctx := context.WithValue(context.Background(), whoisfreaks.ContextAPIKeys, + map[string]whoisfreaks.APIKey{"ApiKeyAuth": {Key: os.Getenv("WHOISFREAKS_API_KEY")}}) + client := whoisfreaks.NewAPIClient(whoisfreaks.NewConfiguration()) + + result, _, err := client.TyposquattingAPI.SubdomainTyposquatting(ctx).Keyword("paypal").Execute() + if err != nil { + log.Fatal(err) + } + out, _ := json.MarshalIndent(result, "", " ") + fmt.Println(string(out)) +} + +``` + ### SSL #### SSL Certificate Lookup @@ -763,10 +804,10 @@ func main() { // Runnable example: SSL Certificate Lookup (GET /v1.0/ssl/live) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -806,7 +847,7 @@ func main() { // Runnable example: IP Geolocation Lookup (GET /v1.0/geolocation) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. package main @@ -886,12 +927,12 @@ func main() { // Runnable example: Subdomains Lookup (GET /v1.0/subdomains) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -931,7 +972,7 @@ func main() { // Runnable example: IP Reputation Lookup (GET /v1.0/security) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. package main @@ -1009,7 +1050,7 @@ func main() { // Runnable example: IP Reputation Lookup (v2.0) (GET /v2.0/security) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. package main @@ -1090,7 +1131,7 @@ func main() { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -1131,8 +1172,8 @@ func main() { // Runnable example: ASN WHOIS Lookup (GET /v2.0/asn-whois) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -1172,8 +1213,8 @@ func main() { // Runnable example: IP WHOIS Lookup (GET /v1.0/ip-whois) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. package main @@ -1326,9 +1367,9 @@ func main() { // Runnable example: Newly Registered gTLD (CSV) (GET /v3.1/download/domainer/gtld) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main @@ -1381,9 +1422,9 @@ func main() { // Runnable example: Newly Registered ccTLD (CSV) (GET /v3.1/download/domainer/cctld) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main @@ -1543,7 +1584,7 @@ func main() { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main @@ -1583,7 +1624,7 @@ func main() { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main @@ -1676,7 +1717,7 @@ func main() { // Runnable example: Expiring Domains (GET /v3.1/download/domainer/expired) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest package main @@ -1783,7 +1824,7 @@ func main() { // Runnable example: Dropped Domains (GET /v3.1/download/domainer/dropped) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest package main @@ -1838,7 +1879,7 @@ func main() { // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... package main @@ -1877,7 +1918,7 @@ func main() { // Runnable example: Dropped With Backlinks (GET /v3.3/download/domainer/dropped/backlinks) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest package main @@ -2448,7 +2489,7 @@ func main() { // Runnable example: IP to Country Snapshot (GET /v3.3/download/snapshot/ip/country) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main @@ -2538,7 +2579,7 @@ func main() { // Runnable example: IP to City Snapshot (GET /v3.3/download/snapshot/ip/city) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main @@ -2592,7 +2633,7 @@ func main() { // Runnable example: ASN WHOIS Snapshot (GET /v3.3/download/snapshot/asn/whois) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main @@ -2684,7 +2725,7 @@ func main() { // Runnable example: IP WHOIS Snapshot (GET /v3.3/download/snapshot/ip/whois) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main @@ -2776,7 +2817,7 @@ func main() { // Runnable example: IP Security Snapshot (GET /v3.3/download/snapshot/ip/security) // Run it from the Getting Started module: save it as main.go, then `go run .` // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. package main diff --git a/docs/languages/java.md b/docs/languages/java.md index 5b16005..f801afc 100644 --- a/docs/languages/java.md +++ b/docs/languages/java.md @@ -119,8 +119,8 @@ See [Authentication](../authentication.md) for how to obtain a key. Minimal setu // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=WhoisLive // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.WhoisApi; @@ -144,7 +144,7 @@ public class WhoisLive { ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -156,8 +156,8 @@ All 94 endpoints are shown below, grouped by category. Each includes its method, // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=WhoisLive // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.WhoisApi; @@ -187,7 +187,7 @@ public class WhoisLive { // Runnable example: Bulk WHOIS Lookup (POST /v2.0/bulkwhois/live) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=BulkWhois // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; @@ -224,7 +224,7 @@ public class BulkWhois { // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=WhoisHistory // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.WhoisApi; @@ -256,7 +256,7 @@ public class WhoisHistory { // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.WhoisApi; @@ -288,10 +288,10 @@ public class WhoisReverse { // Runnable example: Live DNS Lookup (GET /v2.0/dns/live) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DnsLive // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DnsApi; @@ -321,10 +321,10 @@ public class DnsLive { // Runnable example: Historical DNS Lookup (GET /v2.0/dns/historical) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DnsHistorical // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DnsApi; @@ -355,10 +355,10 @@ public class DnsHistorical { // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DnsReverse // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DnsApi; @@ -388,12 +388,12 @@ public class DnsReverse { // Runnable example: Historical DNS Lookup (v2.2) (GET /v2.2/dns/historical) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DnsHistoricalV22 // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DnsApi; @@ -423,12 +423,12 @@ public class DnsHistoricalV22 { // Runnable example: Historical DNS Lookup (v2.3) (GET /v2.3/dns/historical) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DnsHistoricalV23 // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DnsApi; @@ -459,12 +459,12 @@ public class DnsHistoricalV23 { // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DnsReverseV22 // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DnsApi; @@ -495,12 +495,12 @@ public class DnsReverseV22 { // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DnsReverseV23 // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DnsApi; @@ -530,8 +530,8 @@ public class DnsReverseV23 { // Runnable example: Bulk DNS Lookup (POST /v2.0/dns/bulk/live) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DnsBulk // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; @@ -572,7 +572,7 @@ public class DnsBulk { // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DomainAvailabilityApi; @@ -603,7 +603,7 @@ public class DomainAvailabilityV2 { // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=BulkDomainAvailabilityV2 // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; @@ -641,9 +641,9 @@ public class BulkDomainAvailabilityV2 { // Runnable example: Typosquatting Lookup (GET /v3.0/domain/typos) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=Typosquatting // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.TyposquattingApi; @@ -665,6 +665,39 @@ public class Typosquatting { ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```java +// Runnable example: Subdomain Typosquatting Lookup (GET /v3.0/subdomains/typos) +// Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=SubdomainTyposquatting +// Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +// - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +// - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +// - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... +import com.whoisfreaks.client.ApiClient; +import com.whoisfreaks.client.Configuration; +import com.whoisfreaks.client.api.TyposquattingApi; +import com.whoisfreaks.client.auth.ApiKeyAuth; +import com.whoisfreaks.client.model.TyposquatSubdomainsResponse; + +public class SubdomainTyposquatting { + public static void main(String[] args) throws Exception { + ApiClient client = Configuration.getDefaultApiClient(); + ApiKeyAuth auth = (ApiKeyAuth) client.getAuthentication("ApiKeyAuth"); + auth.setApiKey(System.getenv("WHOISFREAKS_API_KEY")); // set once, sent with every call + TyposquattingApi api = new TyposquattingApi(client); + + // subdomainTyposquatting(keyword, pattern, pageToken, fetch_size); null leaves an optional parameter unset + TyposquatSubdomainsResponse result = api.subdomainTyposquatting("paypal", null, null, null); + System.out.println(result); + } +} + +``` + ### SSL #### SSL Certificate Lookup @@ -675,10 +708,10 @@ public class Typosquatting { // Runnable example: SSL Certificate Lookup (GET /v1.0/ssl/live) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=SslLookup // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.SslApi; @@ -710,7 +743,7 @@ public class SslLookup { // Runnable example: IP Geolocation Lookup (GET /v1.0/geolocation) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=Geolocation // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.GeolocationApi; @@ -776,12 +809,12 @@ public class BulkGeolocation { // Runnable example: Subdomains Lookup (GET /v1.0/subdomains) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=Subdomains // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.SubdomainsApi; @@ -813,7 +846,7 @@ public class Subdomains { // Runnable example: IP Reputation Lookup (GET /v1.0/security) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=IpReputation // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.IpReputationApi; @@ -877,7 +910,7 @@ public class BulkIpReputation { // Runnable example: IP Reputation Lookup (v2.0) (GET /v2.0/security) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=IpReputationV2 // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.IpReputationApi; @@ -944,7 +977,7 @@ public class BulkIpReputationV2 { // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DomainReputation // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DomainReputationApi; @@ -976,8 +1009,8 @@ public class DomainReputation { // Runnable example: ASN WHOIS Lookup (GET /v2.0/asn-whois) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=AsnWhois // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.AsnWhoisApi; @@ -1009,8 +1042,8 @@ public class AsnWhois { // Runnable example: IP WHOIS Lookup (GET /v1.0/ip-whois) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=IpWhois // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.IpWhoisApi; @@ -1128,9 +1161,9 @@ public class DatabaseFileStatus { // Runnable example: Newly Registered gTLD (CSV) (GET /v3.1/download/domainer/gtld) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbNewlyGtld // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesNewlyRegisteredApi; @@ -1169,9 +1202,9 @@ public class DbNewlyGtld { // Runnable example: Newly Registered ccTLD (CSV) (GET /v3.1/download/domainer/cctld) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbNewlyCctld // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesNewlyRegisteredApi; @@ -1287,7 +1320,7 @@ public class DbNewlyCctldCleaned { // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbNewlyGtldJson // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesNewlyRegisteredApi; @@ -1320,7 +1353,7 @@ public class DbNewlyGtldJson { // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbNewlyCctldJson // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesNewlyRegisteredApi; @@ -1392,7 +1425,7 @@ public class DbNewlyDns { // Runnable example: Expiring Domains (GET /v3.1/download/domainer/expired) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbExpired // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; @@ -1469,7 +1502,7 @@ public class DbExpiredCleaned { // Runnable example: Dropped Domains (GET /v3.1/download/domainer/dropped) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbDropped // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; @@ -1509,7 +1542,7 @@ public class DbDropped { // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbDroppedJson // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesExpiringDroppedApi; @@ -1541,7 +1574,7 @@ public class DbDroppedJson { // Runnable example: Dropped With Backlinks (GET /v3.3/download/domainer/dropped/backlinks) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbDroppedBacklinks // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; @@ -1960,7 +1993,7 @@ public class DbIpCountryStatus { // Runnable example: IP to Country Snapshot (GET /v3.3/download/snapshot/ip/country) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbIpCountry // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesIpGeolocationApi; @@ -2027,7 +2060,7 @@ public class DbIpCityStatus { // Runnable example: IP to City Snapshot (GET /v3.3/download/snapshot/ip/city) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbIpCity // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesIpGeolocationApi; @@ -2067,7 +2100,7 @@ public class DbIpCity { // Runnable example: ASN WHOIS Snapshot (GET /v3.3/download/snapshot/asn/whois) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbAsnWhois // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesAsnWhoisApi; @@ -2136,7 +2169,7 @@ public class DbAsnWhoisStatus { // Runnable example: IP WHOIS Snapshot (GET /v3.3/download/snapshot/ip/whois) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbIpWhois // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesIpWhoisApi; @@ -2205,7 +2238,7 @@ public class DbIpWhoisStatus { // Runnable example: IP Security Snapshot (GET /v3.3/download/snapshot/ip/security) // Run it from the Getting Started project: mvn -q compile exec:java -Dexec.mainClass=DbIpSecurity // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.ApiClient; import com.whoisfreaks.client.Configuration; import com.whoisfreaks.client.api.DatabasesIpSecurityApi; diff --git a/docs/languages/javascript.md b/docs/languages/javascript.md index 6b49853..aeeecf1 100644 --- a/docs/languages/javascript.md +++ b/docs/languages/javascript.md @@ -83,8 +83,8 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new WHOISApi(client); // whoisLive(domainName, opts) -// domainName (string, required) -// opts.format (string, optional): one of json, xml; default "json" +// domainName (string, required): Domain to look up +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.whoisLive("whoisfreaks.com"); console.log(JSON.stringify(result, null, 2)); @@ -99,7 +99,7 @@ main().catch((err) => { ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -118,8 +118,8 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new WHOISApi(client); // whoisLive(domainName, opts) -// domainName (string, required) -// opts.format (string, optional): one of json, xml; default "json" +// domainName (string, required): Domain to look up +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.whoisLive("whoisfreaks.com"); console.log(JSON.stringify(result, null, 2)); @@ -148,7 +148,7 @@ const api = new WHOISApi(client); // bulkWhois(bulkWhoisRequest, opts) // bulkWhoisRequest (BulkWhoisRequest, required): request body -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const body = BulkWhoisRequest.constructFromObject({ domainNames: ["whoisfreaks.com", "jfreaks.com"] }); const result = await api.bulkWhois(body); @@ -178,7 +178,7 @@ const api = new WHOISApi(client); // whoisHistory(domainName, opts) // domainName (string, required): Domain to fetch historical WHOIS records for -// opts.format (string, optional): one of json, xml +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml async function main() { const result = await api.whoisHistory("whoisfreaks.com"); console.log(JSON.stringify(result, null, 2)); @@ -208,7 +208,7 @@ const api = new WHOISApi(client); // whoisReverse(keyword, opts) // keyword (string, required): Keyword to search across WHOIS records // opts.page (number, optional): Page number -// opts.format (string, optional): one of json, xml +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml async function main() { const result = await api.whoisReverse("whoisfreaks", { page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -239,9 +239,9 @@ const api = new DNSApi(client); // dnsLive(type, opts) // type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME; default "all" -// opts.domainName (string, optional) +// opts.domainName (string, optional): Domain to look up // opts.ipAddress (string, optional): Use for PTR lookups -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.dnsLive("A,MX,TXT", { domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -269,10 +269,10 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DNSApi(client); // dnsHistorical(domainName, type, opts) -// domainName (string, required) -// type (string, required): default "all" -// opts.page (number, optional): default 1 -// opts.format (string, optional): one of json, xml; default "json" +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// opts.page (number, optional): Page of results to return. Defaults to 1; default 1 +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.dnsHistorical("whoisfreaks.com", "A,MX,TXT", { page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -301,10 +301,10 @@ const api = new DNSApi(client); // dnsReverse(value, type, opts) // value (string, required): IP, CIDR, or record value -// type (string, required): one of a, mx, cname, ns, aaaa, txt, soa -// opts.exact (boolean, optional): default true -// opts.page (number, optional): default 1 -// opts.format (string, optional): one of json, xml; default "json" +// type (string, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa +// opts.exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as...; default false +// opts.page (number, optional): Page of results to return. Defaults to 1; default 1 +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.dnsReverse("8.8.8.8", "a", { page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -332,12 +332,12 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DNSApi(client); // dnsHistoricalV22(domainName, type, opts) -// domainName (string, required) -// type (string, required): default "all" -// opts.page (number, optional): default 1 +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// opts.page (number, optional): Page of results to return. Defaults to 1; default 1 // opts.sort (string, optional): Sort direction. Omit to leave the results unsorted; one of asc, desc // opts.sortBy (string, optional): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.dnsHistoricalV22("whoisfreaks.com", "A,MX,TXT", { page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -365,12 +365,12 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DNSApi(client); // dnsHistoricalV23(domainName, type, opts) -// domainName (string, required) -// type (string, required): default "all" -// opts.page (number, optional): default 1 +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// opts.page (number, optional): Page of results to return. Defaults to 1; default 1 // opts.sort (string, optional): Sort direction. Omit to leave the results unsorted; one of asc, desc // opts.sortBy (string, optional): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.dnsHistoricalV23("whoisfreaks.com", "A,MX,TXT", { page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -399,12 +399,12 @@ const api = new DNSApi(client); // dnsReverseV22(value, type, opts) // value (string, required): IP, CIDR, or record value -// type (string, required): one of a, mx, cname, ns, aaaa, txt, soa +// type (string, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa // opts.exact (boolean, optional): When false the value is matched as a substring, which is far slower than an e...; default true -// opts.page (number, optional): default 1 +// opts.page (number, optional): Page of results to return. Defaults to 1; default 1 // opts.sort (string, optional): Sort direction. Omit to leave the results unsorted; one of asc, desc // opts.sortBy (string, optional): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.dnsReverseV22("8.8.8.8", "a", { page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -433,12 +433,12 @@ const api = new DNSApi(client); // dnsReverseV23(value, type, opts) // value (string, required): IP, CIDR, or record value -// type (string, required): one of a, mx, cname, ns, aaaa, txt, soa +// type (string, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa // opts.exact (boolean, optional): When false the value is matched as a substring, which is far slower than an e...; default true -// opts.page (number, optional): default 1 +// opts.page (number, optional): Page of results to return. Defaults to 1; default 1 // opts.sort (string, optional): Sort direction. Omit to leave the results unsorted; one of asc, desc // opts.sortBy (string, optional): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.dnsReverseV23("8.8.8.8", "a", { page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -466,9 +466,9 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DNSApi(client); // dnsBulk(type, dnsBulkRequest, opts) -// type (string, required): default "all" +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" // dnsBulkRequest (DnsBulkRequest, required): request body -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const body = DnsBulkRequest.constructFromObject({ domainNames: ["whoisfreaks.com", "example.com"] }); const result = await api.dnsBulk("A,MX,TXT", body); @@ -502,7 +502,7 @@ const api = new DomainAvailabilityApi(client); // domain (string, required): The domain name to check // opts.sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain; default false // opts.count (number, optional): Number of TLD suggestions to return when sug=true. Maximum is 100; default 5 -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.domainAvailabilityV2("google.com", { sug: true, count: 5 }); console.log(JSON.stringify(result, null, 2)); @@ -532,7 +532,7 @@ const api = new DomainAvailabilityApi(client); // bulkDomainAvailabilityV2(bulkDomainAvailabilityRequest, opts) // bulkDomainAvailabilityRequest (BulkDomainAvailabilityRequest, required): request body // opts.domain (string, optional): Required for TLD-mode bulk check (base domain) -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const body = BulkDomainAvailabilityRequest.constructFromObject({ domainNames: ["whoisfreaks.com", "example.com"] }); const result = await api.bulkDomainAvailabilityV2(body); @@ -563,9 +563,9 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new TyposquattingApi(client); // typosquatting(opts) -// opts.keyword (string, optional) -// opts.pattern (string, optional) -// opts.pageToken (string, optional) +// opts.keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not... +// opts.pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword... +// opts.pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward.... async function main() { const result = await api.typosquatting({ keyword: "whoisfreaks" }); console.log(JSON.stringify(result, null, 2)); @@ -578,6 +578,37 @@ main().catch((err) => { }); ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```javascript +// Subdomain Typosquatting Lookup: GET https://api.whoisfreaks.com/v3.0/subdomains/typos +// Run: WHOISFREAKS_API_KEY=your_api_key node SubdomainTyposquatting.js +const { ApiClient, TyposquattingApi } = require("whoisfreaks-js"); + +// Set the API key once; the client adds it to every request. +const client = ApiClient.instance; +client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; +const api = new TyposquattingApi(client); + +// subdomainTyposquatting(opts) +// opts.keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits... +// opts.pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one.... +// opts.pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward.... +// opts.fetch_size (number, optional): Subdomains per page. 100 when the parameter is left out, and values above 100...; default 100 +async function main() { + const result = await api.subdomainTyposquatting(); + console.log(JSON.stringify(result, null, 2)); +} + +main().catch((err) => { + // API errors carry the HTTP status and the parsed error body + console.error(err.status ? `HTTP ${err.status}: ${JSON.stringify(err.body)}` : err); + process.exitCode = 1; +}); +``` + ### SSL #### SSL Certificate Lookup @@ -595,10 +626,10 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new SSLApi(client); // sslLookup(domainName, opts) -// domainName (string, required) -// opts.chain (boolean, optional): default false -// opts.sslRaw (boolean, optional): default false -// opts.format (string, optional): one of json, xml; default "json" +// domainName (string, required): Domain to look up +// opts.chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user cert...; default false +// opts.sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false; default false +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.sslLookup("whoisfreaks.com"); console.log(JSON.stringify(result, null, 2)); @@ -628,7 +659,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new GeolocationApi(client); // geolocation(ip) -// ip (string, required) +// ip (string, required): IP address to look up async function main() { const result = await api.geolocation("8.8.8.8"); console.log(JSON.stringify(result, null, 2)); @@ -687,12 +718,12 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new SubdomainsApi(client); // subdomains(domain, opts) -// domain (string, required) -// opts.after (string, "yyyy-MM-dd", optional) -// opts.before (string, "yyyy-MM-dd", optional) -// opts.status (string, optional): one of active, inactive -// opts.page (number, optional): default 1 -// opts.format (string, optional): one of json, xml; default "json" +// domain (string, required): Domain whose subdomains you want +// opts.after (string, "yyyy-MM-dd", optional): Only return records created after this date, in YYYY-MM-DD format. Defaults t... +// opts.before (string, "yyyy-MM-dd", optional): Only return records created before this date, in YYYY-MM-DD format. Defaults ... +// opts.status (string, optional): Limit results to active or inactive subdomains. Both are returned when the pa...; one of active, inactive +// opts.page (number, optional): Page of results to return. Defaults to 1; default 1 +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.subdomains("whoisfreaks.com", { page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -722,7 +753,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new IPReputationApi(client); // ipReputation(ip) -// ip (string, required) +// ip (string, required): IP address to look up async function main() { const result = await api.ipReputation("8.8.8.8"); console.log(JSON.stringify(result, null, 2)); @@ -779,7 +810,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new IPReputationApi(client); // ipReputationV2(ip) -// ip (string, required) +// ip (string, required): IP address to look up async function main() { const result = await api.ipReputationV2("8.8.8.8"); console.log(JSON.stringify(result, null, 2)); @@ -839,7 +870,7 @@ const api = new DomainReputationApi(client); // domainReputation(domainName, opts) // domainName (string, required): The domain name to assess -// opts.format (string, optional): one of json, xml; default "json" +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.domainReputation("amazon.com"); console.log(JSON.stringify(result, null, 2)); @@ -869,8 +900,8 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new ASNWHOISApi(client); // asnWhois(asn, opts) -// asn (string, required) -// opts.format (string, optional): one of json, xml; default "json" +// asn (string, required): Autonomous system number to look up, with or without the AS prefix +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.asnWhois("as15169"); console.log(JSON.stringify(result, null, 2)); @@ -900,8 +931,8 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new IPWHOISApi(client); // ipWhois(ip, opts) -// ip (string, required) -// opts.format (string, optional): one of json, xml; default "json" +// ip (string, required): IP address to look up +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.ipWhois("8.8.8.8"); console.log(JSON.stringify(result, null, 2)); @@ -1014,9 +1045,9 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesNewlyRegisteredApi(client); // dbNewlyGtld(whois, opts) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // opts.date (string, "yyyy-MM-dd", optional): yyyy-MM-dd; omit for latest -// opts.tlds (string, optional) +// opts.tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main() { const data = await api.dbNewlyGtld(true, { date: "2026-10-01" }); // a Buffer with the file's bytes const file = "DbNewlyGtld.csv"; @@ -1048,9 +1079,9 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesNewlyRegisteredApi(client); // dbNewlyCctld(whois, opts) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // opts.date (string, "yyyy-MM-dd", optional): yyyy-MM-dd; omit for latest -// opts.tlds (string, optional) +// opts.tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main() { const data = await api.dbNewlyCctld(true, { date: "2026-10-01" }); // a Buffer with the file's bytes const file = "DbNewlyCctld.csv"; @@ -1145,7 +1176,7 @@ const api = new DatabasesNewlyRegisteredApi(client); // dbNewlyGtldJson(opts) // opts.date (string, "yyyy-MM-dd", optional): yyyy-MM-dd; omit for latest -// opts.tlds (string, optional) +// opts.tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main() { const domains = await api.dbNewlyGtldJson({ date: "2026-10-01" }); console.log(`${domains.length} domains`); @@ -1175,7 +1206,7 @@ const api = new DatabasesNewlyRegisteredApi(client); // dbNewlyCctldJson(opts) // opts.date (string, "yyyy-MM-dd", optional): yyyy-MM-dd; omit for latest -// opts.tlds (string, optional) +// opts.tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main() { const domains = await api.dbNewlyCctldJson({ date: "2026-10-01" }); console.log(`${domains.length} domains`); @@ -1240,7 +1271,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesExpiringDroppedApi(client); // dbExpired(whois, opts) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // opts.date (string, "yyyy-MM-dd", optional): yyyy-MM-dd; omit for latest async function main() { const data = await api.dbExpired(true, { date: "2026-10-01" }); // a Buffer with the file's bytes @@ -1305,7 +1336,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesExpiringDroppedApi(client); // dbDropped(whois, opts) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // opts.date (string, "yyyy-MM-dd", optional): yyyy-MM-dd; omit for latest async function main() { const data = await api.dbDropped(true, { date: "2026-10-01" }); // a Buffer with the file's bytes @@ -1337,7 +1368,7 @@ const api = new DatabasesExpiringDroppedApi(client); // dbDroppedJson(opts) // opts.date (string, "yyyy-MM-dd", optional): yyyy-MM-dd; omit for latest -// opts.tlds (string, optional) +// opts.tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main() { const domains = await api.dbDroppedJson({ date: "2026-10-01" }); console.log(`${domains.length} domains`); @@ -1368,7 +1399,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesExpiringDroppedApi(client); // dbDroppedBacklinks(opts) -// opts.whois (boolean, optional) +// opts.whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only // opts.date (string, "yyyy-MM-dd", optional): yyyy-MM-dd; omit for latest async function main() { const data = await api.dbDroppedBacklinks({ date: "2026-10-01" }); // a Buffer with the file's bytes @@ -1724,7 +1755,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesIPGeolocationApi(client); // dbIpCountry(date) -// date (string, "yyyy-MM-dd", required) +// date (string, "yyyy-MM-dd", required): The day whose file you want, in YYYY-MM-DD format async function main() { const data = await api.dbIpCountry("2026-10-01"); // a Buffer with the file's bytes const file = "DbIpCountry.zip"; @@ -1783,7 +1814,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesIPGeolocationApi(client); // dbIpCity(date) -// date (string, "yyyy-MM-dd", required) +// date (string, "yyyy-MM-dd", required): The day whose file you want, in YYYY-MM-DD format async function main() { const data = await api.dbIpCity("2026-10-01"); // a Buffer with the file's bytes const file = "DbIpCity.zip"; @@ -1817,7 +1848,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesASNWHOISApi(client); // dbAsnWhois(date) -// date (string, "yyyy-MM-dd", required) +// date (string, "yyyy-MM-dd", required): The day whose file you want, in YYYY-MM-DD format async function main() { const data = await api.dbAsnWhois("2026-10-01"); // a Buffer with the file's bytes const file = "DbAsnWhois.json.gz"; @@ -1878,7 +1909,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesIPWHOISApi(client); // dbIpWhois(date) -// date (string, "yyyy-MM-dd", required) +// date (string, "yyyy-MM-dd", required): The day whose file you want, in YYYY-MM-DD format async function main() { const data = await api.dbIpWhois("2026-10-01"); // a Buffer with the file's bytes const file = "DbIpWhois.json.gz"; @@ -1939,7 +1970,7 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new DatabasesIPSecurityApi(client); // dbIpSecurity(date) -// date (string, "yyyy-MM-dd", required) +// date (string, "yyyy-MM-dd", required): The day whose file you want, in YYYY-MM-DD format async function main() { const data = await api.dbIpSecurity("2026-10-01"); // a Buffer with the file's bytes const file = "DbIpSecurity.csv"; diff --git a/docs/languages/kotlin.md b/docs/languages/kotlin.md index 876c1bb..9c9bc1f 100644 --- a/docs/languages/kotlin.md +++ b/docs/languages/kotlin.md @@ -94,8 +94,8 @@ See [Authentication](../authentication.md) for how to obtain a key. Minimal setu // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: gradle run -PmainClass=WhoisLiveKt // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -111,7 +111,7 @@ fun main() { ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -123,8 +123,8 @@ All 94 endpoints are shown below, grouped by category. Each includes its method, // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: gradle run -PmainClass=WhoisLiveKt // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -146,7 +146,7 @@ fun main() { // Runnable example: Bulk WHOIS Lookup (POST /v2.0/bulkwhois/live) // Run it from the Getting Started project: gradle run -PmainClass=BulkWhoisKt // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -172,7 +172,7 @@ fun main() { // Run it from the Getting Started project: gradle run -PmainClass=WhoisHistoryKt // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -196,7 +196,7 @@ fun main() { // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -220,10 +220,10 @@ fun main() { // Runnable example: Live DNS Lookup (GET /v2.0/dns/live) // Run it from the Getting Started project: gradle run -PmainClass=DnsLiveKt // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -245,10 +245,10 @@ fun main() { // Runnable example: Historical DNS Lookup (GET /v2.0/dns/historical) // Run it from the Getting Started project: gradle run -PmainClass=DnsHistoricalKt // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -271,10 +271,10 @@ fun main() { // Run it from the Getting Started project: gradle run -PmainClass=DnsReverseKt // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -296,12 +296,12 @@ fun main() { // Runnable example: Historical DNS Lookup (v2.2) (GET /v2.2/dns/historical) // Run it from the Getting Started project: gradle run -PmainClass=DnsHistoricalV22Kt // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -323,12 +323,12 @@ fun main() { // Runnable example: Historical DNS Lookup (v2.3) (GET /v2.3/dns/historical) // Run it from the Getting Started project: gradle run -PmainClass=DnsHistoricalV23Kt // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -351,12 +351,12 @@ fun main() { // Run it from the Getting Started project: gradle run -PmainClass=DnsReverseV22Kt // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -379,12 +379,12 @@ fun main() { // Run it from the Getting Started project: gradle run -PmainClass=DnsReverseV23Kt // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -406,8 +406,8 @@ fun main() { // Runnable example: Bulk DNS Lookup (POST /v2.0/dns/bulk/live) // Run it from the Getting Started project: gradle run -PmainClass=DnsBulkKt // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -437,7 +437,7 @@ fun main() { // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DomainAvailabilityApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -460,7 +460,7 @@ fun main() { // Run it from the Getting Started project: gradle run -PmainClass=BulkDomainAvailabilityV2Kt // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object import com.whoisfreaks.client.apis.DomainAvailabilityApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -487,9 +487,9 @@ fun main() { // Runnable example: Typosquatting Lookup (GET /v3.0/domain/typos) // Run it from the Getting Started project: gradle run -PmainClass=TyposquattingKt // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... import com.whoisfreaks.client.apis.TyposquattingApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -503,6 +503,31 @@ fun main() { ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```kotlin +// Runnable example: Subdomain Typosquatting Lookup (GET /v3.0/subdomains/typos) +// Run it from the Getting Started project: gradle run -PmainClass=SubdomainTyposquattingKt +// Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +// - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +// - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +// - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... +import com.whoisfreaks.client.apis.TyposquattingApi +import com.whoisfreaks.client.infrastructure.ApiClient + +fun main() { + ApiClient.apiKey["apiKey"] = System.getenv("WHOISFREAKS_API_KEY") // set once, sent with every call + val api = TyposquattingApi() + + val result = api.subdomainTyposquatting(keyword = "paypal") + println(result) +} + +``` + ### SSL #### SSL Certificate Lookup @@ -513,10 +538,10 @@ fun main() { // Runnable example: SSL Certificate Lookup (GET /v1.0/ssl/live) // Run it from the Getting Started project: gradle run -PmainClass=SslLookupKt // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.SSLApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -540,7 +565,7 @@ fun main() { // Runnable example: IP Geolocation Lookup (GET /v1.0/geolocation) // Run it from the Getting Started project: gradle run -PmainClass=GeolocationKt // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. import com.whoisfreaks.client.apis.GeolocationApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -588,12 +613,12 @@ fun main() { // Runnable example: Subdomains Lookup (GET /v1.0/subdomains) // Run it from the Getting Started project: gradle run -PmainClass=SubdomainsKt // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.SubdomainsApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -617,7 +642,7 @@ fun main() { // Runnable example: IP Reputation Lookup (GET /v1.0/security) // Run it from the Getting Started project: gradle run -PmainClass=IpReputationKt // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. import com.whoisfreaks.client.apis.IPReputationApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -663,7 +688,7 @@ fun main() { // Runnable example: IP Reputation Lookup (v2.0) (GET /v2.0/security) // Run it from the Getting Started project: gradle run -PmainClass=IpReputationV2Kt // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. import com.whoisfreaks.client.apis.IPReputationApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -712,7 +737,7 @@ fun main() { // Run it from the Getting Started project: gradle run -PmainClass=DomainReputationKt // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DomainReputationApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -736,8 +761,8 @@ fun main() { // Runnable example: ASN WHOIS Lookup (GET /v2.0/asn-whois) // Run it from the Getting Started project: gradle run -PmainClass=AsnWhoisKt // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.ASNWHOISApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -761,8 +786,8 @@ fun main() { // Runnable example: IP WHOIS Lookup (GET /v1.0/ip-whois) // Run it from the Getting Started project: gradle run -PmainClass=IpWhoisKt // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.IPWHOISApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -854,9 +879,9 @@ fun main() { // Runnable example: Newly Registered gTLD (CSV) (GET /v3.1/download/domainer/gtld) // Run it from the Getting Started project: gradle run -PmainClass=DbNewlyGtldKt // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesNewlyRegisteredApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File @@ -882,9 +907,9 @@ fun main() { // Runnable example: Newly Registered ccTLD (CSV) (GET /v3.1/download/domainer/cctld) // Run it from the Getting Started project: gradle run -PmainClass=DbNewlyCctldKt // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesNewlyRegisteredApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File @@ -963,7 +988,7 @@ fun main() { // Run it from the Getting Started project: gradle run -PmainClass=DbNewlyGtldJsonKt // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesNewlyRegisteredApi import com.whoisfreaks.client.infrastructure.ApiClient import java.time.LocalDate @@ -987,7 +1012,7 @@ fun main() { // Run it from the Getting Started project: gradle run -PmainClass=DbNewlyCctldJsonKt // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesNewlyRegisteredApi import com.whoisfreaks.client.infrastructure.ApiClient import java.time.LocalDate @@ -1038,7 +1063,7 @@ fun main() { // Runnable example: Expiring Domains (GET /v3.1/download/domainer/expired) // Run it from the Getting Started project: gradle run -PmainClass=DbExpiredKt // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest import com.whoisfreaks.client.apis.DatabasesExpiringDroppedApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -1091,7 +1116,7 @@ fun main() { // Runnable example: Dropped Domains (GET /v3.1/download/domainer/dropped) // Run it from the Getting Started project: gradle run -PmainClass=DbDroppedKt // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest import com.whoisfreaks.client.apis.DatabasesExpiringDroppedApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -1119,7 +1144,7 @@ fun main() { // Run it from the Getting Started project: gradle run -PmainClass=DbDroppedJsonKt // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesExpiringDroppedApi import com.whoisfreaks.client.infrastructure.ApiClient import java.time.LocalDate @@ -1142,7 +1167,7 @@ fun main() { // Runnable example: Dropped With Backlinks (GET /v3.3/download/domainer/dropped/backlinks) // Run it from the Getting Started project: gradle run -PmainClass=DbDroppedBacklinksKt // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest import com.whoisfreaks.client.apis.DatabasesExpiringDroppedApi import com.whoisfreaks.client.infrastructure.ApiClient @@ -1433,7 +1458,7 @@ fun main() { // Runnable example: IP to Country Snapshot (GET /v3.3/download/snapshot/ip/country) // Run it from the Getting Started project: gradle run -PmainClass=DbIpCountryKt // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesIPGeolocationApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File @@ -1481,7 +1506,7 @@ fun main() { // Runnable example: IP to City Snapshot (GET /v3.3/download/snapshot/ip/city) // Run it from the Getting Started project: gradle run -PmainClass=DbIpCityKt // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesIPGeolocationApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File @@ -1509,7 +1534,7 @@ fun main() { // Runnable example: ASN WHOIS Snapshot (GET /v3.3/download/snapshot/asn/whois) // Run it from the Getting Started project: gradle run -PmainClass=DbAsnWhoisKt // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesASNWHOISApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File @@ -1559,7 +1584,7 @@ fun main() { // Runnable example: IP WHOIS Snapshot (GET /v3.3/download/snapshot/ip/whois) // Run it from the Getting Started project: gradle run -PmainClass=DbIpWhoisKt // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesIPWHOISApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File @@ -1609,7 +1634,7 @@ fun main() { // Runnable example: IP Security Snapshot (GET /v3.3/download/snapshot/ip/security) // Run it from the Getting Started project: gradle run -PmainClass=DbIpSecurityKt // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesIPSecurityApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File diff --git a/docs/languages/php.md b/docs/languages/php.md index 6b8b4a2..285735a 100644 --- a/docs/languages/php.md +++ b/docs/languages/php.md @@ -76,8 +76,8 @@ See [Authentication](../authentication.md) for how to obtain a key. Minimal setu // Live WHOIS Lookup // // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -104,7 +104,7 @@ try { ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -117,8 +117,8 @@ All 94 endpoints are shown below, grouped by category. Each includes its method, // Live WHOIS Lookup // // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -152,7 +152,7 @@ try { // Bulk WHOIS Lookup // // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object require __DIR__ . '/vendor/autoload.php'; @@ -193,7 +193,7 @@ try { // // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -229,7 +229,7 @@ try { // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -265,10 +265,10 @@ try { // Live DNS Lookup // // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -302,10 +302,10 @@ try { // Historical DNS Lookup // // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -340,10 +340,10 @@ try { // // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -359,7 +359,7 @@ $config = Configuration::getDefaultConfiguration() $api = new DNSApi(new Client(), $config); try { - $result = $api->dnsReverse('8.8.8.8', 'a', true, 1); // value, type, exact, page + $result = $api->dnsReverse('8.8.8.8', 'a', false, 1); // value, type, exact, page echo $result, PHP_EOL; // models print as JSON } catch (ApiException $e) { fwrite(STDERR, 'Request failed: HTTP ' . $e->getCode() . ' ' . $e->getResponseBody() . PHP_EOL); @@ -377,12 +377,12 @@ try { // Historical DNS Lookup (v2.2) // // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -416,12 +416,12 @@ try { // Historical DNS Lookup (v2.3) // // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -456,12 +456,12 @@ try { // // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -496,12 +496,12 @@ try { // // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -535,8 +535,8 @@ try { // Bulk DNS Lookup // // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object require __DIR__ . '/vendor/autoload.php'; @@ -581,7 +581,7 @@ try { // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -616,7 +616,7 @@ try { // // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object require __DIR__ . '/vendor/autoload.php'; @@ -658,9 +658,9 @@ try { // Typosquatting Lookup // // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... require __DIR__ . '/vendor/autoload.php'; @@ -685,6 +685,43 @@ try { ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```php +setApiKey('apiKey', getenv('WHOISFREAKS_API_KEY')); + +$api = new TyposquattingApi(new Client(), $config); + +try { + $result = $api->subdomainTyposquatting('paypal'); + echo $result, PHP_EOL; // models print as JSON +} catch (ApiException $e) { + fwrite(STDERR, 'Request failed: HTTP ' . $e->getCode() . ' ' . $e->getResponseBody() . PHP_EOL); + exit(1); +} + +``` + ### SSL #### SSL Certificate Lookup @@ -696,10 +733,10 @@ try { // SSL Certificate Lookup // // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -735,7 +772,7 @@ try { // IP Geolocation Lookup // // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. require __DIR__ . '/vendor/autoload.php'; @@ -812,12 +849,12 @@ try { // Subdomains Lookup // // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -853,7 +890,7 @@ try { // IP Reputation Lookup // // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. require __DIR__ . '/vendor/autoload.php'; @@ -928,7 +965,7 @@ try { // IP Reputation Lookup (v2.0) // // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. require __DIR__ . '/vendor/autoload.php'; @@ -1006,7 +1043,7 @@ try { // // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -1042,8 +1079,8 @@ try { // ASN WHOIS Lookup // // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -1079,8 +1116,8 @@ try { // IP WHOIS Lookup // // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -1222,9 +1259,9 @@ try { // Newly Registered gTLD (CSV) // // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; @@ -1261,9 +1298,9 @@ try { // Newly Registered ccTLD (CSV) // // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; @@ -1375,7 +1412,7 @@ try { // // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; @@ -1410,7 +1447,7 @@ try { // // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; @@ -1483,7 +1520,7 @@ try { // Expiring Domains // // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest require __DIR__ . '/vendor/autoload.php'; @@ -1558,7 +1595,7 @@ try { // Dropped Domains // // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest require __DIR__ . '/vendor/autoload.php'; @@ -1597,7 +1634,7 @@ try { // // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; @@ -1631,7 +1668,7 @@ try { // Dropped With Backlinks // // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest require __DIR__ . '/vendor/autoload.php'; @@ -2044,7 +2081,7 @@ try { // IP to Country Snapshot // // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; @@ -2115,7 +2152,7 @@ try { // IP to City Snapshot // // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; @@ -2154,7 +2191,7 @@ try { // ASN WHOIS Snapshot // // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; @@ -2227,7 +2264,7 @@ try { // IP WHOIS Snapshot // // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; @@ -2300,7 +2337,7 @@ try { // IP Security Snapshot // // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; diff --git a/docs/languages/python.md b/docs/languages/python.md index ef9cb35..ee9c8f2 100644 --- a/docs/languages/python.md +++ b/docs/languages/python.md @@ -84,15 +84,15 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.WHOISApi(client) # whois_live parameters: - # domain_name (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.whois_live("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -118,8 +118,8 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.WHOISApi(client) # whois_live parameters: - # domain_name (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.whois_live("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -147,7 +147,7 @@ with whoisfreaks.ApiClient(config) as client: # bulk_whois parameters: # bulk_whois_request (BulkWhoisRequest, required): request body - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" body = whoisfreaks.BulkWhoisRequest(domain_names=["whoisfreaks.com", "jfreaks.com"]) result = api.bulk_whois(body) print(json.dumps(result.to_dict(), indent=2)) @@ -176,7 +176,7 @@ with whoisfreaks.ApiClient(config) as client: # whois_history parameters: # domain_name (str, required): Domain to fetch historical WHOIS records for - # format (str, optional, keyword): one of json, xml + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml result = api.whois_history("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -205,7 +205,7 @@ with whoisfreaks.ApiClient(config) as client: # whois_reverse parameters: # keyword (str, required): Keyword to search across WHOIS records # page (int, optional, keyword): Page number - # format (str, optional, keyword): one of json, xml + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml result = api.whois_reverse("whoisfreaks", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -235,9 +235,9 @@ with whoisfreaks.ApiClient(config) as client: # dns_live parameters: # type (str, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME; default "all" - # domain_name (str, optional, keyword) + # domain_name (str, optional, keyword): Domain to look up # ip_address (str, optional, keyword): Use for PTR lookups - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_live("A,MX,TXT", domain_name="whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -264,10 +264,10 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DNSApi(client) # dns_historical parameters: - # domain_name (str, required) - # type (str, required): default "all" - # page (int, optional, keyword): default 1 - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_historical("whoisfreaks.com", "A,MX,TXT", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -295,10 +295,10 @@ with whoisfreaks.ApiClient(config) as client: # dns_reverse parameters: # value (str, required): IP, CIDR, or record value - # type (str, required): one of a, mx, cname, ns, aaaa, txt, soa - # exact (bool, optional, keyword): default True - # page (int, optional, keyword): default 1 - # format (str, optional, keyword): one of json, xml; default "json" + # type (str, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa + # exact (bool, optional, keyword): Set true to match value exactly. Defaults to false, where value is treated as...; default False + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_reverse("8.8.8.8", "a", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -325,12 +325,12 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DNSApi(client) # dns_historical_v22 parameters: - # domain_name (str, required) - # type (str, required): default "all" - # page (int, optional, keyword): default 1 + # domain_name (str, required): Domain to look up + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_historical_v22("whoisfreaks.com", "A,MX,TXT", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -357,12 +357,12 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DNSApi(client) # dns_historical_v23 parameters: - # domain_name (str, required) - # type (str, required): default "all" - # page (int, optional, keyword): default 1 + # domain_name (str, required): Domain to look up + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_historical_v23("whoisfreaks.com", "A,MX,TXT", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -390,12 +390,12 @@ with whoisfreaks.ApiClient(config) as client: # dns_reverse_v22 parameters: # value (str, required): IP, CIDR, or record value - # type (str, required): one of a, mx, cname, ns, aaaa, txt, soa + # type (str, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa # exact (bool, optional, keyword): When false the value is matched as a substring, which is far slower than an e...; default True - # page (int, optional, keyword): default 1 + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_reverse_v22("8.8.8.8", "a", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -423,12 +423,12 @@ with whoisfreaks.ApiClient(config) as client: # dns_reverse_v23 parameters: # value (str, required): IP, CIDR, or record value - # type (str, required): one of a, mx, cname, ns, aaaa, txt, soa + # type (str, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa # exact (bool, optional, keyword): When false the value is matched as a substring, which is far slower than an e...; default True - # page (int, optional, keyword): default 1 + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_reverse_v23("8.8.8.8", "a", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -455,9 +455,9 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DNSApi(client) # dns_bulk parameters: - # type (str, required): default "all" + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" # dns_bulk_request (DnsBulkRequest, required): request body - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" body = whoisfreaks.DnsBulkRequest(domain_names=["whoisfreaks.com", "example.com"]) result = api.dns_bulk("A,MX,TXT", body) print(json.dumps(result.to_dict(), indent=2)) @@ -490,7 +490,7 @@ with whoisfreaks.ApiClient(config) as client: # domain (str, required): The domain name to check # sug (bool, optional, keyword): Whether to return TLD suggestions alongside the queried domain; default False # count (int, optional, keyword): Number of TLD suggestions to return when sug=true. Maximum is 100; default 5 - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.domain_availability_v2("google.com", sug=True, count=5) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -519,7 +519,7 @@ with whoisfreaks.ApiClient(config) as client: # bulk_domain_availability_v2 parameters: # bulk_domain_availability_request (BulkDomainAvailabilityRequest, required): request body # domain (str, optional, keyword): Required for TLD-mode bulk check (base domain) - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" body = whoisfreaks.BulkDomainAvailabilityRequest(domain_names=["whoisfreaks.com", "example.com"]) result = api.bulk_domain_availability_v2(body) print(json.dumps(result.to_dict(), indent=2)) @@ -549,13 +549,43 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.TyposquattingApi(client) # typosquatting parameters: - # keyword (str, optional, keyword) - # pattern (str, optional, keyword) - # page_token (str, optional, keyword) + # keyword (str, optional, keyword): Brand or label to find typo variants for. Pass either keyword or pattern, not... + # pattern (str, optional, keyword): Wildcard search string, where '*' matches any characters. Pass either keyword... + # page_token (str, optional, keyword): Token from nextPageToken in the previous response, needed from page 2 onward.... result = api.typosquatting(keyword="whoisfreaks") print(json.dumps(result.to_dict(), indent=2)) ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```python +"""Subdomain Typosquatting Lookup: GET https://api.whoisfreaks.com/v3.0/subdomains/typos + +Run it with your API key in the environment: + WHOISFREAKS_API_KEY=your_api_key python SubdomainTyposquatting.py +""" +import json +import os + +import whoisfreaks + +config = whoisfreaks.Configuration() +config.api_key["ApiKeyAuth"] = os.environ["WHOISFREAKS_API_KEY"] # set once for every request + +with whoisfreaks.ApiClient(config) as client: + api = whoisfreaks.TyposquattingApi(client) + + # subdomain_typosquatting parameters: + # keyword (str, optional, keyword): Brand or label to find typo variants for. 3 to 63 characters, letters, digits... + # pattern (str, optional, keyword): Wildcard search string, where '*' matches any characters and '?' matches one.... + # page_token (str, optional, keyword): Token from nextPageToken in the previous response, needed from page 2 onward.... + # fetch_size (int, optional, keyword): Subdomains per page. 100 when the parameter is left out, and values above 100...; default 100 + result = api.subdomain_typosquatting() + print(json.dumps(result.to_dict(), indent=2)) +``` + ### SSL #### SSL Certificate Lookup @@ -580,10 +610,10 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.SSLApi(client) # ssl_lookup parameters: - # domain_name (str, required) - # chain (bool, optional, keyword): default False - # ssl_raw (bool, optional, keyword): default False - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # chain (bool, optional, keyword): Set true to return the full certificate chain, ordered from the end-user cert...; default False + # ssl_raw (bool, optional, keyword): Set true to include the raw OpenSSL response for the domain. Defaults to false; default False + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.ssl_lookup("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -612,7 +642,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.GeolocationApi(client) # geolocation parameters: - # ip (str, required) + # ip (str, required): IP address to look up result = api.geolocation("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -669,12 +699,12 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.SubdomainsApi(client) # subdomains parameters: - # domain (str, required) - # after (datetime.date, optional, keyword) - # before (datetime.date, optional, keyword) - # status (str, optional, keyword): one of active, inactive - # page (int, optional, keyword): default 1 - # format (str, optional, keyword): one of json, xml; default "json" + # domain (str, required): Domain whose subdomains you want + # after (datetime.date, optional, keyword): Only return records created after this date, in YYYY-MM-DD format. Defaults t... + # before (datetime.date, optional, keyword): Only return records created before this date, in YYYY-MM-DD format. Defaults ... + # status (str, optional, keyword): Limit results to active or inactive subdomains. Both are returned when the pa...; one of active, inactive + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.subdomains("whoisfreaks.com", page=1) print(json.dumps(result.to_dict(), indent=2)) ``` @@ -703,7 +733,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.IPReputationApi(client) # ip_reputation parameters: - # ip (str, required) + # ip (str, required): IP address to look up result = api.ip_reputation("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -758,7 +788,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.IPReputationApi(client) # ip_reputation_v2 parameters: - # ip (str, required) + # ip (str, required): IP address to look up result = api.ip_reputation_v2("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -816,7 +846,7 @@ with whoisfreaks.ApiClient(config) as client: # domain_reputation parameters: # domain_name (str, required): The domain name to assess - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.domain_reputation("amazon.com") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -845,8 +875,8 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.ASNWHOISApi(client) # asn_whois parameters: - # asn (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # asn (str, required): Autonomous system number to look up, with or without the AS prefix + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.asn_whois("as15169") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -875,8 +905,8 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.IPWHOISApi(client) # ip_whois parameters: - # ip (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # ip (str, required): IP address to look up + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.ip_whois("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) ``` @@ -983,9 +1013,9 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesNewlyRegisteredApi(client) # db_newly_gtld parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... data = api.db_newly_gtld(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbNewlyGtld.csv" with open(path, "wb") as f: @@ -1015,9 +1045,9 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesNewlyRegisteredApi(client) # db_newly_cctld parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... data = api.db_newly_cctld(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbNewlyCctld.csv" with open(path, "wb") as f: @@ -1108,7 +1138,7 @@ with whoisfreaks.ApiClient(config) as client: # db_newly_gtld_json parameters: # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... domains = api.db_newly_gtld_json(var_date=date(2026, 10, 1)) print(f"{len(domains)} domains") print("\n".join(domains[:10])) @@ -1137,7 +1167,7 @@ with whoisfreaks.ApiClient(config) as client: # db_newly_cctld_json parameters: # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... domains = api.db_newly_cctld_json(var_date=date(2026, 10, 1)) print(f"{len(domains)} domains") print("\n".join(domains[:10])) @@ -1197,7 +1227,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesExpiringDroppedApi(client) # db_expired parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest data = api.db_expired(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbExpired.csv" @@ -1258,7 +1288,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesExpiringDroppedApi(client) # db_dropped parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest data = api.db_dropped(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbDropped.csv" @@ -1290,7 +1320,7 @@ with whoisfreaks.ApiClient(config) as client: # db_dropped_json parameters: # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... domains = api.db_dropped_json(var_date=date(2026, 10, 1)) print(f"{len(domains)} domains") print("\n".join(domains[:10])) @@ -1318,7 +1348,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesExpiringDroppedApi(client) # db_dropped_backlinks parameters: - # whois (bool, optional, keyword) + # whois (bool, optional, keyword): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest data = api.db_dropped_backlinks(var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbDroppedBacklinks.csv" @@ -1653,7 +1683,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesIPGeolocationApi(client) # db_ip_country parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_country(date(2026, 10, 1)) # the file's raw bytes path = "DbIpCountry.zip" with open(path, "wb") as f: @@ -1709,7 +1739,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesIPGeolocationApi(client) # db_ip_city parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_city(date(2026, 10, 1)) # the file's raw bytes path = "DbIpCity.zip" with open(path, "wb") as f: @@ -1741,7 +1771,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesASNWHOISApi(client) # db_asn_whois parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_asn_whois(date(2026, 10, 1)) # the file's raw bytes path = "DbAsnWhois.json.gz" with open(path, "wb") as f: @@ -1799,7 +1829,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesIPWHOISApi(client) # db_ip_whois parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_whois(date(2026, 10, 1)) # the file's raw bytes path = "DbIpWhois.json.gz" with open(path, "wb") as f: @@ -1857,7 +1887,7 @@ with whoisfreaks.ApiClient(config) as client: api = whoisfreaks.DatabasesIPSecurityApi(client) # db_ip_security parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_security(date(2026, 10, 1)) # the file's raw bytes path = "DbIpSecurity.csv" with open(path, "wb") as f: diff --git a/docs/languages/ruby.md b/docs/languages/ruby.md index d4a4b1e..02f373a 100644 --- a/docs/languages/ruby.md +++ b/docs/languages/ruby.md @@ -84,8 +84,8 @@ See [Authentication](../authentication.md) for how to obtain a key. Minimal setu # Live WHOIS Lookup # # Parameters for whoisLive (GET /v2.0/whois/live): -# - domain_name (string, required) -# - format (string (one of: json, xml), optional) +# - domain_name (string, required): Domain to look up. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -109,7 +109,7 @@ end ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -121,8 +121,8 @@ All 94 endpoints are shown below, grouped by category. Each includes its method, # Live WHOIS Lookup # # Parameters for whoisLive (GET /v2.0/whois/live): -# - domain_name (string, required) -# - format (string (one of: json, xml), optional) +# - domain_name (string, required): Domain to look up. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -152,7 +152,7 @@ end # Bulk WHOIS Lookup # # Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. # - body: BulkWhoisRequest (required): request body object require "json" @@ -186,7 +186,7 @@ end # # Parameters for whoisHistory (GET /v2.0/whois/history): # - domain_name (string, required): Domain to fetch historical WHOIS records for -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -218,7 +218,7 @@ end # Parameters for whoisReverse (GET /v2.0/whois/reverse): # - keyword (string, required): Keyword to search across WHOIS records # - page (integer, optional): Page number -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -250,10 +250,10 @@ end # Live DNS Lookup # # Parameters for dnsLive (GET /v2.0/dns/live): -# - domain_name (string, optional) +# - domain_name (string, optional): Domain to look up. # - ip_address (string, optional): Use for PTR lookups # - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -283,10 +283,10 @@ end # Historical DNS Lookup # # Parameters for dnsHistorical (GET /v2.0/dns/historical): -# - domain_name (string, required) -# - type (string, required) -# - page (integer, optional) -# - format (string (one of: json, xml), optional) +# - domain_name (string, required): Domain to look up. +# - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +# - page (integer, optional): Page of results to return. Defaults to 1. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -317,10 +317,10 @@ end # # Parameters for dnsReverse (GET /v2.1/dns/reverse): # - value (string, required): IP, CIDR, or record value -# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -# - exact (boolean, optional) -# - page (integer, optional) -# - format (string (one of: json, xml), optional) +# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +# - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +# - page (integer, optional): Page of results to return. Defaults to 1. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -350,12 +350,12 @@ end # Historical DNS Lookup (v2.2) # # Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -# - domain_name (string, required) -# - type (string, required) -# - page (integer, optional) +# - domain_name (string, required): Domain to look up. +# - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +# - page (integer, optional): Page of results to return. Defaults to 1. # - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. # - sort_by (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -385,12 +385,12 @@ end # Historical DNS Lookup (v2.3) # # Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -# - domain_name (string, required) -# - type (string, required) -# - page (integer, optional) +# - domain_name (string, required): Domain to look up. +# - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +# - page (integer, optional): Page of results to return. Defaults to 1. # - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. # - sort_by (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -421,12 +421,12 @@ end # # Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): # - value (string, required): IP, CIDR, or record value -# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. # - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -# - page (integer, optional) +# - page (integer, optional): Page of results to return. Defaults to 1. # - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. # - sort_by (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -457,12 +457,12 @@ end # # Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): # - value (string, required): IP, CIDR, or record value -# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. # - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -# - page (integer, optional) +# - page (integer, optional): Page of results to return. Defaults to 1. # - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. # - sort_by (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -492,8 +492,8 @@ end # Bulk DNS Lookup # # Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -# - type (string, required) -# - format (string (one of: json, xml), optional) +# - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. # - body: DnsBulkRequest (required): request body object require "json" @@ -531,7 +531,7 @@ end # - domain (string, required): The domain name to check # - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. # - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -562,7 +562,7 @@ end # # Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): # - domain (string, optional): Required for TLD-mode bulk check (base domain). -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. # - body: BulkDomainAvailabilityRequest (required): request body object require "json" @@ -597,9 +597,9 @@ end # Typosquatting Lookup # # Parameters for typosquatting (GET /v3.0/domain/typos): -# - keyword (string, optional) -# - pattern (string, optional) -# - page_token (string, optional) +# - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +# - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +# - page_token (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... require "json" require "whoisfreaks" @@ -621,6 +621,39 @@ end ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```ruby +# Subdomain Typosquatting Lookup +# +# Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +# - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +# - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +# - page_token (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +# - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... + +require "json" +require "whoisfreaks" + +# Read the API key from the environment and set it once. +WhoisFreaks.configure do |config| + config.api_key["apiKey"] = ENV.fetch("WHOISFREAKS_API_KEY") +end + +api = WhoisFreaks::TyposquattingApi.new + +begin + result = api.subdomain_typosquatting(keyword: "paypal") + puts JSON.pretty_generate(result.to_hash) +rescue WhoisFreaks::ApiError => e + warn "Request failed: HTTP #{e.code} #{e.response_body}" + exit 1 +end + +``` + ### SSL #### SSL Certificate Lookup @@ -631,10 +664,10 @@ end # SSL Certificate Lookup # # Parameters for sslLookup (GET /v1.0/ssl/live): -# - domain_name (string, required) -# - chain (boolean, optional) -# - ssl_raw (boolean, optional) -# - format (string (one of: json, xml), optional) +# - domain_name (string, required): Domain to look up. +# - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +# - ssl_raw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -666,7 +699,7 @@ end # IP Geolocation Lookup # # Parameters for geolocation (GET /v1.0/geolocation): -# - ip (string, required) +# - ip (string, required): IP address to look up. require "json" require "whoisfreaks" @@ -730,12 +763,12 @@ end # Subdomains Lookup # # Parameters for subdomains (GET /v1.0/subdomains): -# - domain (string, required) -# - after (string, optional) -# - before (string, optional) -# - status (string (one of: active, inactive), optional) -# - page (integer, optional) -# - format (string (one of: json, xml), optional) +# - domain (string, required): Domain whose subdomains you want. +# - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +# - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +# - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +# - page (integer, optional): Page of results to return. Defaults to 1. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -767,7 +800,7 @@ end # IP Reputation Lookup # # Parameters for ipReputation (GET /v1.0/security): -# - ip (string, required) +# - ip (string, required): IP address to look up. require "json" require "whoisfreaks" @@ -829,7 +862,7 @@ end # IP Reputation Lookup (v2.0) # # Parameters for ipReputationV2 (GET /v2.0/security): -# - ip (string, required) +# - ip (string, required): IP address to look up. require "json" require "whoisfreaks" @@ -894,7 +927,7 @@ end # # Parameters for domainReputation (GET /v1/domain/security): # - domain_name (string, required): The domain name to assess -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -926,8 +959,8 @@ end # ASN WHOIS Lookup # # Parameters for asnWhois (GET /v2.0/asn-whois): -# - asn (string, required) -# - format (string (one of: json, xml), optional) +# - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -959,8 +992,8 @@ end # IP WHOIS Lookup # # Parameters for ipWhois (GET /v1.0/ip-whois): -# - ip (string, required) -# - format (string (one of: json, xml), optional) +# - ip (string, required): IP address to look up. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" @@ -1085,9 +1118,9 @@ end # Newly Registered gTLD (CSV) # # Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -# - whois (boolean, required) +# - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "fileutils" @@ -1121,9 +1154,9 @@ end # Newly Registered ccTLD (CSV) # # Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -# - whois (boolean, required) +# - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "fileutils" @@ -1226,7 +1259,7 @@ end # # Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "whoisfreaks" @@ -1257,7 +1290,7 @@ end # # Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "whoisfreaks" @@ -1323,7 +1356,7 @@ end # Expiring Domains # # Parameters for dbExpired (GET /v3.1/download/domainer/expired): -# - whois (boolean, required) +# - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest require "date" @@ -1392,7 +1425,7 @@ end # Dropped Domains # # Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -# - whois (boolean, required) +# - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest require "date" @@ -1428,7 +1461,7 @@ end # # Parameters for dbDroppedJson (GET /v3.1/domains/dropped): # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "whoisfreaks" @@ -1458,7 +1491,7 @@ end # Dropped With Backlinks # # Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -# - whois (boolean, optional) +# - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest require "date" @@ -1837,7 +1870,7 @@ end # IP to Country Snapshot # # Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" @@ -1901,7 +1934,7 @@ end # IP to City Snapshot # # Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" @@ -1937,7 +1970,7 @@ end # ASN WHOIS Snapshot # # Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" @@ -2003,7 +2036,7 @@ end # IP WHOIS Snapshot # # Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" @@ -2069,7 +2102,7 @@ end # IP Security Snapshot # # Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" diff --git a/docs/languages/swift.md b/docs/languages/swift.md index 12ea170..eb3f65a 100644 --- a/docs/languages/swift.md +++ b/docs/languages/swift.md @@ -90,8 +90,8 @@ See [Authentication](../authentication.md) for how to obtain a key. Minimal setu // Live WHOIS Lookup // // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -117,7 +117,7 @@ do { ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -129,8 +129,8 @@ All 94 endpoints are shown below, grouped by category. Each includes its method, // Live WHOIS Lookup // // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -162,7 +162,7 @@ do { // Bulk WHOIS Lookup // // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object // // Top-level code for Sources//main.swift (see Getting Started). @@ -198,7 +198,7 @@ do { // // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -232,7 +232,7 @@ do { // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -266,10 +266,10 @@ do { // Live DNS Lookup // // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -301,10 +301,10 @@ do { // Historical DNS Lookup // // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -337,10 +337,10 @@ do { // // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -372,12 +372,12 @@ do { // Historical DNS Lookup (v2.2) // // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -409,12 +409,12 @@ do { // Historical DNS Lookup (v2.3) // // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -447,12 +447,12 @@ do { // // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -485,12 +485,12 @@ do { // // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -522,8 +522,8 @@ do { // Bulk DNS Lookup // // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object // // Top-level code for Sources//main.swift (see Getting Started). @@ -563,7 +563,7 @@ do { // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -596,7 +596,7 @@ do { // // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object // // Top-level code for Sources//main.swift (see Getting Started). @@ -633,9 +633,9 @@ do { // Typosquatting Lookup // // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... // // Top-level code for Sources//main.swift (see Getting Started). @@ -659,6 +659,41 @@ do { ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```swift +// Subdomain Typosquatting Lookup +// +// Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +// - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +// - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +// - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... +// +// Top-level code for Sources//main.swift (see Getting Started). + +import Foundation +import WhoisFreaks + +// Read the API key from the environment and set it once. +WhoisFreaksAPI.apiKey = ProcessInfo.processInfo.environment["WHOISFREAKS_API_KEY"] + +do { + let result = try await TyposquattingAPI.subdomainTyposquatting(keyword: "paypal") + print(String(decoding: try CodableHelper.jsonEncoder.encode(result), as: UTF8.self)) +} catch ErrorResponse.error(let status, let data, _, let underlying) { + let body = data.map { String(decoding: $0, as: UTF8.self) } ?? "\(underlying)" + print("Request failed: HTTP \(status) \(body)") + exit(1) +} catch { + print("Request failed: \(error)") + exit(1) +} + +``` + ### SSL #### SSL Certificate Lookup @@ -669,10 +704,10 @@ do { // SSL Certificate Lookup // // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -706,7 +741,7 @@ do { // IP Geolocation Lookup // // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. // // Top-level code for Sources//main.swift (see Getting Started). @@ -774,12 +809,12 @@ do { // Subdomains Lookup // // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -813,7 +848,7 @@ do { // IP Reputation Lookup // // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. // // Top-level code for Sources//main.swift (see Getting Started). @@ -879,7 +914,7 @@ do { // IP Reputation Lookup (v2.0) // // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. // // Top-level code for Sources//main.swift (see Getting Started). @@ -948,7 +983,7 @@ do { // // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -982,8 +1017,8 @@ do { // ASN WHOIS Lookup // // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -1017,8 +1052,8 @@ do { // IP WHOIS Lookup // // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). @@ -1152,9 +1187,9 @@ do { // Newly Registered gTLD (CSV) // // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). @@ -1190,9 +1225,9 @@ do { // Newly Registered ccTLD (CSV) // // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). @@ -1301,7 +1336,7 @@ do { // // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). @@ -1334,7 +1369,7 @@ do { // // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). @@ -1404,7 +1439,7 @@ do { // Expiring Domains // // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest // // Top-level code for Sources//main.swift (see Getting Started). @@ -1477,7 +1512,7 @@ do { // Dropped Domains // // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest // // Top-level code for Sources//main.swift (see Getting Started). @@ -1515,7 +1550,7 @@ do { // // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). @@ -1547,7 +1582,7 @@ do { // Dropped With Backlinks // // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest // // Top-level code for Sources//main.swift (see Getting Started). @@ -1948,7 +1983,7 @@ do { // IP to Country Snapshot // // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). @@ -2016,7 +2051,7 @@ do { // IP to City Snapshot // // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). @@ -2054,7 +2089,7 @@ do { // ASN WHOIS Snapshot // // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). @@ -2124,7 +2159,7 @@ do { // IP WHOIS Snapshot // // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). @@ -2194,7 +2229,7 @@ do { // IP Security Snapshot // // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/docs/languages/typescript.md b/docs/languages/typescript.md index 617cb66..cd8653b 100644 --- a/docs/languages/typescript.md +++ b/docs/languages/typescript.md @@ -93,8 +93,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new WHOISApi(config); // whoisLive({ domainName, format? }) -// domainName (string, required) -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.whoisLive({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -113,7 +113,7 @@ main().catch(async (err: unknown) => { ## Endpoints -All 94 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. +All 95 endpoints are shown below, grouped by category. Each includes its method, path, parameters, and a runnable example. See the [full endpoint reference](../endpoints/README.md) for response shapes and field details. ### WHOIS @@ -131,8 +131,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new WHOISApi(config); // whoisLive({ domainName, format? }) -// domainName (string, required) -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.whoisLive({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -164,7 +164,7 @@ const api = new WHOISApi(config); // bulkWhois({ bulkWhoisRequest, format? }) // bulkWhoisRequest (BulkWhoisRequest, required): request body -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const body: BulkWhoisRequest = { domainNames: ["whoisfreaks.com", "jfreaks.com"] }; const result = await api.bulkWhois({ bulkWhoisRequest: body }); @@ -197,7 +197,7 @@ const api = new WHOISApi(config); // whoisHistory({ domainName, format? }) // domainName (string, required): Domain to fetch historical WHOIS records for -// format ("json" | "xml", optional) +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out async function main(): Promise { const result = await api.whoisHistory({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -230,7 +230,7 @@ const api = new WHOISApi(config); // whoisReverse({ keyword, page?, format? }) // keyword (string, required): Keyword to search across WHOIS records // page (number, optional): Page number -// format ("json" | "xml", optional) +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out async function main(): Promise { const result = await api.whoisReverse({ keyword: "whoisfreaks", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -264,9 +264,9 @@ const api = new DNSApi(config); // dnsLive({ type, domainName?, ipAddress?, format? }) // type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME; default "all" -// domainName (string, optional) +// domainName (string, optional): Domain to look up // ipAddress (string, optional): Use for PTR lookups -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsLive({ type: "A,MX,TXT", domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -297,10 +297,10 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsHistorical({ domainName, type, page?, format? }) -// domainName (string, required) -// type (string, required): default "all" -// page (number, optional): default 1 -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// page (number, optional): Page of results to return. Defaults to 1; default 1 +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsHistorical({ domainName: "whoisfreaks.com", type: "A,MX,TXT", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -332,10 +332,10 @@ const api = new DNSApi(config); // dnsReverse({ value, type, exact?, page?, format? }) // value (string, required): IP, CIDR, or record value -// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required) -// exact (boolean, optional): default true -// page (number, optional): default 1 -// format ("json" | "xml", optional): default "json" +// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required): DNS record type to search by +// exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as...; default false +// page (number, optional): Page of results to return. Defaults to 1; default 1 +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsReverse({ value: "8.8.8.8", type: "a", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -366,12 +366,12 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsHistoricalV22({ domainName, type, page?, sort?, sortBy?, format? }) -// domainName (string, required) -// type (string, required): default "all" -// page (number, optional): default 1 +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsHistoricalV22({ domainName: "whoisfreaks.com", type: "A,MX,TXT", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -402,12 +402,12 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsHistoricalV23({ domainName, type, page?, sort?, sortBy?, format? }) -// domainName (string, required) -// type (string, required): default "all" -// page (number, optional): default 1 +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsHistoricalV23({ domainName: "whoisfreaks.com", type: "A,MX,TXT", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -439,12 +439,12 @@ const api = new DNSApi(config); // dnsReverseV22({ value, type, exact?, page?, sort?, sortBy?, format? }) // value (string, required): IP, CIDR, or record value -// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required) +// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required): DNS record type to search by // exact (boolean, optional): When false the value is matched as a substring, which is far slower than an e...; default true -// page (number, optional): default 1 +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsReverseV22({ value: "8.8.8.8", type: "a", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -476,12 +476,12 @@ const api = new DNSApi(config); // dnsReverseV23({ value, type, exact?, page?, sort?, sortBy?, format? }) // value (string, required): IP, CIDR, or record value -// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required) +// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required): DNS record type to search by // exact (boolean, optional): When false the value is matched as a substring, which is far slower than an e...; default true -// page (number, optional): default 1 +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsReverseV23({ value: "8.8.8.8", type: "a", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -512,9 +512,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsBulk({ type, dnsBulkRequest, format? }) -// type (string, required): default "all" +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" // dnsBulkRequest (DnsBulkRequest, required): request body -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const body: DnsBulkRequest = { domainNames: ["whoisfreaks.com", "example.com"] }; const result = await api.dnsBulk({ type: "A,MX,TXT", dnsBulkRequest: body }); @@ -551,7 +551,7 @@ const api = new DomainAvailabilityApi(config); // domain (string, required): The domain name to check // sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain; default false // count (number, optional): Number of TLD suggestions to return when sug=true. Maximum is 100; default 5 -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.domainAvailabilityV2({ domain: "google.com", sug: true, count: 5 }); console.log(JSON.stringify(result, null, 2)); @@ -584,7 +584,7 @@ const api = new DomainAvailabilityApi(config); // bulkDomainAvailabilityV2({ bulkDomainAvailabilityRequest, domain?, format? }) // bulkDomainAvailabilityRequest (BulkDomainAvailabilityRequest, required): request body // domain (string, optional): Required for TLD-mode bulk check (base domain) -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const body: BulkDomainAvailabilityRequest = { domainNames: ["whoisfreaks.com", "example.com"] }; const result = await api.bulkDomainAvailabilityV2({ bulkDomainAvailabilityRequest: body }); @@ -618,9 +618,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new TyposquattingApi(config); // typosquatting({ keyword?, pattern?, pageToken? }) -// keyword (string, optional) -// pattern (string, optional) -// pageToken (string, optional) +// keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not... +// pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword... +// pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward.... async function main(): Promise { const result = await api.typosquatting({ keyword: "whoisfreaks" }); console.log(JSON.stringify(result, null, 2)); @@ -637,6 +637,40 @@ main().catch(async (err: unknown) => { }); ``` +#### Subdomain Typosquatting Lookup + +`GET /v3.0/subdomains/typos` + +```typescript +// Subdomain Typosquatting Lookup: GET https://api.whoisfreaks.com/v3.0/subdomains/typos +// Run: WHOISFREAKS_API_KEY=your_api_key npx tsx SubdomainTyposquatting.ts +import { Configuration, TyposquattingApi, ResponseError } from "whoisfreaks"; + +// Set the API key once; the client adds it to every request. +const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); +const api = new TyposquattingApi(config); + +// subdomainTyposquatting({ keyword?, pattern?, pageToken?, fetch_size? }) +// keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits... +// pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one.... +// pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward.... +// fetch_size (number, optional): Subdomains per page. 100 when the parameter is left out, and values above 100...; default 100 +async function main(): Promise { + const result = await api.subdomainTyposquatting(); + console.log(JSON.stringify(result, null, 2)); +} + +main().catch(async (err: unknown) => { + // API errors carry the HTTP response + if (err instanceof ResponseError) { + console.error(`HTTP ${err.response.status}: ${await err.response.text()}`); + } else { + console.error(err); + } + process.exitCode = 1; +}); +``` + ### SSL #### SSL Certificate Lookup @@ -653,10 +687,10 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new SSLApi(config); // sslLookup({ domainName, chain?, sslRaw?, format? }) -// domainName (string, required) -// chain (boolean, optional): default false -// sslRaw (boolean, optional): default false -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user cert...; default false +// sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false; default false +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.sslLookup({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); @@ -689,7 +723,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new GeolocationApi(config); // geolocation({ ip }) -// ip (string, required) +// ip (string, required): IP address to look up async function main(): Promise { const result = await api.geolocation({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); @@ -754,12 +788,12 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new SubdomainsApi(config); // subdomains({ domain, after?, before?, status?, page?, format? }) -// domain (string, required) -// after (Date, optional) -// before (Date, optional) -// status ("active" | "inactive", optional) -// page (number, optional): default 1 -// format ("json" | "xml", optional): default "json" +// domain (string, required): Domain whose subdomains you want +// after (Date, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults t... +// before (Date, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults ... +// status ("active" | "inactive", optional): Limit results to active or inactive subdomains. Both are returned when the pa... +// page (number, optional): Page of results to return. Defaults to 1; default 1 +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.subdomains({ domain: "whoisfreaks.com", page: 1 }); console.log(JSON.stringify(result, null, 2)); @@ -792,7 +826,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new IPReputationApi(config); // ipReputation({ ip }) -// ip (string, required) +// ip (string, required): IP address to look up async function main(): Promise { const result = await api.ipReputation({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); @@ -855,7 +889,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new IPReputationApi(config); // ipReputationV2({ ip }) -// ip (string, required) +// ip (string, required): IP address to look up async function main(): Promise { const result = await api.ipReputationV2({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); @@ -921,7 +955,7 @@ const api = new DomainReputationApi(config); // domainReputation({ domainName, format? }) // domainName (string, required): The domain name to assess -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.domainReputation({ domainName: "amazon.com" }); console.log(JSON.stringify(result, null, 2)); @@ -954,8 +988,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new ASNWHOISApi(config); // asnWhois({ asn, format? }) -// asn (string, required) -// format ("json" | "xml", optional): default "json" +// asn (string, required): Autonomous system number to look up, with or without the AS prefix +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.asnWhois({ asn: "as15169" }); console.log(JSON.stringify(result, null, 2)); @@ -988,8 +1022,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new IPWHOISApi(config); // ipWhois({ ip, format? }) -// ip (string, required) -// format ("json" | "xml", optional): default "json" +// ip (string, required): IP address to look up +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.ipWhois({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); @@ -1115,9 +1149,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyGtld({ whois, date?, tlds? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const blob = await api.dbNewlyGtld({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbNewlyGtld.csv"; @@ -1152,9 +1186,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyCctld({ whois, date?, tlds? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const blob = await api.dbNewlyCctld({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbNewlyCctld.csv"; @@ -1258,7 +1292,7 @@ const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyGtldJson({ date?, tlds? }) // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const domains = await api.dbNewlyGtldJson({ date: new Date("2026-10-01") }); console.log(`${domains.length} domains`); @@ -1291,7 +1325,7 @@ const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyCctldJson({ date?, tlds? }) // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const domains = await api.dbNewlyCctldJson({ date: new Date("2026-10-01") }); console.log(`${domains.length} domains`); @@ -1362,7 +1396,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesExpiringDroppedApi(config); // dbExpired({ whois, date? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest async function main(): Promise { const blob = await api.dbExpired({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes @@ -1433,7 +1467,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesExpiringDroppedApi(config); // dbDropped({ whois, date? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest async function main(): Promise { const blob = await api.dbDropped({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes @@ -1468,7 +1502,7 @@ const api = new DatabasesExpiringDroppedApi(config); // dbDroppedJson({ date?, tlds? }) // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const domains = await api.dbDroppedJson({ date: new Date("2026-10-01") }); console.log(`${domains.length} domains`); @@ -1502,7 +1536,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesExpiringDroppedApi(config); // dbDroppedBacklinks({ whois?, date? }) -// whois (boolean, optional) +// whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest async function main(): Promise { const blob = await api.dbDroppedBacklinks({ date: new Date("2026-10-01") }); // a Blob with the file's bytes @@ -1891,7 +1925,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPGeolocationApi(config); // dbIpCountry({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpCountry({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpCountry.zip"; @@ -1956,7 +1990,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPGeolocationApi(config); // dbIpCity({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpCity({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpCity.zip"; @@ -1993,7 +2027,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesASNWHOISApi(config); // dbAsnWhois({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbAsnWhois({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbAsnWhois.json.gz"; @@ -2060,7 +2094,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPWHOISApi(config); // dbIpWhois({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpWhois({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpWhois.json.gz"; @@ -2127,7 +2161,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPSecurityApi(config); // dbIpSecurity({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpSecurity({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpSecurity.csv"; diff --git a/examples/README.md b/examples/README.md index fe6534b..3d06353 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,6 +1,6 @@ # Runnable Examples -Copy-paste, ready-to-run examples for **every one of the 94 endpoints** in **all 10 languages** (940 files). +Copy-paste, ready-to-run examples for **every one of the 95 endpoints** in **all 10 languages** (950 files). Set the `WHOISFREAKS_API_KEY` environment variable to your key (from ) and run. Layout: `examples//.`. @@ -21,6 +21,7 @@ Set the `WHOISFREAKS_API_KEY` environment variable to your key (from { + // API errors carry the HTTP status and the parsed error body + console.error(err.status ? `HTTP ${err.status}: ${JSON.stringify(err.body)}` : err); + process.exitCode = 1; +}); diff --git a/examples/javascript/Subdomains.js b/examples/javascript/Subdomains.js index 4aff309..25a4f34 100644 --- a/examples/javascript/Subdomains.js +++ b/examples/javascript/Subdomains.js @@ -8,12 +8,12 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new SubdomainsApi(client); // subdomains(domain, opts) -// domain (string, required) -// opts.after (string, "yyyy-MM-dd", optional) -// opts.before (string, "yyyy-MM-dd", optional) -// opts.status (string, optional): one of active, inactive -// opts.page (number, optional): default 1 -// opts.format (string, optional): one of json, xml; default "json" +// domain (string, required): Domain whose subdomains you want +// opts.after (string, "yyyy-MM-dd", optional): Only return records created after this date, in YYYY-MM-DD format. Defaults t... +// opts.before (string, "yyyy-MM-dd", optional): Only return records created before this date, in YYYY-MM-DD format. Defaults ... +// opts.status (string, optional): Limit results to active or inactive subdomains. Both are returned when the pa...; one of active, inactive +// opts.page (number, optional): Page of results to return. Defaults to 1; default 1 +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.subdomains("whoisfreaks.com", { page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/javascript/Typosquatting.js b/examples/javascript/Typosquatting.js index 35521a8..1b2da18 100644 --- a/examples/javascript/Typosquatting.js +++ b/examples/javascript/Typosquatting.js @@ -8,9 +8,9 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new TyposquattingApi(client); // typosquatting(opts) -// opts.keyword (string, optional) -// opts.pattern (string, optional) -// opts.pageToken (string, optional) +// opts.keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not... +// opts.pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword... +// opts.pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward.... async function main() { const result = await api.typosquatting({ keyword: "whoisfreaks" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/javascript/WhoisHistory.js b/examples/javascript/WhoisHistory.js index 49b84d8..74f14ab 100644 --- a/examples/javascript/WhoisHistory.js +++ b/examples/javascript/WhoisHistory.js @@ -9,7 +9,7 @@ const api = new WHOISApi(client); // whoisHistory(domainName, opts) // domainName (string, required): Domain to fetch historical WHOIS records for -// opts.format (string, optional): one of json, xml +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml async function main() { const result = await api.whoisHistory("whoisfreaks.com"); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/javascript/WhoisLive.js b/examples/javascript/WhoisLive.js index 8bd66a9..e20691c 100644 --- a/examples/javascript/WhoisLive.js +++ b/examples/javascript/WhoisLive.js @@ -8,8 +8,8 @@ client.authentications["ApiKeyAuth"].apiKey = process.env.WHOISFREAKS_API_KEY; const api = new WHOISApi(client); // whoisLive(domainName, opts) -// domainName (string, required) -// opts.format (string, optional): one of json, xml; default "json" +// domainName (string, required): Domain to look up +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml; default "json" async function main() { const result = await api.whoisLive("whoisfreaks.com"); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/javascript/WhoisReverse.js b/examples/javascript/WhoisReverse.js index 6f2b4a9..d4e0644 100644 --- a/examples/javascript/WhoisReverse.js +++ b/examples/javascript/WhoisReverse.js @@ -10,7 +10,7 @@ const api = new WHOISApi(client); // whoisReverse(keyword, opts) // keyword (string, required): Keyword to search across WHOIS records // opts.page (number, optional): Page number -// opts.format (string, optional): one of json, xml +// opts.format (string, optional): Response format. JSON when the parameter is left out; one of json, xml async function main() { const result = await api.whoisReverse("whoisfreaks", { page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/kotlin/AsnWhois.kt b/examples/kotlin/AsnWhois.kt index 207c9cb..3a56138 100644 --- a/examples/kotlin/AsnWhois.kt +++ b/examples/kotlin/AsnWhois.kt @@ -1,8 +1,8 @@ // Runnable example: ASN WHOIS Lookup (GET /v2.0/asn-whois) // Run it from the Getting Started project: gradle run -PmainClass=AsnWhoisKt // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.ASNWHOISApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/BulkDomainAvailabilityV2.kt b/examples/kotlin/BulkDomainAvailabilityV2.kt index adc5de9..b09f6ff 100644 --- a/examples/kotlin/BulkDomainAvailabilityV2.kt +++ b/examples/kotlin/BulkDomainAvailabilityV2.kt @@ -2,7 +2,7 @@ // Run it from the Getting Started project: gradle run -PmainClass=BulkDomainAvailabilityV2Kt // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object import com.whoisfreaks.client.apis.DomainAvailabilityApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/BulkWhois.kt b/examples/kotlin/BulkWhois.kt index 39a891f..8b3d922 100644 --- a/examples/kotlin/BulkWhois.kt +++ b/examples/kotlin/BulkWhois.kt @@ -1,7 +1,7 @@ // Runnable example: Bulk WHOIS Lookup (POST /v2.0/bulkwhois/live) // Run it from the Getting Started project: gradle run -PmainClass=BulkWhoisKt // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DbAsnWhois.kt b/examples/kotlin/DbAsnWhois.kt index b76cdf1..e6535cb 100644 --- a/examples/kotlin/DbAsnWhois.kt +++ b/examples/kotlin/DbAsnWhois.kt @@ -1,7 +1,7 @@ // Runnable example: ASN WHOIS Snapshot (GET /v3.3/download/snapshot/asn/whois) // Run it from the Getting Started project: gradle run -PmainClass=DbAsnWhoisKt // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesASNWHOISApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File diff --git a/examples/kotlin/DbDropped.kt b/examples/kotlin/DbDropped.kt index 18e0b8c..4f3186d 100644 --- a/examples/kotlin/DbDropped.kt +++ b/examples/kotlin/DbDropped.kt @@ -1,7 +1,7 @@ // Runnable example: Dropped Domains (GET /v3.1/download/domainer/dropped) // Run it from the Getting Started project: gradle run -PmainClass=DbDroppedKt // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest import com.whoisfreaks.client.apis.DatabasesExpiringDroppedApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DbDroppedBacklinks.kt b/examples/kotlin/DbDroppedBacklinks.kt index f768456..0d07d84 100644 --- a/examples/kotlin/DbDroppedBacklinks.kt +++ b/examples/kotlin/DbDroppedBacklinks.kt @@ -1,7 +1,7 @@ // Runnable example: Dropped With Backlinks (GET /v3.3/download/domainer/dropped/backlinks) // Run it from the Getting Started project: gradle run -PmainClass=DbDroppedBacklinksKt // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest import com.whoisfreaks.client.apis.DatabasesExpiringDroppedApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DbDroppedJson.kt b/examples/kotlin/DbDroppedJson.kt index d6ebdd5..9d9a150 100644 --- a/examples/kotlin/DbDroppedJson.kt +++ b/examples/kotlin/DbDroppedJson.kt @@ -2,7 +2,7 @@ // Run it from the Getting Started project: gradle run -PmainClass=DbDroppedJsonKt // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesExpiringDroppedApi import com.whoisfreaks.client.infrastructure.ApiClient import java.time.LocalDate diff --git a/examples/kotlin/DbExpired.kt b/examples/kotlin/DbExpired.kt index 5175458..ea0c139 100644 --- a/examples/kotlin/DbExpired.kt +++ b/examples/kotlin/DbExpired.kt @@ -1,7 +1,7 @@ // Runnable example: Expiring Domains (GET /v3.1/download/domainer/expired) // Run it from the Getting Started project: gradle run -PmainClass=DbExpiredKt // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest import com.whoisfreaks.client.apis.DatabasesExpiringDroppedApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DbIpCity.kt b/examples/kotlin/DbIpCity.kt index 4fcfb8f..b09dd42 100644 --- a/examples/kotlin/DbIpCity.kt +++ b/examples/kotlin/DbIpCity.kt @@ -1,7 +1,7 @@ // Runnable example: IP to City Snapshot (GET /v3.3/download/snapshot/ip/city) // Run it from the Getting Started project: gradle run -PmainClass=DbIpCityKt // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesIPGeolocationApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File diff --git a/examples/kotlin/DbIpCountry.kt b/examples/kotlin/DbIpCountry.kt index eb00d9b..0023987 100644 --- a/examples/kotlin/DbIpCountry.kt +++ b/examples/kotlin/DbIpCountry.kt @@ -1,7 +1,7 @@ // Runnable example: IP to Country Snapshot (GET /v3.3/download/snapshot/ip/country) // Run it from the Getting Started project: gradle run -PmainClass=DbIpCountryKt // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesIPGeolocationApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File diff --git a/examples/kotlin/DbIpSecurity.kt b/examples/kotlin/DbIpSecurity.kt index 56d44bf..66ec96e 100644 --- a/examples/kotlin/DbIpSecurity.kt +++ b/examples/kotlin/DbIpSecurity.kt @@ -1,7 +1,7 @@ // Runnable example: IP Security Snapshot (GET /v3.3/download/snapshot/ip/security) // Run it from the Getting Started project: gradle run -PmainClass=DbIpSecurityKt // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesIPSecurityApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File diff --git a/examples/kotlin/DbIpWhois.kt b/examples/kotlin/DbIpWhois.kt index cb5d863..bd10522 100644 --- a/examples/kotlin/DbIpWhois.kt +++ b/examples/kotlin/DbIpWhois.kt @@ -1,7 +1,7 @@ // Runnable example: IP WHOIS Snapshot (GET /v3.3/download/snapshot/ip/whois) // Run it from the Getting Started project: gradle run -PmainClass=DbIpWhoisKt // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. import com.whoisfreaks.client.apis.DatabasesIPWHOISApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File diff --git a/examples/kotlin/DbNewlyCctld.kt b/examples/kotlin/DbNewlyCctld.kt index d74af8d..b1fd9b4 100644 --- a/examples/kotlin/DbNewlyCctld.kt +++ b/examples/kotlin/DbNewlyCctld.kt @@ -1,9 +1,9 @@ // Runnable example: Newly Registered ccTLD (CSV) (GET /v3.1/download/domainer/cctld) // Run it from the Getting Started project: gradle run -PmainClass=DbNewlyCctldKt // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesNewlyRegisteredApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File diff --git a/examples/kotlin/DbNewlyCctldJson.kt b/examples/kotlin/DbNewlyCctldJson.kt index feed8f7..63aeb66 100644 --- a/examples/kotlin/DbNewlyCctldJson.kt +++ b/examples/kotlin/DbNewlyCctldJson.kt @@ -2,7 +2,7 @@ // Run it from the Getting Started project: gradle run -PmainClass=DbNewlyCctldJsonKt // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesNewlyRegisteredApi import com.whoisfreaks.client.infrastructure.ApiClient import java.time.LocalDate diff --git a/examples/kotlin/DbNewlyGtld.kt b/examples/kotlin/DbNewlyGtld.kt index 5ce7a3f..2db8af9 100644 --- a/examples/kotlin/DbNewlyGtld.kt +++ b/examples/kotlin/DbNewlyGtld.kt @@ -1,9 +1,9 @@ // Runnable example: Newly Registered gTLD (CSV) (GET /v3.1/download/domainer/gtld) // Run it from the Getting Started project: gradle run -PmainClass=DbNewlyGtldKt // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesNewlyRegisteredApi import com.whoisfreaks.client.infrastructure.ApiClient import java.io.File diff --git a/examples/kotlin/DbNewlyGtldJson.kt b/examples/kotlin/DbNewlyGtldJson.kt index 67cf534..37cbcf3 100644 --- a/examples/kotlin/DbNewlyGtldJson.kt +++ b/examples/kotlin/DbNewlyGtldJson.kt @@ -2,7 +2,7 @@ // Run it from the Getting Started project: gradle run -PmainClass=DbNewlyGtldJsonKt // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... import com.whoisfreaks.client.apis.DatabasesNewlyRegisteredApi import com.whoisfreaks.client.infrastructure.ApiClient import java.time.LocalDate diff --git a/examples/kotlin/DnsBulk.kt b/examples/kotlin/DnsBulk.kt index 2ed44df..0e4314e 100644 --- a/examples/kotlin/DnsBulk.kt +++ b/examples/kotlin/DnsBulk.kt @@ -1,8 +1,8 @@ // Runnable example: Bulk DNS Lookup (POST /v2.0/dns/bulk/live) // Run it from the Getting Started project: gradle run -PmainClass=DnsBulkKt // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DnsHistorical.kt b/examples/kotlin/DnsHistorical.kt index e7dee08..1142094 100644 --- a/examples/kotlin/DnsHistorical.kt +++ b/examples/kotlin/DnsHistorical.kt @@ -1,10 +1,10 @@ // Runnable example: Historical DNS Lookup (GET /v2.0/dns/historical) // Run it from the Getting Started project: gradle run -PmainClass=DnsHistoricalKt // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DnsHistoricalV22.kt b/examples/kotlin/DnsHistoricalV22.kt index 19aa1d7..0aa595c 100644 --- a/examples/kotlin/DnsHistoricalV22.kt +++ b/examples/kotlin/DnsHistoricalV22.kt @@ -1,12 +1,12 @@ // Runnable example: Historical DNS Lookup (v2.2) (GET /v2.2/dns/historical) // Run it from the Getting Started project: gradle run -PmainClass=DnsHistoricalV22Kt // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DnsHistoricalV23.kt b/examples/kotlin/DnsHistoricalV23.kt index ef0e22b..30b2b0b 100644 --- a/examples/kotlin/DnsHistoricalV23.kt +++ b/examples/kotlin/DnsHistoricalV23.kt @@ -1,12 +1,12 @@ // Runnable example: Historical DNS Lookup (v2.3) (GET /v2.3/dns/historical) // Run it from the Getting Started project: gradle run -PmainClass=DnsHistoricalV23Kt // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DnsLive.kt b/examples/kotlin/DnsLive.kt index 9b076a0..975ea4e 100644 --- a/examples/kotlin/DnsLive.kt +++ b/examples/kotlin/DnsLive.kt @@ -1,10 +1,10 @@ // Runnable example: Live DNS Lookup (GET /v2.0/dns/live) // Run it from the Getting Started project: gradle run -PmainClass=DnsLiveKt // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DnsReverse.kt b/examples/kotlin/DnsReverse.kt index 4d4b08f..464bf2f 100644 --- a/examples/kotlin/DnsReverse.kt +++ b/examples/kotlin/DnsReverse.kt @@ -2,10 +2,10 @@ // Run it from the Getting Started project: gradle run -PmainClass=DnsReverseKt // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DnsReverseV22.kt b/examples/kotlin/DnsReverseV22.kt index 1544b13..b5ddbb4 100644 --- a/examples/kotlin/DnsReverseV22.kt +++ b/examples/kotlin/DnsReverseV22.kt @@ -2,12 +2,12 @@ // Run it from the Getting Started project: gradle run -PmainClass=DnsReverseV22Kt // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DnsReverseV23.kt b/examples/kotlin/DnsReverseV23.kt index b1baf32..783151c 100644 --- a/examples/kotlin/DnsReverseV23.kt +++ b/examples/kotlin/DnsReverseV23.kt @@ -2,12 +2,12 @@ // Run it from the Getting Started project: gradle run -PmainClass=DnsReverseV23Kt // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DNSApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DomainAvailabilityV2.kt b/examples/kotlin/DomainAvailabilityV2.kt index 0818124..36e39be 100644 --- a/examples/kotlin/DomainAvailabilityV2.kt +++ b/examples/kotlin/DomainAvailabilityV2.kt @@ -4,7 +4,7 @@ // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DomainAvailabilityApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/DomainReputation.kt b/examples/kotlin/DomainReputation.kt index e9b6de5..6880f9d 100644 --- a/examples/kotlin/DomainReputation.kt +++ b/examples/kotlin/DomainReputation.kt @@ -2,7 +2,7 @@ // Run it from the Getting Started project: gradle run -PmainClass=DomainReputationKt // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.DomainReputationApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/Geolocation.kt b/examples/kotlin/Geolocation.kt index d34d0bd..9466d76 100644 --- a/examples/kotlin/Geolocation.kt +++ b/examples/kotlin/Geolocation.kt @@ -1,7 +1,7 @@ // Runnable example: IP Geolocation Lookup (GET /v1.0/geolocation) // Run it from the Getting Started project: gradle run -PmainClass=GeolocationKt // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. import com.whoisfreaks.client.apis.GeolocationApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/IpReputation.kt b/examples/kotlin/IpReputation.kt index 744f9b6..941ab4f 100644 --- a/examples/kotlin/IpReputation.kt +++ b/examples/kotlin/IpReputation.kt @@ -1,7 +1,7 @@ // Runnable example: IP Reputation Lookup (GET /v1.0/security) // Run it from the Getting Started project: gradle run -PmainClass=IpReputationKt // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. import com.whoisfreaks.client.apis.IPReputationApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/IpReputationV2.kt b/examples/kotlin/IpReputationV2.kt index 7bf8100..c3e2658 100644 --- a/examples/kotlin/IpReputationV2.kt +++ b/examples/kotlin/IpReputationV2.kt @@ -1,7 +1,7 @@ // Runnable example: IP Reputation Lookup (v2.0) (GET /v2.0/security) // Run it from the Getting Started project: gradle run -PmainClass=IpReputationV2Kt // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. import com.whoisfreaks.client.apis.IPReputationApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/IpWhois.kt b/examples/kotlin/IpWhois.kt index 512326e..dbb4a09 100644 --- a/examples/kotlin/IpWhois.kt +++ b/examples/kotlin/IpWhois.kt @@ -1,8 +1,8 @@ // Runnable example: IP WHOIS Lookup (GET /v1.0/ip-whois) // Run it from the Getting Started project: gradle run -PmainClass=IpWhoisKt // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.IPWHOISApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/README.md b/examples/kotlin/README.md index 1e7a6d6..8088f07 100644 --- a/examples/kotlin/README.md +++ b/examples/kotlin/README.md @@ -24,6 +24,7 @@ Install: see the [Kotlin guide](../../docs/languages/kotlin.md). Set the `WHOISF ## Typosquatting - [`Typosquatting.kt`](Typosquatting.kt): Typosquatting Lookup (`GET /v3.0/domain/typos`) +- [`SubdomainTyposquatting.kt`](SubdomainTyposquatting.kt): Subdomain Typosquatting Lookup (`GET /v3.0/subdomains/typos`) ## SSL - [`SslLookup.kt`](SslLookup.kt): SSL Certificate Lookup (`GET /v1.0/ssl/live`) diff --git a/examples/kotlin/SslLookup.kt b/examples/kotlin/SslLookup.kt index f0c7f8b..6fedd6e 100644 --- a/examples/kotlin/SslLookup.kt +++ b/examples/kotlin/SslLookup.kt @@ -1,10 +1,10 @@ // Runnable example: SSL Certificate Lookup (GET /v1.0/ssl/live) // Run it from the Getting Started project: gradle run -PmainClass=SslLookupKt // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.SSLApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/SubdomainTyposquatting.kt b/examples/kotlin/SubdomainTyposquatting.kt new file mode 100644 index 0000000..d12efe7 --- /dev/null +++ b/examples/kotlin/SubdomainTyposquatting.kt @@ -0,0 +1,17 @@ +// Runnable example: Subdomain Typosquatting Lookup (GET /v3.0/subdomains/typos) +// Run it from the Getting Started project: gradle run -PmainClass=SubdomainTyposquattingKt +// Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +// - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +// - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +// - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... +import com.whoisfreaks.client.apis.TyposquattingApi +import com.whoisfreaks.client.infrastructure.ApiClient + +fun main() { + ApiClient.apiKey["apiKey"] = System.getenv("WHOISFREAKS_API_KEY") // set once, sent with every call + val api = TyposquattingApi() + + val result = api.subdomainTyposquatting(keyword = "paypal") + println(result) +} diff --git a/examples/kotlin/Subdomains.kt b/examples/kotlin/Subdomains.kt index c9580ab..01b3505 100644 --- a/examples/kotlin/Subdomains.kt +++ b/examples/kotlin/Subdomains.kt @@ -1,12 +1,12 @@ // Runnable example: Subdomains Lookup (GET /v1.0/subdomains) // Run it from the Getting Started project: gradle run -PmainClass=SubdomainsKt // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.SubdomainsApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/Typosquatting.kt b/examples/kotlin/Typosquatting.kt index 30c5bf0..55e1d52 100644 --- a/examples/kotlin/Typosquatting.kt +++ b/examples/kotlin/Typosquatting.kt @@ -1,9 +1,9 @@ // Runnable example: Typosquatting Lookup (GET /v3.0/domain/typos) // Run it from the Getting Started project: gradle run -PmainClass=TyposquattingKt // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... import com.whoisfreaks.client.apis.TyposquattingApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/WhoisHistory.kt b/examples/kotlin/WhoisHistory.kt index d89846a..20e32a9 100644 --- a/examples/kotlin/WhoisHistory.kt +++ b/examples/kotlin/WhoisHistory.kt @@ -2,7 +2,7 @@ // Run it from the Getting Started project: gradle run -PmainClass=WhoisHistoryKt // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/WhoisLive.kt b/examples/kotlin/WhoisLive.kt index 38caf5e..7d27994 100644 --- a/examples/kotlin/WhoisLive.kt +++ b/examples/kotlin/WhoisLive.kt @@ -1,8 +1,8 @@ // Runnable example: Live WHOIS Lookup (GET /v2.0/whois/live) // Run it from the Getting Started project: gradle run -PmainClass=WhoisLiveKt // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/kotlin/WhoisReverse.kt b/examples/kotlin/WhoisReverse.kt index 1402d3b..f2c2212 100644 --- a/examples/kotlin/WhoisReverse.kt +++ b/examples/kotlin/WhoisReverse.kt @@ -3,7 +3,7 @@ // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. import com.whoisfreaks.client.apis.WHOISApi import com.whoisfreaks.client.infrastructure.ApiClient diff --git a/examples/php/AsnWhois.php b/examples/php/AsnWhois.php index e9e15b9..d345123 100644 --- a/examples/php/AsnWhois.php +++ b/examples/php/AsnWhois.php @@ -2,8 +2,8 @@ // ASN WHOIS Lookup // // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/BulkDomainAvailabilityV2.php b/examples/php/BulkDomainAvailabilityV2.php index 1686dfc..23ccc06 100644 --- a/examples/php/BulkDomainAvailabilityV2.php +++ b/examples/php/BulkDomainAvailabilityV2.php @@ -3,7 +3,7 @@ // // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/BulkWhois.php b/examples/php/BulkWhois.php index c0157e2..b9d68ae 100644 --- a/examples/php/BulkWhois.php +++ b/examples/php/BulkWhois.php @@ -2,7 +2,7 @@ // Bulk WHOIS Lookup // // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbAsnWhois.php b/examples/php/DbAsnWhois.php index 147c36e..82a0850 100644 --- a/examples/php/DbAsnWhois.php +++ b/examples/php/DbAsnWhois.php @@ -2,7 +2,7 @@ // ASN WHOIS Snapshot // // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbDropped.php b/examples/php/DbDropped.php index c2c146e..cd94614 100644 --- a/examples/php/DbDropped.php +++ b/examples/php/DbDropped.php @@ -2,7 +2,7 @@ // Dropped Domains // // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbDroppedBacklinks.php b/examples/php/DbDroppedBacklinks.php index df5d7b8..973abdb 100644 --- a/examples/php/DbDroppedBacklinks.php +++ b/examples/php/DbDroppedBacklinks.php @@ -2,7 +2,7 @@ // Dropped With Backlinks // // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbDroppedJson.php b/examples/php/DbDroppedJson.php index f7fef61..b64f009 100644 --- a/examples/php/DbDroppedJson.php +++ b/examples/php/DbDroppedJson.php @@ -3,7 +3,7 @@ // // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbExpired.php b/examples/php/DbExpired.php index c29b473..ff9a983 100644 --- a/examples/php/DbExpired.php +++ b/examples/php/DbExpired.php @@ -2,7 +2,7 @@ // Expiring Domains // // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbIpCity.php b/examples/php/DbIpCity.php index f31aab8..6a8e51c 100644 --- a/examples/php/DbIpCity.php +++ b/examples/php/DbIpCity.php @@ -2,7 +2,7 @@ // IP to City Snapshot // // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbIpCountry.php b/examples/php/DbIpCountry.php index bd3cb04..1313c2a 100644 --- a/examples/php/DbIpCountry.php +++ b/examples/php/DbIpCountry.php @@ -2,7 +2,7 @@ // IP to Country Snapshot // // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbIpSecurity.php b/examples/php/DbIpSecurity.php index ad03d42..f84a130 100644 --- a/examples/php/DbIpSecurity.php +++ b/examples/php/DbIpSecurity.php @@ -2,7 +2,7 @@ // IP Security Snapshot // // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbIpWhois.php b/examples/php/DbIpWhois.php index e5aa539..58b75d7 100644 --- a/examples/php/DbIpWhois.php +++ b/examples/php/DbIpWhois.php @@ -2,7 +2,7 @@ // IP WHOIS Snapshot // // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbNewlyCctld.php b/examples/php/DbNewlyCctld.php index 435191b..f003be0 100644 --- a/examples/php/DbNewlyCctld.php +++ b/examples/php/DbNewlyCctld.php @@ -2,9 +2,9 @@ // Newly Registered ccTLD (CSV) // // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbNewlyCctldJson.php b/examples/php/DbNewlyCctldJson.php index 102b5cb..7423305 100644 --- a/examples/php/DbNewlyCctldJson.php +++ b/examples/php/DbNewlyCctldJson.php @@ -3,7 +3,7 @@ // // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbNewlyGtld.php b/examples/php/DbNewlyGtld.php index 209ffa7..482efb9 100644 --- a/examples/php/DbNewlyGtld.php +++ b/examples/php/DbNewlyGtld.php @@ -2,9 +2,9 @@ // Newly Registered gTLD (CSV) // // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DbNewlyGtldJson.php b/examples/php/DbNewlyGtldJson.php index 68b35ff..cbbfaed 100644 --- a/examples/php/DbNewlyGtldJson.php +++ b/examples/php/DbNewlyGtldJson.php @@ -3,7 +3,7 @@ // // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DnsBulk.php b/examples/php/DnsBulk.php index 6dd855a..26bf0a8 100644 --- a/examples/php/DnsBulk.php +++ b/examples/php/DnsBulk.php @@ -2,8 +2,8 @@ // Bulk DNS Lookup // // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DnsHistorical.php b/examples/php/DnsHistorical.php index 35d5354..a2d775c 100644 --- a/examples/php/DnsHistorical.php +++ b/examples/php/DnsHistorical.php @@ -2,10 +2,10 @@ // Historical DNS Lookup // // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DnsHistoricalV22.php b/examples/php/DnsHistoricalV22.php index 477731e..909d1b0 100644 --- a/examples/php/DnsHistoricalV22.php +++ b/examples/php/DnsHistoricalV22.php @@ -2,12 +2,12 @@ // Historical DNS Lookup (v2.2) // // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DnsHistoricalV23.php b/examples/php/DnsHistoricalV23.php index fac3793..20a8b67 100644 --- a/examples/php/DnsHistoricalV23.php +++ b/examples/php/DnsHistoricalV23.php @@ -2,12 +2,12 @@ // Historical DNS Lookup (v2.3) // // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DnsLive.php b/examples/php/DnsLive.php index 17c4d46..c41bee8 100644 --- a/examples/php/DnsLive.php +++ b/examples/php/DnsLive.php @@ -2,10 +2,10 @@ // Live DNS Lookup // // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DnsReverse.php b/examples/php/DnsReverse.php index d7bb77c..92c91ad 100644 --- a/examples/php/DnsReverse.php +++ b/examples/php/DnsReverse.php @@ -3,10 +3,10 @@ // // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; @@ -22,7 +22,7 @@ $api = new DNSApi(new Client(), $config); try { - $result = $api->dnsReverse('8.8.8.8', 'a', true, 1); // value, type, exact, page + $result = $api->dnsReverse('8.8.8.8', 'a', false, 1); // value, type, exact, page echo $result, PHP_EOL; // models print as JSON } catch (ApiException $e) { fwrite(STDERR, 'Request failed: HTTP ' . $e->getCode() . ' ' . $e->getResponseBody() . PHP_EOL); diff --git a/examples/php/DnsReverseV22.php b/examples/php/DnsReverseV22.php index e6f7e1f..119e3fa 100644 --- a/examples/php/DnsReverseV22.php +++ b/examples/php/DnsReverseV22.php @@ -3,12 +3,12 @@ // // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DnsReverseV23.php b/examples/php/DnsReverseV23.php index 61db400..9d6598f 100644 --- a/examples/php/DnsReverseV23.php +++ b/examples/php/DnsReverseV23.php @@ -3,12 +3,12 @@ // // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DomainAvailabilityV2.php b/examples/php/DomainAvailabilityV2.php index 9c57723..e9cf0c1 100644 --- a/examples/php/DomainAvailabilityV2.php +++ b/examples/php/DomainAvailabilityV2.php @@ -5,7 +5,7 @@ // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/DomainReputation.php b/examples/php/DomainReputation.php index c0db3fc..89f1d48 100644 --- a/examples/php/DomainReputation.php +++ b/examples/php/DomainReputation.php @@ -3,7 +3,7 @@ // // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/Geolocation.php b/examples/php/Geolocation.php index e00244f..eda03d2 100644 --- a/examples/php/Geolocation.php +++ b/examples/php/Geolocation.php @@ -2,7 +2,7 @@ // IP Geolocation Lookup // // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/IpReputation.php b/examples/php/IpReputation.php index 009de82..d44703a 100644 --- a/examples/php/IpReputation.php +++ b/examples/php/IpReputation.php @@ -2,7 +2,7 @@ // IP Reputation Lookup // // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/IpReputationV2.php b/examples/php/IpReputationV2.php index 2ad6640..653c456 100644 --- a/examples/php/IpReputationV2.php +++ b/examples/php/IpReputationV2.php @@ -2,7 +2,7 @@ // IP Reputation Lookup (v2.0) // // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/IpWhois.php b/examples/php/IpWhois.php index 9402477..00f17fa 100644 --- a/examples/php/IpWhois.php +++ b/examples/php/IpWhois.php @@ -2,8 +2,8 @@ // IP WHOIS Lookup // // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/README.md b/examples/php/README.md index 2e70a3f..3db0d4a 100644 --- a/examples/php/README.md +++ b/examples/php/README.md @@ -24,6 +24,7 @@ Install: see the [PHP guide](../../docs/languages/php.md). Set the `WHOISFREAKS_ ## Typosquatting - [`Typosquatting.php`](Typosquatting.php): Typosquatting Lookup (`GET /v3.0/domain/typos`) +- [`SubdomainTyposquatting.php`](SubdomainTyposquatting.php): Subdomain Typosquatting Lookup (`GET /v3.0/subdomains/typos`) ## SSL - [`SslLookup.php`](SslLookup.php): SSL Certificate Lookup (`GET /v1.0/ssl/live`) diff --git a/examples/php/SslLookup.php b/examples/php/SslLookup.php index b1a1a65..c7607ab 100644 --- a/examples/php/SslLookup.php +++ b/examples/php/SslLookup.php @@ -2,10 +2,10 @@ // SSL Certificate Lookup // // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/SubdomainTyposquatting.php b/examples/php/SubdomainTyposquatting.php new file mode 100644 index 0000000..b12f541 --- /dev/null +++ b/examples/php/SubdomainTyposquatting.php @@ -0,0 +1,29 @@ +setApiKey('apiKey', getenv('WHOISFREAKS_API_KEY')); + +$api = new TyposquattingApi(new Client(), $config); + +try { + $result = $api->subdomainTyposquatting('paypal'); + echo $result, PHP_EOL; // models print as JSON +} catch (ApiException $e) { + fwrite(STDERR, 'Request failed: HTTP ' . $e->getCode() . ' ' . $e->getResponseBody() . PHP_EOL); + exit(1); +} diff --git a/examples/php/Subdomains.php b/examples/php/Subdomains.php index ffe23da..3df0c4a 100644 --- a/examples/php/Subdomains.php +++ b/examples/php/Subdomains.php @@ -2,12 +2,12 @@ // Subdomains Lookup // // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/Typosquatting.php b/examples/php/Typosquatting.php index cb1828b..1620b34 100644 --- a/examples/php/Typosquatting.php +++ b/examples/php/Typosquatting.php @@ -2,9 +2,9 @@ // Typosquatting Lookup // // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/WhoisHistory.php b/examples/php/WhoisHistory.php index c90f23f..879949b 100644 --- a/examples/php/WhoisHistory.php +++ b/examples/php/WhoisHistory.php @@ -3,7 +3,7 @@ // // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/WhoisLive.php b/examples/php/WhoisLive.php index 77f3964..6cd60f9 100644 --- a/examples/php/WhoisLive.php +++ b/examples/php/WhoisLive.php @@ -2,8 +2,8 @@ // Live WHOIS Lookup // // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/php/WhoisReverse.php b/examples/php/WhoisReverse.php index 376ecd9..f04cb38 100644 --- a/examples/php/WhoisReverse.php +++ b/examples/php/WhoisReverse.php @@ -4,7 +4,7 @@ // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require __DIR__ . '/vendor/autoload.php'; diff --git a/examples/python/AsnWhois.py b/examples/python/AsnWhois.py index 87b9077..557fe0a 100644 --- a/examples/python/AsnWhois.py +++ b/examples/python/AsnWhois.py @@ -15,7 +15,7 @@ api = whoisfreaks.ASNWHOISApi(client) # asn_whois parameters: - # asn (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # asn (str, required): Autonomous system number to look up, with or without the AS prefix + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.asn_whois("as15169") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/BulkDomainAvailabilityV2.py b/examples/python/BulkDomainAvailabilityV2.py index faccf9e..5e65784 100644 --- a/examples/python/BulkDomainAvailabilityV2.py +++ b/examples/python/BulkDomainAvailabilityV2.py @@ -17,7 +17,7 @@ # bulk_domain_availability_v2 parameters: # bulk_domain_availability_request (BulkDomainAvailabilityRequest, required): request body # domain (str, optional, keyword): Required for TLD-mode bulk check (base domain) - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" body = whoisfreaks.BulkDomainAvailabilityRequest(domain_names=["whoisfreaks.com", "example.com"]) result = api.bulk_domain_availability_v2(body) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/BulkWhois.py b/examples/python/BulkWhois.py index b6db440..803140b 100644 --- a/examples/python/BulkWhois.py +++ b/examples/python/BulkWhois.py @@ -16,7 +16,7 @@ # bulk_whois parameters: # bulk_whois_request (BulkWhoisRequest, required): request body - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" body = whoisfreaks.BulkWhoisRequest(domain_names=["whoisfreaks.com", "jfreaks.com"]) result = api.bulk_whois(body) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DbAsnWhois.py b/examples/python/DbAsnWhois.py index 2c5e44d..8298dbc 100644 --- a/examples/python/DbAsnWhois.py +++ b/examples/python/DbAsnWhois.py @@ -15,7 +15,7 @@ api = whoisfreaks.DatabasesASNWHOISApi(client) # db_asn_whois parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_asn_whois(date(2026, 10, 1)) # the file's raw bytes path = "DbAsnWhois.json.gz" with open(path, "wb") as f: diff --git a/examples/python/DbDropped.py b/examples/python/DbDropped.py index cb3c1d1..9b60f4b 100644 --- a/examples/python/DbDropped.py +++ b/examples/python/DbDropped.py @@ -15,7 +15,7 @@ api = whoisfreaks.DatabasesExpiringDroppedApi(client) # db_dropped parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest data = api.db_dropped(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbDropped.csv" diff --git a/examples/python/DbDroppedBacklinks.py b/examples/python/DbDroppedBacklinks.py index c073616..465d976 100644 --- a/examples/python/DbDroppedBacklinks.py +++ b/examples/python/DbDroppedBacklinks.py @@ -15,7 +15,7 @@ api = whoisfreaks.DatabasesExpiringDroppedApi(client) # db_dropped_backlinks parameters: - # whois (bool, optional, keyword) + # whois (bool, optional, keyword): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest data = api.db_dropped_backlinks(var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbDroppedBacklinks.csv" diff --git a/examples/python/DbDroppedJson.py b/examples/python/DbDroppedJson.py index 6f5f6c2..58fc3c0 100644 --- a/examples/python/DbDroppedJson.py +++ b/examples/python/DbDroppedJson.py @@ -16,7 +16,7 @@ # db_dropped_json parameters: # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... domains = api.db_dropped_json(var_date=date(2026, 10, 1)) print(f"{len(domains)} domains") print("\n".join(domains[:10])) diff --git a/examples/python/DbExpired.py b/examples/python/DbExpired.py index b0c7c16..cfbca0a 100644 --- a/examples/python/DbExpired.py +++ b/examples/python/DbExpired.py @@ -15,7 +15,7 @@ api = whoisfreaks.DatabasesExpiringDroppedApi(client) # db_expired parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest data = api.db_expired(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbExpired.csv" diff --git a/examples/python/DbIpCity.py b/examples/python/DbIpCity.py index 2dbd007..39554a0 100644 --- a/examples/python/DbIpCity.py +++ b/examples/python/DbIpCity.py @@ -15,7 +15,7 @@ api = whoisfreaks.DatabasesIPGeolocationApi(client) # db_ip_city parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_city(date(2026, 10, 1)) # the file's raw bytes path = "DbIpCity.zip" with open(path, "wb") as f: diff --git a/examples/python/DbIpCountry.py b/examples/python/DbIpCountry.py index a223a55..76a88ec 100644 --- a/examples/python/DbIpCountry.py +++ b/examples/python/DbIpCountry.py @@ -15,7 +15,7 @@ api = whoisfreaks.DatabasesIPGeolocationApi(client) # db_ip_country parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_country(date(2026, 10, 1)) # the file's raw bytes path = "DbIpCountry.zip" with open(path, "wb") as f: diff --git a/examples/python/DbIpSecurity.py b/examples/python/DbIpSecurity.py index 402bcc3..baaf71b 100644 --- a/examples/python/DbIpSecurity.py +++ b/examples/python/DbIpSecurity.py @@ -15,7 +15,7 @@ api = whoisfreaks.DatabasesIPSecurityApi(client) # db_ip_security parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_security(date(2026, 10, 1)) # the file's raw bytes path = "DbIpSecurity.csv" with open(path, "wb") as f: diff --git a/examples/python/DbIpWhois.py b/examples/python/DbIpWhois.py index e502bb4..bb36069 100644 --- a/examples/python/DbIpWhois.py +++ b/examples/python/DbIpWhois.py @@ -15,7 +15,7 @@ api = whoisfreaks.DatabasesIPWHOISApi(client) # db_ip_whois parameters: - # var_date (datetime.date, required) + # var_date (datetime.date, required): The day whose file you want, in YYYY-MM-DD format data = api.db_ip_whois(date(2026, 10, 1)) # the file's raw bytes path = "DbIpWhois.json.gz" with open(path, "wb") as f: diff --git a/examples/python/DbNewlyCctld.py b/examples/python/DbNewlyCctld.py index 668a5ea..48e60f5 100644 --- a/examples/python/DbNewlyCctld.py +++ b/examples/python/DbNewlyCctld.py @@ -15,9 +15,9 @@ api = whoisfreaks.DatabasesNewlyRegisteredApi(client) # db_newly_cctld parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... data = api.db_newly_cctld(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbNewlyCctld.csv" with open(path, "wb") as f: diff --git a/examples/python/DbNewlyCctldJson.py b/examples/python/DbNewlyCctldJson.py index ab8ca4f..a114efe 100644 --- a/examples/python/DbNewlyCctldJson.py +++ b/examples/python/DbNewlyCctldJson.py @@ -16,7 +16,7 @@ # db_newly_cctld_json parameters: # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... domains = api.db_newly_cctld_json(var_date=date(2026, 10, 1)) print(f"{len(domains)} domains") print("\n".join(domains[:10])) diff --git a/examples/python/DbNewlyGtld.py b/examples/python/DbNewlyGtld.py index ccfc874..cd88cc7 100644 --- a/examples/python/DbNewlyGtld.py +++ b/examples/python/DbNewlyGtld.py @@ -15,9 +15,9 @@ api = whoisfreaks.DatabasesNewlyRegisteredApi(client) # db_newly_gtld parameters: - # whois (bool, required) + # whois (bool, required): Set true for the file with full WHOIS records, false for domain names only # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... data = api.db_newly_gtld(True, var_date=date(2026, 10, 1)) # the file's raw bytes path = "DbNewlyGtld.csv" with open(path, "wb") as f: diff --git a/examples/python/DbNewlyGtldJson.py b/examples/python/DbNewlyGtldJson.py index c7d7fe8..b184d5d 100644 --- a/examples/python/DbNewlyGtldJson.py +++ b/examples/python/DbNewlyGtldJson.py @@ -16,7 +16,7 @@ # db_newly_gtld_json parameters: # var_date (datetime.date, optional, keyword): yyyy-MM-dd; omit for latest - # tlds (str, optional, keyword) + # tlds (str, optional, keyword): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... domains = api.db_newly_gtld_json(var_date=date(2026, 10, 1)) print(f"{len(domains)} domains") print("\n".join(domains[:10])) diff --git a/examples/python/DnsBulk.py b/examples/python/DnsBulk.py index 5d36c42..0fabe57 100644 --- a/examples/python/DnsBulk.py +++ b/examples/python/DnsBulk.py @@ -15,9 +15,9 @@ api = whoisfreaks.DNSApi(client) # dns_bulk parameters: - # type (str, required): default "all" + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" # dns_bulk_request (DnsBulkRequest, required): request body - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" body = whoisfreaks.DnsBulkRequest(domain_names=["whoisfreaks.com", "example.com"]) result = api.dns_bulk("A,MX,TXT", body) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DnsHistorical.py b/examples/python/DnsHistorical.py index 493f89f..79de218 100644 --- a/examples/python/DnsHistorical.py +++ b/examples/python/DnsHistorical.py @@ -15,9 +15,9 @@ api = whoisfreaks.DNSApi(client) # dns_historical parameters: - # domain_name (str, required) - # type (str, required): default "all" - # page (int, optional, keyword): default 1 - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_historical("whoisfreaks.com", "A,MX,TXT", page=1) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DnsHistoricalV22.py b/examples/python/DnsHistoricalV22.py index 9bff505..740e9c5 100644 --- a/examples/python/DnsHistoricalV22.py +++ b/examples/python/DnsHistoricalV22.py @@ -15,11 +15,11 @@ api = whoisfreaks.DNSApi(client) # dns_historical_v22 parameters: - # domain_name (str, required) - # type (str, required): default "all" - # page (int, optional, keyword): default 1 + # domain_name (str, required): Domain to look up + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_historical_v22("whoisfreaks.com", "A,MX,TXT", page=1) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DnsHistoricalV23.py b/examples/python/DnsHistoricalV23.py index f535e39..f01c1e9 100644 --- a/examples/python/DnsHistoricalV23.py +++ b/examples/python/DnsHistoricalV23.py @@ -15,11 +15,11 @@ api = whoisfreaks.DNSApi(client) # dns_historical_v23 parameters: - # domain_name (str, required) - # type (str, required): default "all" - # page (int, optional, keyword): default 1 + # domain_name (str, required): Domain to look up + # type (str, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_historical_v23("whoisfreaks.com", "A,MX,TXT", page=1) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DnsLive.py b/examples/python/DnsLive.py index 30b6780..7cc9341 100644 --- a/examples/python/DnsLive.py +++ b/examples/python/DnsLive.py @@ -16,8 +16,8 @@ # dns_live parameters: # type (str, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME; default "all" - # domain_name (str, optional, keyword) + # domain_name (str, optional, keyword): Domain to look up # ip_address (str, optional, keyword): Use for PTR lookups - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_live("A,MX,TXT", domain_name="whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DnsReverse.py b/examples/python/DnsReverse.py index d443464..f47e6ae 100644 --- a/examples/python/DnsReverse.py +++ b/examples/python/DnsReverse.py @@ -16,9 +16,9 @@ # dns_reverse parameters: # value (str, required): IP, CIDR, or record value - # type (str, required): one of a, mx, cname, ns, aaaa, txt, soa - # exact (bool, optional, keyword): default True - # page (int, optional, keyword): default 1 - # format (str, optional, keyword): one of json, xml; default "json" + # type (str, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa + # exact (bool, optional, keyword): Set true to match value exactly. Defaults to false, where value is treated as...; default False + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_reverse("8.8.8.8", "a", page=1) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DnsReverseV22.py b/examples/python/DnsReverseV22.py index 9c4b94a..ce8f838 100644 --- a/examples/python/DnsReverseV22.py +++ b/examples/python/DnsReverseV22.py @@ -16,11 +16,11 @@ # dns_reverse_v22 parameters: # value (str, required): IP, CIDR, or record value - # type (str, required): one of a, mx, cname, ns, aaaa, txt, soa + # type (str, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa # exact (bool, optional, keyword): When false the value is matched as a substring, which is far slower than an e...; default True - # page (int, optional, keyword): default 1 + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_reverse_v22("8.8.8.8", "a", page=1) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DnsReverseV23.py b/examples/python/DnsReverseV23.py index b0431f1..1379517 100644 --- a/examples/python/DnsReverseV23.py +++ b/examples/python/DnsReverseV23.py @@ -16,11 +16,11 @@ # dns_reverse_v23 parameters: # value (str, required): IP, CIDR, or record value - # type (str, required): one of a, mx, cname, ns, aaaa, txt, soa + # type (str, required): DNS record type to search by; one of a, mx, cname, ns, aaaa, txt, soa # exact (bool, optional, keyword): When false the value is matched as a substring, which is far slower than an e...; default True - # page (int, optional, keyword): default 1 + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 # sort (str, optional, keyword): Sort direction. Omit to leave the results unsorted; one of asc, desc # sort_by (str, optional, keyword): Field to sort on. Only applies when sort is given; one of firstSeen, lastSeen; default "lastSeen" - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.dns_reverse_v23("8.8.8.8", "a", page=1) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DomainAvailabilityV2.py b/examples/python/DomainAvailabilityV2.py index 819a388..c16c9d7 100644 --- a/examples/python/DomainAvailabilityV2.py +++ b/examples/python/DomainAvailabilityV2.py @@ -18,6 +18,6 @@ # domain (str, required): The domain name to check # sug (bool, optional, keyword): Whether to return TLD suggestions alongside the queried domain; default False # count (int, optional, keyword): Number of TLD suggestions to return when sug=true. Maximum is 100; default 5 - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.domain_availability_v2("google.com", sug=True, count=5) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/DomainReputation.py b/examples/python/DomainReputation.py index 2278cfd..2771b0b 100644 --- a/examples/python/DomainReputation.py +++ b/examples/python/DomainReputation.py @@ -16,6 +16,6 @@ # domain_reputation parameters: # domain_name (str, required): The domain name to assess - # format (str, optional, keyword): one of json, xml; default "json" + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.domain_reputation("amazon.com") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/Geolocation.py b/examples/python/Geolocation.py index ec4bc76..405c414 100644 --- a/examples/python/Geolocation.py +++ b/examples/python/Geolocation.py @@ -15,6 +15,6 @@ api = whoisfreaks.GeolocationApi(client) # geolocation parameters: - # ip (str, required) + # ip (str, required): IP address to look up result = api.geolocation("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/IpReputation.py b/examples/python/IpReputation.py index c5d47ec..82b0cd6 100644 --- a/examples/python/IpReputation.py +++ b/examples/python/IpReputation.py @@ -15,6 +15,6 @@ api = whoisfreaks.IPReputationApi(client) # ip_reputation parameters: - # ip (str, required) + # ip (str, required): IP address to look up result = api.ip_reputation("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/IpReputationV2.py b/examples/python/IpReputationV2.py index 8a21d65..fddb6e4 100644 --- a/examples/python/IpReputationV2.py +++ b/examples/python/IpReputationV2.py @@ -15,6 +15,6 @@ api = whoisfreaks.IPReputationApi(client) # ip_reputation_v2 parameters: - # ip (str, required) + # ip (str, required): IP address to look up result = api.ip_reputation_v2("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/IpWhois.py b/examples/python/IpWhois.py index 44dde04..1008d06 100644 --- a/examples/python/IpWhois.py +++ b/examples/python/IpWhois.py @@ -15,7 +15,7 @@ api = whoisfreaks.IPWHOISApi(client) # ip_whois parameters: - # ip (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # ip (str, required): IP address to look up + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.ip_whois("8.8.8.8") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/README.md b/examples/python/README.md index f49b822..9f84383 100644 --- a/examples/python/README.md +++ b/examples/python/README.md @@ -24,6 +24,7 @@ Install: see the [Python guide](../../docs/languages/python.md). Set the `WHOISF ## Typosquatting - [`Typosquatting.py`](Typosquatting.py): Typosquatting Lookup (`GET /v3.0/domain/typos`) +- [`SubdomainTyposquatting.py`](SubdomainTyposquatting.py): Subdomain Typosquatting Lookup (`GET /v3.0/subdomains/typos`) ## SSL - [`SslLookup.py`](SslLookup.py): SSL Certificate Lookup (`GET /v1.0/ssl/live`) diff --git a/examples/python/SslLookup.py b/examples/python/SslLookup.py index 44cad6f..9069c82 100644 --- a/examples/python/SslLookup.py +++ b/examples/python/SslLookup.py @@ -15,9 +15,9 @@ api = whoisfreaks.SSLApi(client) # ssl_lookup parameters: - # domain_name (str, required) - # chain (bool, optional, keyword): default False - # ssl_raw (bool, optional, keyword): default False - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # chain (bool, optional, keyword): Set true to return the full certificate chain, ordered from the end-user cert...; default False + # ssl_raw (bool, optional, keyword): Set true to include the raw OpenSSL response for the domain. Defaults to false; default False + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.ssl_lookup("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/SubdomainTyposquatting.py b/examples/python/SubdomainTyposquatting.py new file mode 100644 index 0000000..09e0deb --- /dev/null +++ b/examples/python/SubdomainTyposquatting.py @@ -0,0 +1,23 @@ +"""Subdomain Typosquatting Lookup: GET https://api.whoisfreaks.com/v3.0/subdomains/typos + +Run it with your API key in the environment: + WHOISFREAKS_API_KEY=your_api_key python SubdomainTyposquatting.py +""" +import json +import os + +import whoisfreaks + +config = whoisfreaks.Configuration() +config.api_key["ApiKeyAuth"] = os.environ["WHOISFREAKS_API_KEY"] # set once for every request + +with whoisfreaks.ApiClient(config) as client: + api = whoisfreaks.TyposquattingApi(client) + + # subdomain_typosquatting parameters: + # keyword (str, optional, keyword): Brand or label to find typo variants for. 3 to 63 characters, letters, digits... + # pattern (str, optional, keyword): Wildcard search string, where '*' matches any characters and '?' matches one.... + # page_token (str, optional, keyword): Token from nextPageToken in the previous response, needed from page 2 onward.... + # fetch_size (int, optional, keyword): Subdomains per page. 100 when the parameter is left out, and values above 100...; default 100 + result = api.subdomain_typosquatting() + print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/Subdomains.py b/examples/python/Subdomains.py index d8b2a66..92e3b94 100644 --- a/examples/python/Subdomains.py +++ b/examples/python/Subdomains.py @@ -15,11 +15,11 @@ api = whoisfreaks.SubdomainsApi(client) # subdomains parameters: - # domain (str, required) - # after (datetime.date, optional, keyword) - # before (datetime.date, optional, keyword) - # status (str, optional, keyword): one of active, inactive - # page (int, optional, keyword): default 1 - # format (str, optional, keyword): one of json, xml; default "json" + # domain (str, required): Domain whose subdomains you want + # after (datetime.date, optional, keyword): Only return records created after this date, in YYYY-MM-DD format. Defaults t... + # before (datetime.date, optional, keyword): Only return records created before this date, in YYYY-MM-DD format. Defaults ... + # status (str, optional, keyword): Limit results to active or inactive subdomains. Both are returned when the pa...; one of active, inactive + # page (int, optional, keyword): Page of results to return. Defaults to 1; default 1 + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.subdomains("whoisfreaks.com", page=1) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/Typosquatting.py b/examples/python/Typosquatting.py index 7b34c3a..fd1ea14 100644 --- a/examples/python/Typosquatting.py +++ b/examples/python/Typosquatting.py @@ -15,8 +15,8 @@ api = whoisfreaks.TyposquattingApi(client) # typosquatting parameters: - # keyword (str, optional, keyword) - # pattern (str, optional, keyword) - # page_token (str, optional, keyword) + # keyword (str, optional, keyword): Brand or label to find typo variants for. Pass either keyword or pattern, not... + # pattern (str, optional, keyword): Wildcard search string, where '*' matches any characters. Pass either keyword... + # page_token (str, optional, keyword): Token from nextPageToken in the previous response, needed from page 2 onward.... result = api.typosquatting(keyword="whoisfreaks") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/WhoisHistory.py b/examples/python/WhoisHistory.py index b4bbacc..ba843d5 100644 --- a/examples/python/WhoisHistory.py +++ b/examples/python/WhoisHistory.py @@ -16,6 +16,6 @@ # whois_history parameters: # domain_name (str, required): Domain to fetch historical WHOIS records for - # format (str, optional, keyword): one of json, xml + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml result = api.whois_history("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/WhoisLive.py b/examples/python/WhoisLive.py index 8595e69..db670b3 100644 --- a/examples/python/WhoisLive.py +++ b/examples/python/WhoisLive.py @@ -15,7 +15,7 @@ api = whoisfreaks.WHOISApi(client) # whois_live parameters: - # domain_name (str, required) - # format (str, optional, keyword): one of json, xml; default "json" + # domain_name (str, required): Domain to look up + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml; default "json" result = api.whois_live("whoisfreaks.com") print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/python/WhoisReverse.py b/examples/python/WhoisReverse.py index 2d84b15..c83a54a 100644 --- a/examples/python/WhoisReverse.py +++ b/examples/python/WhoisReverse.py @@ -17,6 +17,6 @@ # whois_reverse parameters: # keyword (str, required): Keyword to search across WHOIS records # page (int, optional, keyword): Page number - # format (str, optional, keyword): one of json, xml + # format (str, optional, keyword): Response format. JSON when the parameter is left out; one of json, xml result = api.whois_reverse("whoisfreaks", page=1) print(json.dumps(result.to_dict(), indent=2)) diff --git a/examples/ruby/AsnWhois.rb b/examples/ruby/AsnWhois.rb index 3fcd028..2483944 100644 --- a/examples/ruby/AsnWhois.rb +++ b/examples/ruby/AsnWhois.rb @@ -1,8 +1,8 @@ # ASN WHOIS Lookup # # Parameters for asnWhois (GET /v2.0/asn-whois): -# - asn (string, required) -# - format (string (one of: json, xml), optional) +# - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/BulkDomainAvailabilityV2.rb b/examples/ruby/BulkDomainAvailabilityV2.rb index 87b1fd2..55f0cc7 100644 --- a/examples/ruby/BulkDomainAvailabilityV2.rb +++ b/examples/ruby/BulkDomainAvailabilityV2.rb @@ -2,7 +2,7 @@ # # Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): # - domain (string, optional): Required for TLD-mode bulk check (base domain). -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. # - body: BulkDomainAvailabilityRequest (required): request body object require "json" diff --git a/examples/ruby/BulkWhois.rb b/examples/ruby/BulkWhois.rb index 6c75786..34bafe1 100644 --- a/examples/ruby/BulkWhois.rb +++ b/examples/ruby/BulkWhois.rb @@ -1,7 +1,7 @@ # Bulk WHOIS Lookup # # Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. # - body: BulkWhoisRequest (required): request body object require "json" diff --git a/examples/ruby/DbAsnWhois.rb b/examples/ruby/DbAsnWhois.rb index a7a5f65..93da96a 100644 --- a/examples/ruby/DbAsnWhois.rb +++ b/examples/ruby/DbAsnWhois.rb @@ -1,7 +1,7 @@ # ASN WHOIS Snapshot # # Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" diff --git a/examples/ruby/DbDropped.rb b/examples/ruby/DbDropped.rb index 34f199f..cf1f288 100644 --- a/examples/ruby/DbDropped.rb +++ b/examples/ruby/DbDropped.rb @@ -1,7 +1,7 @@ # Dropped Domains # # Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -# - whois (boolean, required) +# - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest require "date" diff --git a/examples/ruby/DbDroppedBacklinks.rb b/examples/ruby/DbDroppedBacklinks.rb index 73303dc..abf3c6b 100644 --- a/examples/ruby/DbDroppedBacklinks.rb +++ b/examples/ruby/DbDroppedBacklinks.rb @@ -1,7 +1,7 @@ # Dropped With Backlinks # # Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -# - whois (boolean, optional) +# - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest require "date" diff --git a/examples/ruby/DbDroppedJson.rb b/examples/ruby/DbDroppedJson.rb index f83a2a6..1caf16e 100644 --- a/examples/ruby/DbDroppedJson.rb +++ b/examples/ruby/DbDroppedJson.rb @@ -2,7 +2,7 @@ # # Parameters for dbDroppedJson (GET /v3.1/domains/dropped): # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "whoisfreaks" diff --git a/examples/ruby/DbExpired.rb b/examples/ruby/DbExpired.rb index b270c77..4cd7dd4 100644 --- a/examples/ruby/DbExpired.rb +++ b/examples/ruby/DbExpired.rb @@ -1,7 +1,7 @@ # Expiring Domains # # Parameters for dbExpired (GET /v3.1/download/domainer/expired): -# - whois (boolean, required) +# - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest require "date" diff --git a/examples/ruby/DbIpCity.rb b/examples/ruby/DbIpCity.rb index 6968864..0ef2c4f 100644 --- a/examples/ruby/DbIpCity.rb +++ b/examples/ruby/DbIpCity.rb @@ -1,7 +1,7 @@ # IP to City Snapshot # # Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" diff --git a/examples/ruby/DbIpCountry.rb b/examples/ruby/DbIpCountry.rb index aff1ed0..e0f864f 100644 --- a/examples/ruby/DbIpCountry.rb +++ b/examples/ruby/DbIpCountry.rb @@ -1,7 +1,7 @@ # IP to Country Snapshot # # Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" diff --git a/examples/ruby/DbIpSecurity.rb b/examples/ruby/DbIpSecurity.rb index 351b3dd..e3b7f34 100644 --- a/examples/ruby/DbIpSecurity.rb +++ b/examples/ruby/DbIpSecurity.rb @@ -1,7 +1,7 @@ # IP Security Snapshot # # Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" diff --git a/examples/ruby/DbIpWhois.rb b/examples/ruby/DbIpWhois.rb index b9dabf6..7d1cc11 100644 --- a/examples/ruby/DbIpWhois.rb +++ b/examples/ruby/DbIpWhois.rb @@ -1,7 +1,7 @@ # IP WHOIS Snapshot # # Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -# - date (string, required) +# - date (string, required): The day whose file you want, in YYYY-MM-DD format. require "date" require "fileutils" diff --git a/examples/ruby/DbNewlyCctld.rb b/examples/ruby/DbNewlyCctld.rb index fe2b679..13777b4 100644 --- a/examples/ruby/DbNewlyCctld.rb +++ b/examples/ruby/DbNewlyCctld.rb @@ -1,9 +1,9 @@ # Newly Registered ccTLD (CSV) # # Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -# - whois (boolean, required) +# - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "fileutils" diff --git a/examples/ruby/DbNewlyCctldJson.rb b/examples/ruby/DbNewlyCctldJson.rb index 90f83cc..cd82c86 100644 --- a/examples/ruby/DbNewlyCctldJson.rb +++ b/examples/ruby/DbNewlyCctldJson.rb @@ -2,7 +2,7 @@ # # Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "whoisfreaks" diff --git a/examples/ruby/DbNewlyGtld.rb b/examples/ruby/DbNewlyGtld.rb index b0352af..0fb2383 100644 --- a/examples/ruby/DbNewlyGtld.rb +++ b/examples/ruby/DbNewlyGtld.rb @@ -1,9 +1,9 @@ # Newly Registered gTLD (CSV) # # Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -# - whois (boolean, required) +# - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "fileutils" diff --git a/examples/ruby/DbNewlyGtldJson.rb b/examples/ruby/DbNewlyGtldJson.rb index 87a29eb..6580cb0 100644 --- a/examples/ruby/DbNewlyGtldJson.rb +++ b/examples/ruby/DbNewlyGtldJson.rb @@ -2,7 +2,7 @@ # # Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): # - date (string, optional): yyyy-MM-dd; omit for latest -# - tlds (string, optional) +# - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... require "date" require "whoisfreaks" diff --git a/examples/ruby/DnsBulk.rb b/examples/ruby/DnsBulk.rb index 2c574b2..a7780e7 100644 --- a/examples/ruby/DnsBulk.rb +++ b/examples/ruby/DnsBulk.rb @@ -1,8 +1,8 @@ # Bulk DNS Lookup # # Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -# - type (string, required) -# - format (string (one of: json, xml), optional) +# - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. # - body: DnsBulkRequest (required): request body object require "json" diff --git a/examples/ruby/DnsHistorical.rb b/examples/ruby/DnsHistorical.rb index 1df1600..1958c62 100644 --- a/examples/ruby/DnsHistorical.rb +++ b/examples/ruby/DnsHistorical.rb @@ -1,10 +1,10 @@ # Historical DNS Lookup # # Parameters for dnsHistorical (GET /v2.0/dns/historical): -# - domain_name (string, required) -# - type (string, required) -# - page (integer, optional) -# - format (string (one of: json, xml), optional) +# - domain_name (string, required): Domain to look up. +# - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +# - page (integer, optional): Page of results to return. Defaults to 1. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/DnsHistoricalV22.rb b/examples/ruby/DnsHistoricalV22.rb index 5051f9f..03a36b7 100644 --- a/examples/ruby/DnsHistoricalV22.rb +++ b/examples/ruby/DnsHistoricalV22.rb @@ -1,12 +1,12 @@ # Historical DNS Lookup (v2.2) # # Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -# - domain_name (string, required) -# - type (string, required) -# - page (integer, optional) +# - domain_name (string, required): Domain to look up. +# - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +# - page (integer, optional): Page of results to return. Defaults to 1. # - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. # - sort_by (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/DnsHistoricalV23.rb b/examples/ruby/DnsHistoricalV23.rb index 1cabf3c..4889f1e 100644 --- a/examples/ruby/DnsHistoricalV23.rb +++ b/examples/ruby/DnsHistoricalV23.rb @@ -1,12 +1,12 @@ # Historical DNS Lookup (v2.3) # # Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -# - domain_name (string, required) -# - type (string, required) -# - page (integer, optional) +# - domain_name (string, required): Domain to look up. +# - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +# - page (integer, optional): Page of results to return. Defaults to 1. # - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. # - sort_by (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/DnsLive.rb b/examples/ruby/DnsLive.rb index aef06ad..7c6c295 100644 --- a/examples/ruby/DnsLive.rb +++ b/examples/ruby/DnsLive.rb @@ -1,10 +1,10 @@ # Live DNS Lookup # # Parameters for dnsLive (GET /v2.0/dns/live): -# - domain_name (string, optional) +# - domain_name (string, optional): Domain to look up. # - ip_address (string, optional): Use for PTR lookups # - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/DnsReverse.rb b/examples/ruby/DnsReverse.rb index 17face8..5cebdc2 100644 --- a/examples/ruby/DnsReverse.rb +++ b/examples/ruby/DnsReverse.rb @@ -2,10 +2,10 @@ # # Parameters for dnsReverse (GET /v2.1/dns/reverse): # - value (string, required): IP, CIDR, or record value -# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -# - exact (boolean, optional) -# - page (integer, optional) -# - format (string (one of: json, xml), optional) +# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +# - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +# - page (integer, optional): Page of results to return. Defaults to 1. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/DnsReverseV22.rb b/examples/ruby/DnsReverseV22.rb index 0bc0250..58a5a29 100644 --- a/examples/ruby/DnsReverseV22.rb +++ b/examples/ruby/DnsReverseV22.rb @@ -2,12 +2,12 @@ # # Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): # - value (string, required): IP, CIDR, or record value -# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. # - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -# - page (integer, optional) +# - page (integer, optional): Page of results to return. Defaults to 1. # - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. # - sort_by (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/DnsReverseV23.rb b/examples/ruby/DnsReverseV23.rb index 3a72f15..712da19 100644 --- a/examples/ruby/DnsReverseV23.rb +++ b/examples/ruby/DnsReverseV23.rb @@ -2,12 +2,12 @@ # # Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): # - value (string, required): IP, CIDR, or record value -# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +# - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. # - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -# - page (integer, optional) +# - page (integer, optional): Page of results to return. Defaults to 1. # - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. # - sort_by (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/DomainAvailabilityV2.rb b/examples/ruby/DomainAvailabilityV2.rb index d6f8fb8..0679b8b 100644 --- a/examples/ruby/DomainAvailabilityV2.rb +++ b/examples/ruby/DomainAvailabilityV2.rb @@ -4,7 +4,7 @@ # - domain (string, required): The domain name to check # - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. # - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/DomainReputation.rb b/examples/ruby/DomainReputation.rb index 9735be5..b8180e8 100644 --- a/examples/ruby/DomainReputation.rb +++ b/examples/ruby/DomainReputation.rb @@ -2,7 +2,7 @@ # # Parameters for domainReputation (GET /v1/domain/security): # - domain_name (string, required): The domain name to assess -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/Geolocation.rb b/examples/ruby/Geolocation.rb index 25972f5..62b83b9 100644 --- a/examples/ruby/Geolocation.rb +++ b/examples/ruby/Geolocation.rb @@ -1,7 +1,7 @@ # IP Geolocation Lookup # # Parameters for geolocation (GET /v1.0/geolocation): -# - ip (string, required) +# - ip (string, required): IP address to look up. require "json" require "whoisfreaks" diff --git a/examples/ruby/IpReputation.rb b/examples/ruby/IpReputation.rb index 9fa8c51..058d6af 100644 --- a/examples/ruby/IpReputation.rb +++ b/examples/ruby/IpReputation.rb @@ -1,7 +1,7 @@ # IP Reputation Lookup # # Parameters for ipReputation (GET /v1.0/security): -# - ip (string, required) +# - ip (string, required): IP address to look up. require "json" require "whoisfreaks" diff --git a/examples/ruby/IpReputationV2.rb b/examples/ruby/IpReputationV2.rb index fa7193f..bb0a936 100644 --- a/examples/ruby/IpReputationV2.rb +++ b/examples/ruby/IpReputationV2.rb @@ -1,7 +1,7 @@ # IP Reputation Lookup (v2.0) # # Parameters for ipReputationV2 (GET /v2.0/security): -# - ip (string, required) +# - ip (string, required): IP address to look up. require "json" require "whoisfreaks" diff --git a/examples/ruby/IpWhois.rb b/examples/ruby/IpWhois.rb index f357fd5..42c1ff5 100644 --- a/examples/ruby/IpWhois.rb +++ b/examples/ruby/IpWhois.rb @@ -1,8 +1,8 @@ # IP WHOIS Lookup # # Parameters for ipWhois (GET /v1.0/ip-whois): -# - ip (string, required) -# - format (string (one of: json, xml), optional) +# - ip (string, required): IP address to look up. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/README.md b/examples/ruby/README.md index d146e16..f558f0d 100644 --- a/examples/ruby/README.md +++ b/examples/ruby/README.md @@ -24,6 +24,7 @@ Install: see the [Ruby guide](../../docs/languages/ruby.md). Set the `WHOISFREAK ## Typosquatting - [`Typosquatting.rb`](Typosquatting.rb): Typosquatting Lookup (`GET /v3.0/domain/typos`) +- [`SubdomainTyposquatting.rb`](SubdomainTyposquatting.rb): Subdomain Typosquatting Lookup (`GET /v3.0/subdomains/typos`) ## SSL - [`SslLookup.rb`](SslLookup.rb): SSL Certificate Lookup (`GET /v1.0/ssl/live`) diff --git a/examples/ruby/SslLookup.rb b/examples/ruby/SslLookup.rb index 8af23e3..b679df6 100644 --- a/examples/ruby/SslLookup.rb +++ b/examples/ruby/SslLookup.rb @@ -1,10 +1,10 @@ # SSL Certificate Lookup # # Parameters for sslLookup (GET /v1.0/ssl/live): -# - domain_name (string, required) -# - chain (boolean, optional) -# - ssl_raw (boolean, optional) -# - format (string (one of: json, xml), optional) +# - domain_name (string, required): Domain to look up. +# - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +# - ssl_raw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/SubdomainTyposquatting.rb b/examples/ruby/SubdomainTyposquatting.rb new file mode 100644 index 0000000..8b0e5c0 --- /dev/null +++ b/examples/ruby/SubdomainTyposquatting.rb @@ -0,0 +1,25 @@ +# Subdomain Typosquatting Lookup +# +# Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +# - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +# - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +# - page_token (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +# - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... + +require "json" +require "whoisfreaks" + +# Read the API key from the environment and set it once. +WhoisFreaks.configure do |config| + config.api_key["apiKey"] = ENV.fetch("WHOISFREAKS_API_KEY") +end + +api = WhoisFreaks::TyposquattingApi.new + +begin + result = api.subdomain_typosquatting(keyword: "paypal") + puts JSON.pretty_generate(result.to_hash) +rescue WhoisFreaks::ApiError => e + warn "Request failed: HTTP #{e.code} #{e.response_body}" + exit 1 +end diff --git a/examples/ruby/Subdomains.rb b/examples/ruby/Subdomains.rb index 284a9cc..50c5084 100644 --- a/examples/ruby/Subdomains.rb +++ b/examples/ruby/Subdomains.rb @@ -1,12 +1,12 @@ # Subdomains Lookup # # Parameters for subdomains (GET /v1.0/subdomains): -# - domain (string, required) -# - after (string, optional) -# - before (string, optional) -# - status (string (one of: active, inactive), optional) -# - page (integer, optional) -# - format (string (one of: json, xml), optional) +# - domain (string, required): Domain whose subdomains you want. +# - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +# - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +# - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +# - page (integer, optional): Page of results to return. Defaults to 1. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/Typosquatting.rb b/examples/ruby/Typosquatting.rb index 0c09db3..955f91e 100644 --- a/examples/ruby/Typosquatting.rb +++ b/examples/ruby/Typosquatting.rb @@ -1,9 +1,9 @@ # Typosquatting Lookup # # Parameters for typosquatting (GET /v3.0/domain/typos): -# - keyword (string, optional) -# - pattern (string, optional) -# - page_token (string, optional) +# - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +# - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +# - page_token (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... require "json" require "whoisfreaks" diff --git a/examples/ruby/WhoisHistory.rb b/examples/ruby/WhoisHistory.rb index 1fafe17..4b8c296 100644 --- a/examples/ruby/WhoisHistory.rb +++ b/examples/ruby/WhoisHistory.rb @@ -2,7 +2,7 @@ # # Parameters for whoisHistory (GET /v2.0/whois/history): # - domain_name (string, required): Domain to fetch historical WHOIS records for -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/WhoisLive.rb b/examples/ruby/WhoisLive.rb index 8f80421..64452b6 100644 --- a/examples/ruby/WhoisLive.rb +++ b/examples/ruby/WhoisLive.rb @@ -1,8 +1,8 @@ # Live WHOIS Lookup # # Parameters for whoisLive (GET /v2.0/whois/live): -# - domain_name (string, required) -# - format (string (one of: json, xml), optional) +# - domain_name (string, required): Domain to look up. +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/ruby/WhoisReverse.rb b/examples/ruby/WhoisReverse.rb index 019709d..43ccfb8 100644 --- a/examples/ruby/WhoisReverse.rb +++ b/examples/ruby/WhoisReverse.rb @@ -3,7 +3,7 @@ # Parameters for whoisReverse (GET /v2.0/whois/reverse): # - keyword (string, required): Keyword to search across WHOIS records # - page (integer, optional): Page number -# - format (string (one of: json, xml), optional) +# - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. require "json" require "whoisfreaks" diff --git a/examples/swift/AsnWhois.swift b/examples/swift/AsnWhois.swift index 04407d6..8d36ec1 100644 --- a/examples/swift/AsnWhois.swift +++ b/examples/swift/AsnWhois.swift @@ -1,8 +1,8 @@ // ASN WHOIS Lookup // // Parameters for asnWhois (GET /v2.0/asn-whois): -// - asn (string, required) -// - format (string (one of: json, xml), optional) +// - asn (string, required): Autonomous system number to look up, with or without the AS prefix. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/BulkDomainAvailabilityV2.swift b/examples/swift/BulkDomainAvailabilityV2.swift index bb5d76c..be10e46 100644 --- a/examples/swift/BulkDomainAvailabilityV2.swift +++ b/examples/swift/BulkDomainAvailabilityV2.swift @@ -2,7 +2,7 @@ // // Parameters for bulkDomainAvailabilityV2 (POST /v2.0/domain/availability): // - domain (string, optional): Required for TLD-mode bulk check (base domain). -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkDomainAvailabilityRequest (required): request body object // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/BulkWhois.swift b/examples/swift/BulkWhois.swift index ca3b2f6..ad10b76 100644 --- a/examples/swift/BulkWhois.swift +++ b/examples/swift/BulkWhois.swift @@ -1,7 +1,7 @@ // Bulk WHOIS Lookup // // Parameters for bulkWhois (POST /v2.0/bulkwhois/live): -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: BulkWhoisRequest (required): request body object // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbAsnWhois.swift b/examples/swift/DbAsnWhois.swift index 2ac1e58..062969c 100644 --- a/examples/swift/DbAsnWhois.swift +++ b/examples/swift/DbAsnWhois.swift @@ -1,7 +1,7 @@ // ASN WHOIS Snapshot // // Parameters for dbAsnWhois (GET /v3.3/download/snapshot/asn/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbDropped.swift b/examples/swift/DbDropped.swift index 1031edb..933e238 100644 --- a/examples/swift/DbDropped.swift +++ b/examples/swift/DbDropped.swift @@ -1,7 +1,7 @@ // Dropped Domains // // Parameters for dbDropped (GET /v3.1/download/domainer/dropped): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbDroppedBacklinks.swift b/examples/swift/DbDroppedBacklinks.swift index 882447e..c31edec 100644 --- a/examples/swift/DbDroppedBacklinks.swift +++ b/examples/swift/DbDroppedBacklinks.swift @@ -1,7 +1,7 @@ // Dropped With Backlinks // // Parameters for dbDroppedBacklinks (GET /v3.3/download/domainer/dropped/backlinks): -// - whois (boolean, optional) +// - whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbDroppedJson.swift b/examples/swift/DbDroppedJson.swift index 7350248..92296f9 100644 --- a/examples/swift/DbDroppedJson.swift +++ b/examples/swift/DbDroppedJson.swift @@ -2,7 +2,7 @@ // // Parameters for dbDroppedJson (GET /v3.1/domains/dropped): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbExpired.swift b/examples/swift/DbExpired.swift index 980a0f0..d9596ed 100644 --- a/examples/swift/DbExpired.swift +++ b/examples/swift/DbExpired.swift @@ -1,7 +1,7 @@ // Expiring Domains // // Parameters for dbExpired (GET /v3.1/download/domainer/expired): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbIpCity.swift b/examples/swift/DbIpCity.swift index 7931272..ba6d0f6 100644 --- a/examples/swift/DbIpCity.swift +++ b/examples/swift/DbIpCity.swift @@ -1,7 +1,7 @@ // IP to City Snapshot // // Parameters for dbIpCity (GET /v3.3/download/snapshot/ip/city): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbIpCountry.swift b/examples/swift/DbIpCountry.swift index 6dff5a8..64f88a5 100644 --- a/examples/swift/DbIpCountry.swift +++ b/examples/swift/DbIpCountry.swift @@ -1,7 +1,7 @@ // IP to Country Snapshot // // Parameters for dbIpCountry (GET /v3.3/download/snapshot/ip/country): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbIpSecurity.swift b/examples/swift/DbIpSecurity.swift index 70a3881..b9030ee 100644 --- a/examples/swift/DbIpSecurity.swift +++ b/examples/swift/DbIpSecurity.swift @@ -1,7 +1,7 @@ // IP Security Snapshot // // Parameters for dbIpSecurity (GET /v3.3/download/snapshot/ip/security): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbIpWhois.swift b/examples/swift/DbIpWhois.swift index 9f59a70..bc0acf9 100644 --- a/examples/swift/DbIpWhois.swift +++ b/examples/swift/DbIpWhois.swift @@ -1,7 +1,7 @@ // IP WHOIS Snapshot // // Parameters for dbIpWhois (GET /v3.3/download/snapshot/ip/whois): -// - date (string, required) +// - date (string, required): The day whose file you want, in YYYY-MM-DD format. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbNewlyCctld.swift b/examples/swift/DbNewlyCctld.swift index de3d5b3..bc51969 100644 --- a/examples/swift/DbNewlyCctld.swift +++ b/examples/swift/DbNewlyCctld.swift @@ -1,9 +1,9 @@ // Newly Registered ccTLD (CSV) // // Parameters for dbNewlyCctld (GET /v3.1/download/domainer/cctld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbNewlyCctldJson.swift b/examples/swift/DbNewlyCctldJson.swift index f0b875c..534c49d 100644 --- a/examples/swift/DbNewlyCctldJson.swift +++ b/examples/swift/DbNewlyCctldJson.swift @@ -2,7 +2,7 @@ // // Parameters for dbNewlyCctldJson (GET /v3.1/domains/newly/cctld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbNewlyGtld.swift b/examples/swift/DbNewlyGtld.swift index b92bd67..18560dc 100644 --- a/examples/swift/DbNewlyGtld.swift +++ b/examples/swift/DbNewlyGtld.swift @@ -1,9 +1,9 @@ // Newly Registered gTLD (CSV) // // Parameters for dbNewlyGtld (GET /v3.1/download/domainer/gtld): -// - whois (boolean, required) +// - whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only. // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DbNewlyGtldJson.swift b/examples/swift/DbNewlyGtldJson.swift index b10fa9e..eb64da4 100644 --- a/examples/swift/DbNewlyGtldJson.swift +++ b/examples/swift/DbNewlyGtldJson.swift @@ -2,7 +2,7 @@ // // Parameters for dbNewlyGtldJson (GET /v3.1/domains/newly/gtld): // - date (string, optional): yyyy-MM-dd; omit for latest -// - tlds (string, optional) +// - tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is included w... // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DnsBulk.swift b/examples/swift/DnsBulk.swift index c2e5cc5..ebe76c2 100644 --- a/examples/swift/DnsBulk.swift +++ b/examples/swift/DnsBulk.swift @@ -1,8 +1,8 @@ // Bulk DNS Lookup // // Parameters for dnsBulk (POST /v2.0/dns/bulk/live): -// - type (string, required) -// - format (string (one of: json, xml), optional) +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // - body: DnsBulkRequest (required): request body object // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DnsHistorical.swift b/examples/swift/DnsHistorical.swift index f07c469..a9518dd 100644 --- a/examples/swift/DnsHistorical.swift +++ b/examples/swift/DnsHistorical.swift @@ -1,10 +1,10 @@ // Historical DNS Lookup // // Parameters for dnsHistorical (GET /v2.0/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DnsHistoricalV22.swift b/examples/swift/DnsHistoricalV22.swift index 63c4dff..d7e1dc0 100644 --- a/examples/swift/DnsHistoricalV22.swift +++ b/examples/swift/DnsHistoricalV22.swift @@ -1,12 +1,12 @@ // Historical DNS Lookup (v2.2) // // Parameters for dnsHistoricalV22 (GET /v2.2/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DnsHistoricalV23.swift b/examples/swift/DnsHistoricalV23.swift index 90eaccb..9ccd446 100644 --- a/examples/swift/DnsHistoricalV23.swift +++ b/examples/swift/DnsHistoricalV23.swift @@ -1,12 +1,12 @@ // Historical DNS Lookup (v2.3) // // Parameters for dnsHistoricalV23 (GET /v2.3/dns/historical): -// - domainName (string, required) -// - type (string, required) -// - page (integer, optional) +// - domainName (string, required): Domain to look up. +// - type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all. +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DnsLive.swift b/examples/swift/DnsLive.swift index 01655e7..7436b71 100644 --- a/examples/swift/DnsLive.swift +++ b/examples/swift/DnsLive.swift @@ -1,10 +1,10 @@ // Live DNS Lookup // // Parameters for dnsLive (GET /v2.0/dns/live): -// - domainName (string, optional) +// - domainName (string, optional): Domain to look up. // - ipAddress (string, optional): Use for PTR lookups // - type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DnsReverse.swift b/examples/swift/DnsReverse.swift index 1f5cb92..b25a3c3 100644 --- a/examples/swift/DnsReverse.swift +++ b/examples/swift/DnsReverse.swift @@ -2,10 +2,10 @@ // // Parameters for dnsReverse (GET /v2.1/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) -// - exact (boolean, optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. +// - exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as a pattern... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DnsReverseV22.swift b/examples/swift/DnsReverseV22.swift index e0ab524..9d04949 100644 --- a/examples/swift/DnsReverseV22.swift +++ b/examples/swift/DnsReverseV22.swift @@ -2,12 +2,12 @@ // // Parameters for dnsReverseV22 (GET /v2.2/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DnsReverseV23.swift b/examples/swift/DnsReverseV23.swift index 78f8470..10da3d1 100644 --- a/examples/swift/DnsReverseV23.swift +++ b/examples/swift/DnsReverseV23.swift @@ -2,12 +2,12 @@ // // Parameters for dnsReverseV23 (GET /v2.3/dns/reverse): // - value (string, required): IP, CIDR, or record value -// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required) +// - type (string (one of: a, mx, cname, ns, aaaa, txt, soa), required): DNS record type to search by. // - exact (boolean, optional): When false the value is matched as a substring, which is far slower than an exact match... -// - page (integer, optional) +// - page (integer, optional): Page of results to return. Defaults to 1. // - sort (string (one of: asc, desc), optional): Sort direction. Omit to leave the results unsorted. // - sortBy (string (one of: firstSeen, lastSeen), optional): Field to sort on. Only applies when sort is given. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DomainAvailabilityV2.swift b/examples/swift/DomainAvailabilityV2.swift index 9f6e10b..f7609f9 100644 --- a/examples/swift/DomainAvailabilityV2.swift +++ b/examples/swift/DomainAvailabilityV2.swift @@ -4,7 +4,7 @@ // - domain (string, required): The domain name to check // - sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain. // - count (integer, optional): Number of TLD suggestions to return when sug=true. Maximum is 100. -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/DomainReputation.swift b/examples/swift/DomainReputation.swift index 1adc972..aeaaf5f 100644 --- a/examples/swift/DomainReputation.swift +++ b/examples/swift/DomainReputation.swift @@ -2,7 +2,7 @@ // // Parameters for domainReputation (GET /v1/domain/security): // - domainName (string, required): The domain name to assess -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/Geolocation.swift b/examples/swift/Geolocation.swift index 9caec53..4d7e092 100644 --- a/examples/swift/Geolocation.swift +++ b/examples/swift/Geolocation.swift @@ -1,7 +1,7 @@ // IP Geolocation Lookup // // Parameters for geolocation (GET /v1.0/geolocation): -// - ip (string, required) +// - ip (string, required): IP address to look up. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/IpReputation.swift b/examples/swift/IpReputation.swift index 4484c05..f362f4e 100644 --- a/examples/swift/IpReputation.swift +++ b/examples/swift/IpReputation.swift @@ -1,7 +1,7 @@ // IP Reputation Lookup // // Parameters for ipReputation (GET /v1.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/IpReputationV2.swift b/examples/swift/IpReputationV2.swift index 2bbf344..46051cd 100644 --- a/examples/swift/IpReputationV2.swift +++ b/examples/swift/IpReputationV2.swift @@ -1,7 +1,7 @@ // IP Reputation Lookup (v2.0) // // Parameters for ipReputationV2 (GET /v2.0/security): -// - ip (string, required) +// - ip (string, required): IP address to look up. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/IpWhois.swift b/examples/swift/IpWhois.swift index 21bcdd0..60cf87b 100644 --- a/examples/swift/IpWhois.swift +++ b/examples/swift/IpWhois.swift @@ -1,8 +1,8 @@ // IP WHOIS Lookup // // Parameters for ipWhois (GET /v1.0/ip-whois): -// - ip (string, required) -// - format (string (one of: json, xml), optional) +// - ip (string, required): IP address to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/README.md b/examples/swift/README.md index dec8860..0b677fc 100644 --- a/examples/swift/README.md +++ b/examples/swift/README.md @@ -24,6 +24,7 @@ Install: see the [Swift guide](../../docs/languages/swift.md). Set the `WHOISFRE ## Typosquatting - [`Typosquatting.swift`](Typosquatting.swift): Typosquatting Lookup (`GET /v3.0/domain/typos`) +- [`SubdomainTyposquatting.swift`](SubdomainTyposquatting.swift): Subdomain Typosquatting Lookup (`GET /v3.0/subdomains/typos`) ## SSL - [`SslLookup.swift`](SslLookup.swift): SSL Certificate Lookup (`GET /v1.0/ssl/live`) diff --git a/examples/swift/SslLookup.swift b/examples/swift/SslLookup.swift index 79540d1..946d397 100644 --- a/examples/swift/SslLookup.swift +++ b/examples/swift/SslLookup.swift @@ -1,10 +1,10 @@ // SSL Certificate Lookup // // Parameters for sslLookup (GET /v1.0/ssl/live): -// - domainName (string, required) -// - chain (boolean, optional) -// - sslRaw (boolean, optional) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user certificate to... +// - sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/SubdomainTyposquatting.swift b/examples/swift/SubdomainTyposquatting.swift new file mode 100644 index 0000000..83b2a75 --- /dev/null +++ b/examples/swift/SubdomainTyposquatting.swift @@ -0,0 +1,27 @@ +// Subdomain Typosquatting Lookup +// +// Parameters for subdomainTyposquatting (GET /v3.0/subdomains/typos): +// - keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphe... +// - pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one. At most 2... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... +// - fetch_size (integer, optional): Subdomains per page. 100 when the parameter is left out, and values above 10000 are cap... +// +// Top-level code for Sources//main.swift (see Getting Started). + +import Foundation +import WhoisFreaks + +// Read the API key from the environment and set it once. +WhoisFreaksAPI.apiKey = ProcessInfo.processInfo.environment["WHOISFREAKS_API_KEY"] + +do { + let result = try await TyposquattingAPI.subdomainTyposquatting(keyword: "paypal") + print(String(decoding: try CodableHelper.jsonEncoder.encode(result), as: UTF8.self)) +} catch ErrorResponse.error(let status, let data, _, let underlying) { + let body = data.map { String(decoding: $0, as: UTF8.self) } ?? "\(underlying)" + print("Request failed: HTTP \(status) \(body)") + exit(1) +} catch { + print("Request failed: \(error)") + exit(1) +} diff --git a/examples/swift/Subdomains.swift b/examples/swift/Subdomains.swift index 7a18864..8eb6ea1 100644 --- a/examples/swift/Subdomains.swift +++ b/examples/swift/Subdomains.swift @@ -1,12 +1,12 @@ // Subdomains Lookup // // Parameters for subdomains (GET /v1.0/subdomains): -// - domain (string, required) -// - after (string, optional) -// - before (string, optional) -// - status (string (one of: active, inactive), optional) -// - page (integer, optional) -// - format (string (one of: json, xml), optional) +// - domain (string, required): Domain whose subdomains you want. +// - after (string, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults to the olde... +// - before (string, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults to today, ... +// - status (string (one of: active, inactive), optional): Limit results to active or inactive subdomains. Both are returned when the parameter is... +// - page (integer, optional): Page of results to return. Defaults to 1. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/Typosquatting.swift b/examples/swift/Typosquatting.swift index f09ba4f..f656bc4 100644 --- a/examples/swift/Typosquatting.swift +++ b/examples/swift/Typosquatting.swift @@ -1,9 +1,9 @@ // Typosquatting Lookup // // Parameters for typosquatting (GET /v3.0/domain/typos): -// - keyword (string, optional) -// - pattern (string, optional) -// - pageToken (string, optional) +// - keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not both. +// - pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword or patter... +// - pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward. Send it w... // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/WhoisHistory.swift b/examples/swift/WhoisHistory.swift index 912501d..727ff24 100644 --- a/examples/swift/WhoisHistory.swift +++ b/examples/swift/WhoisHistory.swift @@ -2,7 +2,7 @@ // // Parameters for whoisHistory (GET /v2.0/whois/history): // - domainName (string, required): Domain to fetch historical WHOIS records for -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/WhoisLive.swift b/examples/swift/WhoisLive.swift index db02cc2..4dbcc0a 100644 --- a/examples/swift/WhoisLive.swift +++ b/examples/swift/WhoisLive.swift @@ -1,8 +1,8 @@ // Live WHOIS Lookup // // Parameters for whoisLive (GET /v2.0/whois/live): -// - domainName (string, required) -// - format (string (one of: json, xml), optional) +// - domainName (string, required): Domain to look up. +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/swift/WhoisReverse.swift b/examples/swift/WhoisReverse.swift index dfea7bb..3f385c8 100644 --- a/examples/swift/WhoisReverse.swift +++ b/examples/swift/WhoisReverse.swift @@ -3,7 +3,7 @@ // Parameters for whoisReverse (GET /v2.0/whois/reverse): // - keyword (string, required): Keyword to search across WHOIS records // - page (integer, optional): Page number -// - format (string (one of: json, xml), optional) +// - format (string (one of: json, xml), optional): Response format. JSON when the parameter is left out. // // Top-level code for Sources//main.swift (see Getting Started). diff --git a/examples/typescript/AsnWhois.ts b/examples/typescript/AsnWhois.ts index f89b1c3..9350327 100644 --- a/examples/typescript/AsnWhois.ts +++ b/examples/typescript/AsnWhois.ts @@ -7,8 +7,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new ASNWHOISApi(config); // asnWhois({ asn, format? }) -// asn (string, required) -// format ("json" | "xml", optional): default "json" +// asn (string, required): Autonomous system number to look up, with or without the AS prefix +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.asnWhois({ asn: "as15169" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/BulkDomainAvailabilityV2.ts b/examples/typescript/BulkDomainAvailabilityV2.ts index f18db34..2ea65a2 100644 --- a/examples/typescript/BulkDomainAvailabilityV2.ts +++ b/examples/typescript/BulkDomainAvailabilityV2.ts @@ -9,7 +9,7 @@ const api = new DomainAvailabilityApi(config); // bulkDomainAvailabilityV2({ bulkDomainAvailabilityRequest, domain?, format? }) // bulkDomainAvailabilityRequest (BulkDomainAvailabilityRequest, required): request body // domain (string, optional): Required for TLD-mode bulk check (base domain) -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const body: BulkDomainAvailabilityRequest = { domainNames: ["whoisfreaks.com", "example.com"] }; const result = await api.bulkDomainAvailabilityV2({ bulkDomainAvailabilityRequest: body }); diff --git a/examples/typescript/BulkWhois.ts b/examples/typescript/BulkWhois.ts index 9287b88..e1556f5 100644 --- a/examples/typescript/BulkWhois.ts +++ b/examples/typescript/BulkWhois.ts @@ -8,7 +8,7 @@ const api = new WHOISApi(config); // bulkWhois({ bulkWhoisRequest, format? }) // bulkWhoisRequest (BulkWhoisRequest, required): request body -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const body: BulkWhoisRequest = { domainNames: ["whoisfreaks.com", "jfreaks.com"] }; const result = await api.bulkWhois({ bulkWhoisRequest: body }); diff --git a/examples/typescript/DbAsnWhois.ts b/examples/typescript/DbAsnWhois.ts index 50436d5..76bd675 100644 --- a/examples/typescript/DbAsnWhois.ts +++ b/examples/typescript/DbAsnWhois.ts @@ -9,7 +9,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesASNWHOISApi(config); // dbAsnWhois({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbAsnWhois({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbAsnWhois.json.gz"; diff --git a/examples/typescript/DbDropped.ts b/examples/typescript/DbDropped.ts index 7dd0864..e7e3704 100644 --- a/examples/typescript/DbDropped.ts +++ b/examples/typescript/DbDropped.ts @@ -9,7 +9,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesExpiringDroppedApi(config); // dbDropped({ whois, date? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest async function main(): Promise { const blob = await api.dbDropped({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes diff --git a/examples/typescript/DbDroppedBacklinks.ts b/examples/typescript/DbDroppedBacklinks.ts index 00ae34f..e670cb3 100644 --- a/examples/typescript/DbDroppedBacklinks.ts +++ b/examples/typescript/DbDroppedBacklinks.ts @@ -9,7 +9,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesExpiringDroppedApi(config); // dbDroppedBacklinks({ whois?, date? }) -// whois (boolean, optional) +// whois (boolean, optional): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest async function main(): Promise { const blob = await api.dbDroppedBacklinks({ date: new Date("2026-10-01") }); // a Blob with the file's bytes diff --git a/examples/typescript/DbDroppedJson.ts b/examples/typescript/DbDroppedJson.ts index cc75dcd..54a9eca 100644 --- a/examples/typescript/DbDroppedJson.ts +++ b/examples/typescript/DbDroppedJson.ts @@ -8,7 +8,7 @@ const api = new DatabasesExpiringDroppedApi(config); // dbDroppedJson({ date?, tlds? }) // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const domains = await api.dbDroppedJson({ date: new Date("2026-10-01") }); console.log(`${domains.length} domains`); diff --git a/examples/typescript/DbExpired.ts b/examples/typescript/DbExpired.ts index 917a07a..c541e17 100644 --- a/examples/typescript/DbExpired.ts +++ b/examples/typescript/DbExpired.ts @@ -9,7 +9,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesExpiringDroppedApi(config); // dbExpired({ whois, date? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest async function main(): Promise { const blob = await api.dbExpired({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes diff --git a/examples/typescript/DbIpCity.ts b/examples/typescript/DbIpCity.ts index e4f0a34..e729e74 100644 --- a/examples/typescript/DbIpCity.ts +++ b/examples/typescript/DbIpCity.ts @@ -9,7 +9,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPGeolocationApi(config); // dbIpCity({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpCity({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpCity.zip"; diff --git a/examples/typescript/DbIpCountry.ts b/examples/typescript/DbIpCountry.ts index ededd25..0c6c662 100644 --- a/examples/typescript/DbIpCountry.ts +++ b/examples/typescript/DbIpCountry.ts @@ -9,7 +9,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPGeolocationApi(config); // dbIpCountry({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpCountry({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpCountry.zip"; diff --git a/examples/typescript/DbIpSecurity.ts b/examples/typescript/DbIpSecurity.ts index bc461f1..c8d09aa 100644 --- a/examples/typescript/DbIpSecurity.ts +++ b/examples/typescript/DbIpSecurity.ts @@ -9,7 +9,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPSecurityApi(config); // dbIpSecurity({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpSecurity({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpSecurity.csv"; diff --git a/examples/typescript/DbIpWhois.ts b/examples/typescript/DbIpWhois.ts index 873bc12..c71a1d0 100644 --- a/examples/typescript/DbIpWhois.ts +++ b/examples/typescript/DbIpWhois.ts @@ -9,7 +9,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesIPWHOISApi(config); // dbIpWhois({ date }) -// date (Date, required) +// date (Date, required): The day whose file you want, in YYYY-MM-DD format async function main(): Promise { const blob = await api.dbIpWhois({ date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbIpWhois.json.gz"; diff --git a/examples/typescript/DbNewlyCctld.ts b/examples/typescript/DbNewlyCctld.ts index af94f5c..4afba86 100644 --- a/examples/typescript/DbNewlyCctld.ts +++ b/examples/typescript/DbNewlyCctld.ts @@ -9,9 +9,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyCctld({ whois, date?, tlds? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const blob = await api.dbNewlyCctld({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbNewlyCctld.csv"; diff --git a/examples/typescript/DbNewlyCctldJson.ts b/examples/typescript/DbNewlyCctldJson.ts index 79fb769..356483c 100644 --- a/examples/typescript/DbNewlyCctldJson.ts +++ b/examples/typescript/DbNewlyCctldJson.ts @@ -8,7 +8,7 @@ const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyCctldJson({ date?, tlds? }) // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const domains = await api.dbNewlyCctldJson({ date: new Date("2026-10-01") }); console.log(`${domains.length} domains`); diff --git a/examples/typescript/DbNewlyGtld.ts b/examples/typescript/DbNewlyGtld.ts index 763c89d..808b749 100644 --- a/examples/typescript/DbNewlyGtld.ts +++ b/examples/typescript/DbNewlyGtld.ts @@ -9,9 +9,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyGtld({ whois, date?, tlds? }) -// whois (boolean, required) +// whois (boolean, required): Set true for the file with full WHOIS records, false for domain names only // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const blob = await api.dbNewlyGtld({ whois: true, date: new Date("2026-10-01") }); // a Blob with the file's bytes const file = "DbNewlyGtld.csv"; diff --git a/examples/typescript/DbNewlyGtldJson.ts b/examples/typescript/DbNewlyGtldJson.ts index 565971a..bb90347 100644 --- a/examples/typescript/DbNewlyGtldJson.ts +++ b/examples/typescript/DbNewlyGtldJson.ts @@ -8,7 +8,7 @@ const api = new DatabasesNewlyRegisteredApi(config); // dbNewlyGtldJson({ date?, tlds? }) // date (Date, optional): yyyy-MM-dd; omit for latest -// tlds (string, optional) +// tlds (string, optional): Comma separated TLDs to limit the file to, for example com,net. Every TLD is ... async function main(): Promise { const domains = await api.dbNewlyGtldJson({ date: new Date("2026-10-01") }); console.log(`${domains.length} domains`); diff --git a/examples/typescript/DnsBulk.ts b/examples/typescript/DnsBulk.ts index 9aae3cb..3c14cb5 100644 --- a/examples/typescript/DnsBulk.ts +++ b/examples/typescript/DnsBulk.ts @@ -7,9 +7,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsBulk({ type, dnsBulkRequest, format? }) -// type (string, required): default "all" +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" // dnsBulkRequest (DnsBulkRequest, required): request body -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const body: DnsBulkRequest = { domainNames: ["whoisfreaks.com", "example.com"] }; const result = await api.dnsBulk({ type: "A,MX,TXT", dnsBulkRequest: body }); diff --git a/examples/typescript/DnsHistorical.ts b/examples/typescript/DnsHistorical.ts index 0185c63..02321f1 100644 --- a/examples/typescript/DnsHistorical.ts +++ b/examples/typescript/DnsHistorical.ts @@ -7,10 +7,10 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsHistorical({ domainName, type, page?, format? }) -// domainName (string, required) -// type (string, required): default "all" -// page (number, optional): default 1 -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// page (number, optional): Page of results to return. Defaults to 1; default 1 +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsHistorical({ domainName: "whoisfreaks.com", type: "A,MX,TXT", page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/DnsHistoricalV22.ts b/examples/typescript/DnsHistoricalV22.ts index de4250b..809c30a 100644 --- a/examples/typescript/DnsHistoricalV22.ts +++ b/examples/typescript/DnsHistoricalV22.ts @@ -7,12 +7,12 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsHistoricalV22({ domainName, type, page?, sort?, sortBy?, format? }) -// domainName (string, required) -// type (string, required): default "all" -// page (number, optional): default 1 +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsHistoricalV22({ domainName: "whoisfreaks.com", type: "A,MX,TXT", page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/DnsHistoricalV23.ts b/examples/typescript/DnsHistoricalV23.ts index 43f7943..9220630 100644 --- a/examples/typescript/DnsHistoricalV23.ts +++ b/examples/typescript/DnsHistoricalV23.ts @@ -7,12 +7,12 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new DNSApi(config); // dnsHistoricalV23({ domainName, type, page?, sort?, sortBy?, format? }) -// domainName (string, required) -// type (string, required): default "all" -// page (number, optional): default 1 +// domainName (string, required): Domain to look up +// type (string, required): Comma separated DNS record types to return, for example A,MX,TXT. Defaults to...; default "all" +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsHistoricalV23({ domainName: "whoisfreaks.com", type: "A,MX,TXT", page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/DnsLive.ts b/examples/typescript/DnsLive.ts index 9d78991..8983c90 100644 --- a/examples/typescript/DnsLive.ts +++ b/examples/typescript/DnsLive.ts @@ -8,9 +8,9 @@ const api = new DNSApi(config); // dnsLive({ type, domainName?, ipAddress?, format? }) // type (string, required): all or comma-separated: A,MX,NS,TXT,SOA,SPF,AAAA,CNAME; default "all" -// domainName (string, optional) +// domainName (string, optional): Domain to look up // ipAddress (string, optional): Use for PTR lookups -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsLive({ type: "A,MX,TXT", domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/DnsReverse.ts b/examples/typescript/DnsReverse.ts index 637bcf9..a4141b2 100644 --- a/examples/typescript/DnsReverse.ts +++ b/examples/typescript/DnsReverse.ts @@ -8,10 +8,10 @@ const api = new DNSApi(config); // dnsReverse({ value, type, exact?, page?, format? }) // value (string, required): IP, CIDR, or record value -// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required) -// exact (boolean, optional): default true -// page (number, optional): default 1 -// format ("json" | "xml", optional): default "json" +// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required): DNS record type to search by +// exact (boolean, optional): Set true to match value exactly. Defaults to false, where value is treated as...; default false +// page (number, optional): Page of results to return. Defaults to 1; default 1 +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsReverse({ value: "8.8.8.8", type: "a", page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/DnsReverseV22.ts b/examples/typescript/DnsReverseV22.ts index 4381322..26f9796 100644 --- a/examples/typescript/DnsReverseV22.ts +++ b/examples/typescript/DnsReverseV22.ts @@ -8,12 +8,12 @@ const api = new DNSApi(config); // dnsReverseV22({ value, type, exact?, page?, sort?, sortBy?, format? }) // value (string, required): IP, CIDR, or record value -// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required) +// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required): DNS record type to search by // exact (boolean, optional): When false the value is matched as a substring, which is far slower than an e...; default true -// page (number, optional): default 1 +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsReverseV22({ value: "8.8.8.8", type: "a", page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/DnsReverseV23.ts b/examples/typescript/DnsReverseV23.ts index 263638b..0f12120 100644 --- a/examples/typescript/DnsReverseV23.ts +++ b/examples/typescript/DnsReverseV23.ts @@ -8,12 +8,12 @@ const api = new DNSApi(config); // dnsReverseV23({ value, type, exact?, page?, sort?, sortBy?, format? }) // value (string, required): IP, CIDR, or record value -// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required) +// type ("a" | "mx" | "cname" | "ns" | "aaaa" | "txt" | "soa", required): DNS record type to search by // exact (boolean, optional): When false the value is matched as a substring, which is far slower than an e...; default true -// page (number, optional): default 1 +// page (number, optional): Page of results to return. Defaults to 1; default 1 // sort ("asc" | "desc", optional): Sort direction. Omit to leave the results unsorted // sortBy ("firstSeen" | "lastSeen", optional): Field to sort on. Only applies when sort is given; default "lastSeen" -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.dnsReverseV23({ value: "8.8.8.8", type: "a", page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/DomainAvailabilityV2.ts b/examples/typescript/DomainAvailabilityV2.ts index fee2e15..abbc3d3 100644 --- a/examples/typescript/DomainAvailabilityV2.ts +++ b/examples/typescript/DomainAvailabilityV2.ts @@ -10,7 +10,7 @@ const api = new DomainAvailabilityApi(config); // domain (string, required): The domain name to check // sug (boolean, optional): Whether to return TLD suggestions alongside the queried domain; default false // count (number, optional): Number of TLD suggestions to return when sug=true. Maximum is 100; default 5 -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.domainAvailabilityV2({ domain: "google.com", sug: true, count: 5 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/DomainReputation.ts b/examples/typescript/DomainReputation.ts index 5469a4e..8f9a478 100644 --- a/examples/typescript/DomainReputation.ts +++ b/examples/typescript/DomainReputation.ts @@ -8,7 +8,7 @@ const api = new DomainReputationApi(config); // domainReputation({ domainName, format? }) // domainName (string, required): The domain name to assess -// format ("json" | "xml", optional): default "json" +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.domainReputation({ domainName: "amazon.com" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/Geolocation.ts b/examples/typescript/Geolocation.ts index 25902d3..d66e939 100644 --- a/examples/typescript/Geolocation.ts +++ b/examples/typescript/Geolocation.ts @@ -7,7 +7,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new GeolocationApi(config); // geolocation({ ip }) -// ip (string, required) +// ip (string, required): IP address to look up async function main(): Promise { const result = await api.geolocation({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/IpReputation.ts b/examples/typescript/IpReputation.ts index 34e42c7..1d0a78e 100644 --- a/examples/typescript/IpReputation.ts +++ b/examples/typescript/IpReputation.ts @@ -7,7 +7,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new IPReputationApi(config); // ipReputation({ ip }) -// ip (string, required) +// ip (string, required): IP address to look up async function main(): Promise { const result = await api.ipReputation({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/IpReputationV2.ts b/examples/typescript/IpReputationV2.ts index ce993dc..c4415cb 100644 --- a/examples/typescript/IpReputationV2.ts +++ b/examples/typescript/IpReputationV2.ts @@ -7,7 +7,7 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new IPReputationApi(config); // ipReputationV2({ ip }) -// ip (string, required) +// ip (string, required): IP address to look up async function main(): Promise { const result = await api.ipReputationV2({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/IpWhois.ts b/examples/typescript/IpWhois.ts index a84ac37..53f5268 100644 --- a/examples/typescript/IpWhois.ts +++ b/examples/typescript/IpWhois.ts @@ -7,8 +7,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new IPWHOISApi(config); // ipWhois({ ip, format? }) -// ip (string, required) -// format ("json" | "xml", optional): default "json" +// ip (string, required): IP address to look up +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.ipWhois({ ip: "8.8.8.8" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/README.md b/examples/typescript/README.md index f718790..e1de9b1 100644 --- a/examples/typescript/README.md +++ b/examples/typescript/README.md @@ -24,6 +24,7 @@ Install: see the [TypeScript guide](../../docs/languages/typescript.md). Set the ## Typosquatting - [`Typosquatting.ts`](Typosquatting.ts): Typosquatting Lookup (`GET /v3.0/domain/typos`) +- [`SubdomainTyposquatting.ts`](SubdomainTyposquatting.ts): Subdomain Typosquatting Lookup (`GET /v3.0/subdomains/typos`) ## SSL - [`SslLookup.ts`](SslLookup.ts): SSL Certificate Lookup (`GET /v1.0/ssl/live`) diff --git a/examples/typescript/SslLookup.ts b/examples/typescript/SslLookup.ts index 05609a9..f1ceda6 100644 --- a/examples/typescript/SslLookup.ts +++ b/examples/typescript/SslLookup.ts @@ -7,10 +7,10 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new SSLApi(config); // sslLookup({ domainName, chain?, sslRaw?, format? }) -// domainName (string, required) -// chain (boolean, optional): default false -// sslRaw (boolean, optional): default false -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// chain (boolean, optional): Set true to return the full certificate chain, ordered from the end-user cert...; default false +// sslRaw (boolean, optional): Set true to include the raw OpenSSL response for the domain. Defaults to false; default false +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.sslLookup({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/SubdomainTyposquatting.ts b/examples/typescript/SubdomainTyposquatting.ts new file mode 100644 index 0000000..4f6c3fb --- /dev/null +++ b/examples/typescript/SubdomainTyposquatting.ts @@ -0,0 +1,27 @@ +// Subdomain Typosquatting Lookup: GET https://api.whoisfreaks.com/v3.0/subdomains/typos +// Run: WHOISFREAKS_API_KEY=your_api_key npx tsx SubdomainTyposquatting.ts +import { Configuration, TyposquattingApi, ResponseError } from "whoisfreaks"; + +// Set the API key once; the client adds it to every request. +const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); +const api = new TyposquattingApi(config); + +// subdomainTyposquatting({ keyword?, pattern?, pageToken?, fetch_size? }) +// keyword (string, optional): Brand or label to find typo variants for. 3 to 63 characters, letters, digits... +// pattern (string, optional): Wildcard search string, where '*' matches any characters and '?' matches one.... +// pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward.... +// fetch_size (number, optional): Subdomains per page. 100 when the parameter is left out, and values above 100...; default 100 +async function main(): Promise { + const result = await api.subdomainTyposquatting(); + console.log(JSON.stringify(result, null, 2)); +} + +main().catch(async (err: unknown) => { + // API errors carry the HTTP response + if (err instanceof ResponseError) { + console.error(`HTTP ${err.response.status}: ${await err.response.text()}`); + } else { + console.error(err); + } + process.exitCode = 1; +}); diff --git a/examples/typescript/Subdomains.ts b/examples/typescript/Subdomains.ts index c4b883c..c08f6d4 100644 --- a/examples/typescript/Subdomains.ts +++ b/examples/typescript/Subdomains.ts @@ -7,12 +7,12 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new SubdomainsApi(config); // subdomains({ domain, after?, before?, status?, page?, format? }) -// domain (string, required) -// after (Date, optional) -// before (Date, optional) -// status ("active" | "inactive", optional) -// page (number, optional): default 1 -// format ("json" | "xml", optional): default "json" +// domain (string, required): Domain whose subdomains you want +// after (Date, optional): Only return records created after this date, in YYYY-MM-DD format. Defaults t... +// before (Date, optional): Only return records created before this date, in YYYY-MM-DD format. Defaults ... +// status ("active" | "inactive", optional): Limit results to active or inactive subdomains. Both are returned when the pa... +// page (number, optional): Page of results to return. Defaults to 1; default 1 +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.subdomains({ domain: "whoisfreaks.com", page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/Typosquatting.ts b/examples/typescript/Typosquatting.ts index 85087fa..c6e795a 100644 --- a/examples/typescript/Typosquatting.ts +++ b/examples/typescript/Typosquatting.ts @@ -7,9 +7,9 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new TyposquattingApi(config); // typosquatting({ keyword?, pattern?, pageToken? }) -// keyword (string, optional) -// pattern (string, optional) -// pageToken (string, optional) +// keyword (string, optional): Brand or label to find typo variants for. Pass either keyword or pattern, not... +// pattern (string, optional): Wildcard search string, where '*' matches any characters. Pass either keyword... +// pageToken (string, optional): Token from nextPageToken in the previous response, needed from page 2 onward.... async function main(): Promise { const result = await api.typosquatting({ keyword: "whoisfreaks" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/WhoisHistory.ts b/examples/typescript/WhoisHistory.ts index 8dac32e..c264c71 100644 --- a/examples/typescript/WhoisHistory.ts +++ b/examples/typescript/WhoisHistory.ts @@ -8,7 +8,7 @@ const api = new WHOISApi(config); // whoisHistory({ domainName, format? }) // domainName (string, required): Domain to fetch historical WHOIS records for -// format ("json" | "xml", optional) +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out async function main(): Promise { const result = await api.whoisHistory({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/WhoisLive.ts b/examples/typescript/WhoisLive.ts index 5b66789..b8f671f 100644 --- a/examples/typescript/WhoisLive.ts +++ b/examples/typescript/WhoisLive.ts @@ -7,8 +7,8 @@ const config = new Configuration({ apiKey: process.env.WHOISFREAKS_API_KEY }); const api = new WHOISApi(config); // whoisLive({ domainName, format? }) -// domainName (string, required) -// format ("json" | "xml", optional): default "json" +// domainName (string, required): Domain to look up +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out; default "json" async function main(): Promise { const result = await api.whoisLive({ domainName: "whoisfreaks.com" }); console.log(JSON.stringify(result, null, 2)); diff --git a/examples/typescript/WhoisReverse.ts b/examples/typescript/WhoisReverse.ts index 48346f7..a2dd446 100644 --- a/examples/typescript/WhoisReverse.ts +++ b/examples/typescript/WhoisReverse.ts @@ -9,7 +9,7 @@ const api = new WHOISApi(config); // whoisReverse({ keyword, page?, format? }) // keyword (string, required): Keyword to search across WHOIS records // page (number, optional): Page number -// format ("json" | "xml", optional) +// format ("json" | "xml", optional): Response format. JSON when the parameter is left out async function main(): Promise { const result = await api.whoisReverse({ keyword: "whoisfreaks", page: 1 }); console.log(JSON.stringify(result, null, 2)); diff --git a/spec/whoisfreaks-openapi.yaml b/spec/whoisfreaks-openapi.yaml index 63a33ee..23460d8 100644 --- a/spec/whoisfreaks-openapi.yaml +++ b/spec/whoisfreaks-openapi.yaml @@ -6,7 +6,7 @@ info: \ Domain Reputation, and bulk database downloads.\n\n## Authentication\nAll requests require an `apiKey`\ \ query parameter.\n\n## Resources\n- Docs: https://whoisfreaks.com/documentation\n- Billing: https://billing.whoisfreaks.com\n\ - Support: support@whoisfreaks.com\n" - version: 1.0.0 + version: 2026-11-17.1 contact: name: WhoisFreaks Support email: support@whoisfreaks.com @@ -78,6 +78,7 @@ paths: operationId: whoisLive parameters: - name: domainName + description: "Domain to look up." in: query schema: type: string @@ -142,6 +143,7 @@ paths: operationId: dnsLive parameters: - name: domainName + description: "Domain to look up." in: query schema: type: string @@ -181,12 +183,14 @@ paths: operationId: dnsHistorical parameters: - name: domainName + description: "Domain to look up." in: query schema: type: string required: true example: whoisfreaks.com - name: type + description: "Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all." in: query schema: type: string @@ -194,6 +198,7 @@ paths: required: true example: "A,MX,TXT" - name: page + description: "Page of results to return. Defaults to 1." in: query schema: type: integer @@ -225,6 +230,7 @@ paths: description: IP, CIDR, or record value example: 8.8.8.8 - name: type + description: "DNS record type to search by." in: query schema: type: string @@ -238,11 +244,13 @@ paths: - soa required: true - name: exact + description: "Set true to match value exactly. Defaults to false, where value is treated as a pattern and '*' matches any characters. Ignored for A and AAAA records, which always match the IP." in: query schema: type: boolean - default: true + default: false - name: page + description: "Page of results to return. Defaults to 1." in: query schema: type: integer @@ -270,12 +278,14 @@ paths: operationId: dnsHistoricalV22 parameters: - name: domainName + description: "Domain to look up." in: query schema: type: string required: true example: whoisfreaks.com - name: type + description: "Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all." in: query schema: type: string @@ -283,6 +293,7 @@ paths: required: true example: "A,MX,TXT" - name: page + description: "Page of results to return. Defaults to 1." in: query schema: type: integer @@ -313,12 +324,14 @@ paths: operationId: dnsHistoricalV23 parameters: - name: domainName + description: "Domain to look up." in: query schema: type: string required: true example: whoisfreaks.com - name: type + description: "Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all." in: query schema: type: string @@ -326,6 +339,7 @@ paths: required: true example: "A,MX,TXT" - name: page + description: "Page of results to return. Defaults to 1." in: query schema: type: integer @@ -359,6 +373,7 @@ paths: - $ref: "#/components/parameters/ReverseType" - $ref: "#/components/parameters/ReverseExact" - name: page + description: "Page of results to return. Defaults to 1." in: query schema: type: integer @@ -393,6 +408,7 @@ paths: - $ref: "#/components/parameters/ReverseType" - $ref: "#/components/parameters/ReverseExact" - name: page + description: "Page of results to return. Defaults to 1." in: query schema: type: integer @@ -421,6 +437,7 @@ paths: operationId: dnsBulk parameters: - name: type + description: "Comma separated DNS record types to return, for example A,MX,TXT. Defaults to all." in: query schema: type: string @@ -542,16 +559,19 @@ paths: operationId: typosquatting parameters: - name: keyword + description: "Brand or label to find typo variants for. Pass either keyword or pattern, not both." in: query schema: type: string example: whoisfreaks - name: pattern + description: "Wildcard search string, where '*' matches any characters. Pass either keyword or pattern, not both." in: query schema: type: string example: "whois*" - name: pageToken + description: "Token from nextPageToken in the previous response, needed from page 2 onward. Send it with the original keyword or pattern." in: query schema: type: string @@ -566,6 +586,64 @@ paths: $ref: "#/components/responses/BadRequest" "401": $ref: "#/components/responses/Unauthorized" + /v3.0/subdomains/typos: + get: + tags: + - Typosquatting + summary: Subdomain Typosquatting Lookup + description: >- + Find subdomains that carry a typo variant of a brand as one of their + labels, such as login.paypa1.example.com. Phishing pages often hide the + brand in the subdomain of an unrelated domain, so these hosts never show + up in a domain typosquatting search. Pass either keyword or pattern, not + both. 5 credits per page. + operationId: subdomainTyposquatting + parameters: + - name: keyword + description: "Brand or label to find typo variants for. 3 to 63 characters, letters, digits and hyphens, a single label with no dots, and it cannot start or end with a hyphen." + in: query + schema: + type: string + minLength: 3 + maxLength: 63 + example: paypal + - name: pattern + description: "Wildcard search string, where '*' matches any characters and '?' matches one. At most 2 wildcards, at least 5 characters besides the wildcards, and no more than 63 characters in total." + in: query + schema: + type: string + minLength: 5 + maxLength: 63 + example: paypa* + - name: pageToken + description: "Token from nextPageToken in the previous response, needed from page 2 onward. Send it with the original keyword or pattern." + in: query + schema: + type: string + - name: fetch_size + description: "Subdomains per page. 100 when the parameter is left out, and values above 10000 are capped at 10000." + in: query + schema: + type: integer + minimum: 0 + maximum: 10000 + default: 100 + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/TyposquatSubdomainsResponse" + "400": + $ref: "#/components/responses/BadRequest" + "401": + $ref: "#/components/responses/Unauthorized" + "404": + $ref: "#/components/responses/NotFound" + "429": + $ref: "#/components/responses/RateLimited" + /v1.0/ssl/live: get: tags: @@ -575,17 +653,20 @@ paths: operationId: sslLookup parameters: - name: domainName + description: "Domain to look up." in: query schema: type: string required: true example: whoisfreaks.com - name: chain + description: "Set true to return the full certificate chain, ordered from the end-user certificate to the root. Defaults to false." in: query schema: type: boolean default: false - name: sslRaw + description: "Set true to include the raw OpenSSL response for the domain. Defaults to false." in: query schema: type: boolean @@ -609,6 +690,7 @@ paths: operationId: geolocation parameters: - name: ip + description: "IP address to look up." in: query schema: type: string @@ -664,24 +746,28 @@ paths: operationId: subdomains parameters: - name: domain + description: "Domain whose subdomains you want." in: query schema: type: string required: true example: whoisfreaks.com - name: after + description: "Only return records created after this date, in YYYY-MM-DD format. Defaults to the oldest record held, and must not be in the future or later than before." in: query schema: type: string format: date example: "2026-01-01" - name: before + description: "Only return records created before this date, in YYYY-MM-DD format. Defaults to today, and must not be in the future." in: query schema: type: string format: date example: "2026-10-01" - name: status + description: "Limit results to active or inactive subdomains. Both are returned when the parameter is left out." in: query schema: type: string @@ -689,6 +775,7 @@ paths: - active - inactive - name: page + description: "Page of results to return. Defaults to 1." in: query schema: type: integer @@ -713,6 +800,7 @@ paths: operationId: ipReputation parameters: - name: ip + description: "IP address to look up." in: query schema: type: string @@ -773,6 +861,7 @@ paths: operationId: ipReputationV2 parameters: - name: ip + description: "IP address to look up." in: query schema: type: string @@ -868,6 +957,7 @@ paths: operationId: asnWhois parameters: - name: asn + description: "Autonomous system number to look up, with or without the AS prefix." in: query schema: type: string @@ -892,6 +982,7 @@ paths: operationId: ipWhois parameters: - name: ip + description: "IP address to look up." in: query schema: type: string @@ -955,6 +1046,7 @@ paths: operationId: dbNewlyGtld parameters: - name: whois + description: "Set true for the file with full WHOIS records, false for domain names only." in: query schema: type: boolean @@ -962,6 +1054,7 @@ paths: example: true - $ref: "#/components/parameters/DateParam" - name: tlds + description: "Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out." in: query schema: type: string @@ -986,6 +1079,7 @@ paths: operationId: dbNewlyCctld parameters: - name: whois + description: "Set true for the file with full WHOIS records, false for domain names only." in: query schema: type: boolean @@ -993,6 +1087,7 @@ paths: example: true - $ref: "#/components/parameters/DateParam" - name: tlds + description: "Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out." in: query schema: type: string @@ -1062,6 +1157,7 @@ paths: parameters: - $ref: "#/components/parameters/DateParam" - name: tlds + description: "Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out." in: query schema: type: string @@ -1088,6 +1184,7 @@ paths: parameters: - $ref: "#/components/parameters/DateParam" - name: tlds + description: "Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out." in: query schema: type: string @@ -1133,6 +1230,7 @@ paths: operationId: dbExpired parameters: - name: whois + description: "Set true for the file with full WHOIS records, false for domain names only." in: query schema: type: boolean @@ -1179,6 +1277,7 @@ paths: operationId: dbDropped parameters: - name: whois + description: "Set true for the file with full WHOIS records, false for domain names only." in: query schema: type: boolean @@ -1206,6 +1305,7 @@ paths: parameters: - $ref: "#/components/parameters/DateParam" - name: tlds + description: "Comma separated TLDs to limit the file to, for example com,net. Every TLD is included when the parameter is left out." in: query schema: type: string @@ -1231,6 +1331,7 @@ paths: operationId: dbDroppedBacklinks parameters: - name: whois + description: "Set true for the file with full WHOIS records, false for domain names only." in: query schema: type: boolean @@ -1454,6 +1555,7 @@ paths: operationId: dbIpCountry parameters: - name: date + description: "The day whose file you want, in YYYY-MM-DD format." in: query schema: type: string @@ -1498,6 +1600,7 @@ paths: operationId: dbIpCity parameters: - name: date + description: "The day whose file you want, in YYYY-MM-DD format." in: query schema: type: string @@ -1524,6 +1627,7 @@ paths: operationId: dbAsnWhois parameters: - name: date + description: "The day whose file you want, in YYYY-MM-DD format." in: query schema: type: string @@ -1568,6 +1672,7 @@ paths: operationId: dbIpWhois parameters: - name: date + description: "The day whose file you want, in YYYY-MM-DD format." in: query schema: type: string @@ -1612,6 +1717,7 @@ paths: operationId: dbIpSecurity parameters: - name: date + description: "The day whose file you want, in YYYY-MM-DD format." in: query schema: type: string @@ -1663,6 +1769,7 @@ paths: description: Domain to fetch historical WHOIS records for example: whoisfreaks.com - name: format + description: "Response format. JSON when the parameter is left out." in: query required: false schema: @@ -1683,6 +1790,7 @@ paths: - WHOIS operationId: whoisReverse summary: Reverse WHOIS lookup by keyword + description: "Find every domain whose WHOIS record carries a keyword, owner name, company, email or postal address. Results are paginated 100 domains per page." parameters: - name: keyword in: query @@ -1699,6 +1807,7 @@ paths: description: Page number example: 1 - name: format + description: "Response format. JSON when the parameter is left out." in: query required: false schema: @@ -1720,6 +1829,7 @@ paths: - Databases - Threat Feed operationId: downloadThreatFeedPhishing summary: Download the daily phishing threat feed (CSV) + description: "Download the day's phishing domain feed as a gzip-compressed CSV file." parameters: - name: date in: query @@ -1745,6 +1855,7 @@ paths: - Databases - Threat Feed operationId: downloadThreatFeedPhishingSample summary: Download a sample of the phishing threat feed (CSV) + description: "Download an open sample of the phishing domain feed as a gzip-compressed CSV file. No API key and no date are needed." parameters: [] responses: "200": @@ -1763,6 +1874,7 @@ paths: - Databases - Threat Feed operationId: downloadThreatFeedMalware summary: Download the daily malware threat feed (CSV) + description: "Download the day's malware domain feed as a gzip-compressed CSV file." parameters: - name: date in: query @@ -1788,6 +1900,7 @@ paths: - Databases - Threat Feed operationId: downloadThreatFeedMalwareSample summary: Download a sample of the malware threat feed (CSV) + description: "Download an open sample of the malware domain feed as a gzip-compressed CSV file. No API key and no date are needed." parameters: [] responses: "200": @@ -1806,6 +1919,7 @@ paths: - Databases - Threat Feed operationId: downloadThreatFeedSpam summary: Download the daily spam threat feed (CSV) + description: "Download the day's spam domain feed as a gzip-compressed CSV file." parameters: - name: date in: query @@ -1831,6 +1945,7 @@ paths: - Databases - Threat Feed operationId: downloadThreatFeedSpamSample summary: Download a sample of the spam threat feed (CSV) + description: "Download an open sample of the spam domain feed as a gzip-compressed CSV file. No API key and no date are needed." parameters: [] responses: "200": @@ -2480,6 +2595,7 @@ components: Format: name: format in: query + description: "Response format. JSON when the parameter is left out." schema: type: string enum: @@ -2559,6 +2675,7 @@ components: ReverseType: name: type in: query + description: "DNS record type to search by." schema: type: string enum: @@ -3189,6 +3306,51 @@ components: items: $ref: "#/components/schemas/DomainAvailabilityItem" additionalProperties: true + TyposquatSubdomainsResponse: + type: object + properties: + status: + type: boolean + totalRecords: + type: integer + currentPage: + type: integer + totalPages: + type: integer + hasNextPage: + type: boolean + nextPageToken: + type: string + subdomains: + type: array + items: + $ref: "#/components/schemas/TyposquatSubdomain" + additionalProperties: true + TyposquatSubdomain: + type: object + properties: + subdomain: + type: string + description: The matching hostname. + domain: + type: string + description: The registrable domain the subdomain belongs to. + status: + type: string + description: Whether the subdomain is still resolving. + enum: + - active + - inactive + firstSeen: + type: string + description: Date the subdomain was first seen, in YYYY-MM-DD format. + lastSeen: + type: string + description: Date the subdomain was last seen, in YYYY-MM-DD format. + inactiveFrom: + type: string + description: Date the subdomain stopped resolving, absent while it is active. + additionalProperties: true TyposquattingDomain: type: object properties: