README
¶
A tool in Go Lang to utilize Whoisfreaks' services like whois, DNS, SSL and Domain Availability api.
Index
INSTALLATION
For Installation go must be installed in your machine;
go get -u github.com/WhoisFreaks/whoisfreaks
OR
go install github.com/WhoisFreaks/whoisfreaks
using source code
if you want to build on your own you can follow this;
git clone https://github.com/WhoisFreaks/whoisfreaks.git
go to the cloned directory and build the project using;
go build
and move the binary to the your machine's go path. Note: After Installation you can use following guide to perform any sort of lookup.
You can use the services using command line as well as SDK.
COMMAND LINE INTERFACE (CLI)
Authentication
For utilizing whoisfreaks' services you must sign up and get a API_KEY and then add that key to your machine which will be used for authentication.
export WHOISFREAKS_API_KEY="..."
Whois Lookup using CLI
With whoisfreaks's Whois tool you can perform;
- Live whois lookup for fetching whois information from their respective servers.
- Historical whois lookup for fetching historical data from whoisfreaks' database.
- Reverse whois lookup to fetch data from database based on keyword, company name, owner name or email.
Live whois Lookup
For live whois lookup you can use;
whoisfreaks -whois -live -domain whoisfreaks.com
to perform bulk live lookup you can use following code where you will provide multiple domains that are comma separated.
whoisfreaks -whois -live -bulk -domains whoisfreaks.com,ipgeolocation.io
Note: Maximum 100 domains will be served if you want to perform bulk lookup with more then 100 domains you can visit BULK WHOIS LOOKUP.
Historical whois Lookup
For historical whois lookup you can use;
whoisfreaks -whois -historical -domain whoisfreaks.com
Reverse whois Lookup
For reverse whois lookup based on keyword you can use;
whoisfreaks -whois -reverse -keyword whoisfreaks
For reverse whois lookup based on owner name you can use;
whoisfreaks -whois -reverse -owner ejaz_ahmed
For reverse whois lookup based on company name you can use;
whoisfreaks -whois -reverse -company jfreak
For reverse whois lookup based on email you can use;
whoisfreaks -whois -reverse -email ejaz_ahmed@outlook.com
with any of the above reverse queries you can use some additional flags like;
-mini
to get a mini whois response that contains create_date, update_date, expiry_date and few more.-page n
to get control over pages if there are more then 100 records as each page contains 100 records. By default you will get first page.
Domain Availability Lookup using CLI
With whoisfreaks' domain availability lookup tool you can check for any domain if it is available for registration or not. You can use following;
whoisfreaks -domainAvailability -domain whoisfreaks.com
- use
-sug
to get default five suggestions. - use
-count
if you want any number of suggestions but greater then five.
similarly, to perform bulk Domain availability lookup you can use;
whoisfreaks -domainAvailability -bulk -domains whoisfreaks.com,ipgeolocation.io
Note: suggestions flag is only available with single domain availability lookup.
DNS Lookup using CLI
With whoisfreaks's DNS tool you can perform;
- Live DNS lookup for fetching dns information from their respective servers.
- Historical DNS lookup for fetching historical data from whoisfreaks' database.
- Reverse DNS lookup to fetch data from database based on values like
8.8.8.8
for reverse A records andmx.zoho.com
for reverse mx records.
Live DNS Lookup
For live DNS lookup you can use following;
whoisfreaks -dns -live -domain whoisfreaks.com -dnsType all
- use
-dnsType a
for A records, if you want any other record use name of that record. If you want multiple use a comma separated list like-dnsType a,mx,ns
Historical DNS Lookup
For historical DNS lookup you can use;
whoisfreaks -dns -historical -domain whoisfreaks.com -dnsType all
- use
-dnsType a
for A records, if you want any other record use name of that record. If you want multiple use a comma separated list like-dnsType a,mx,ns
Reverse DNS Lookup
For reverse DNS lookup based on specific dns Record you can use;
whoisfreaks -dns -reverse -value 8.8.8.8 -dnsType a
-page n
to get control over pages if there are more then 100 records as each page contains 100 records. By default you will get first page.
SSL Lookup using CLI
SSL cert lookup tool allows you to fetch Secure Sockets Layer (SSL) certificate along with its complete SSL cert chain.
- Live SSL Lookup for fetching live and up-to-date information.
live SSL Lookup
For live SSL lookup you can use following;
whoisfreaks -ssl -live -domain whoisfreaks.com
some other flags are also provided like;
-chain
to get chain of all domain ssl certificates sorted from end-user to root.-raw
to get the raw openssl response of the domain.
SOFTWARE DEVELOPMENT KIT (SDK)
WHOIS Lookup
This package is for performing any type of WHOIS lookup, such as live, historical, or reverse lookups.
Index
WHOIS Authentication Setup
WHOIS Bulk Live Lookup
WHOIS Historical Lookup
WHOIS Live Lookup
WHOIS Reverse Lookup
WHOIS Mini Reverse Lookup
Functions
WHOIS Authentication Setup
func SetAPIKey(key string)
SetAPIKey sets the global API key to the specified value. It allows you to configure the API key used for authentication in your application.
Example usage:
whois.SetAPIKey("your_api_key_here")
Parameters:
- key: A string representing the API key to be set.
WHOIS Bulk Live Lookup
func GetBulkLiveResponse(domains []string) (*modal.BulkDomainInfo, *modal.Error)
GetBulkLiveResponse retrieves live WHOIS information for multiple domains in bulk using the WhoisFreaks API.
Parameters:
- domains: A slice of strings containing the domain names for which live WHOIS information is requested.
Returns:
- *modal.BulkDomainInfo: A pointer to a BulkDomainInfo struct containing live domain information for the bulk request.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usage:
whois.SetAPIKey("your_api_key_here")
domains := []string{"example1.com", "example2.com", "example3.com"}
bulkDomainInfo, err := GetBulkLiveResponse(domains)
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Bulk Live Domain Info:", bulkDomainInfo)
WHOIS Historical Lookup
func GetHistoricalResponse(domain string) (*modal.HistoricalDomainInfo, *modal.Error)
GetHistoricalResponse retrieves historical WHOIS information using the WhoisFreaks API.
Parameters:
- domain: The domain name for which historical WHOIS information is requested (e.g., "example.com").
Returns:
- *modal.HistoricalDomainInfo: A pointer to a HistoricalDomainInfo struct containing historical domain information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usage:
whois.SetAPIKey("your_api_key_here")
historicalInfo, err := whois.GetHistoricalResponse("example.com")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Historical Domain Info:", historicalInfo)
WHOIS Live Lookup
func GetLiveResponse(domain string) (*modal.DomainInfo, *modal.Error)
GetLiveResponse retrieves live WHOIS information for a specific domain using the WhoisFreaks API.
Parameters:
- domain: The domain name for which live WHOIS information is requested (e.g., "example.com").
Returns:
- *modal.DomainInfo: A pointer to a DomainInfo struct containing live domain information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usage:
whois.SetAPIKey("your_api_key_here")
domainInfo, err := whois.GetLiveResponse("example.com")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Live Domain Info:", domainInfo)
WHOIS Reverse Lookup
func GetReverseResponse(keyword, email, company, owner, page string) (*modal.ReverseDomainInfo, *modal.Error)
GetReverseResponse performs a reverse whois lookup using the WhoisFreaks API.
Parameters:
- keyword: The keyword to search for in domain records.
- email: The email address to search for in domain records.
- company: The company name to search for in domain records.
- owner: The owner name to search for in domain records.
- page: The optional page number for paginated results. Leave empty for the first page.
Returns:
- *modal.ReverseDomainInfo: A pointer to a ReverseDomainInfo struct containing reverse whois information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usage:
whois.SetAPIKey("your_api_key_here")
reverseDomainInfo, err := whois.GetReverseResponse("example", "email@example.com", "", "", "1")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Reverse Domain Info:", reverseDomainInfo)
WHOIS Mini Reverse Lookup
func GetReverseMiniResponse(keyword, email, company, owner, page string) (*modal.ReverseMiniDomainInfo, *modal.Error)
GetReverseMiniResponse performs a reverse whois lookup in mini mode using the WhoisFreaks API.
Parameters:
- keyword: The keyword to search for in domain records.
- email: The email address to search for in domain records.
- company: The company name to search for in domain records.
- owner: The owner name to search for in domain records.
- page: The optional page number for paginated results. Leave empty for the first page.
Returns:
- *modal.ReverseMiniDomainInfo: A pointer to a ReverseMiniDomainInfo struct containing reverse whois information in mini mode.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usage:
whois.SetAPIKey("your_api_key_here")
reverseMiniDomainInfo, err := whois.GetReverseMiniResponse("example", "email@example.com", "", "", "1")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Reverse Mini Domain Info:", reverseMiniDomainInfo)
Domain Availability Lookup
This package is for performing any type of Domain Availability lookup.
Index
Domain Availability Authentication Setup
Bulk Domain Availability Lookup
Domain Availability Check
Domain Availability Check and Suggestion
Functions
Domain Availability Authentication Setup
func SetAPIKey(key string)
SetAPIKey sets the global API key to the specified value. It allows you to configure the API key used for authentication in your application.
Example usage:
domainavailability.SetAPIKey("your_api_key_here")
Parameters:
- key: A string representing the API key to be set.
Bulk Domain Availability Lookup
func Bulk(domains []string) (*modal.BulkDomainAvailability, *modal.Error)
Bulk performs a bulk domain availability check using the WhoisFreaks API. It checks the availability of multiple domain names in bulk.
Parameters:
- domains: A slice of strings containing the domain names to be checked for availability.
Returns:
- *modal.BulkDomainAvailability: A pointer to a BulkDomainAvailability struct containing bulk domain availability information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usage:
domainavailability.SetAPIKey("your_api_key_here")
domains := []string{"example1.com", "example2.com", "example3.com"}
bulkDomainAvailability, err := domainavailability.Bulk(domains)
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Bulk Domain Availability Info:", bulkDomainAvailability)
Domain Availability Check
func Check(domain string) (*modal.DomainAvailability, *modal.Error)
Check performs a domain availability check using the WhoisFreaks API. It checks whether a specific domain name is available for registration.
Parameters:
- domain: The domain name to be checked for availability (e.g., "example.com").
Returns:
- *modal.DomainAvailability: A pointer to a DomainAvailability struct containing domain availability information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usage:
domainavailability.SetAPIKey("your_api_key_here")
domainAvailability, err := domainavailability.Check("example.com")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Domain Availability Info:", domainAvailability)
Domain Availability Check and Suggestion
func CheckAndSuggest(domain string, sug bool, count string) (*modal.BulkDomainAvailability, *modal.Error)
CheckAndSuggest performs a domain availability check and suggests similar domain names using the WhoisFreaks API.
Parameters:
- domain: The domain name to be checked for availability (e.g., "example.com").
- sug: A boolean flag indicating whether to suggest similar domain names.
- count: The number of suggested domain names to retrieve (valid only if sug is true).
Returns:
- *modal.BulkDomainAvailability: A pointer to a BulkDomainAvailability struct containing bulk domain availability information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usage:
domainavailability.SetAPIKey("your_api_key_here")
bulkDomainAvailability, err := domainavailability.CheckAndSuggest("example.com", true, "5")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Bulk Domain Availability Info:", bulkDomainAvailability)
DNS Lookup
This package is for performing any type of DNS lookup, such as live, historical, or reverse lookups.
Index
DNS Authentication Setup
DNS Historical Lookup
DNS Live Lookup
DNS Reverse Lookup
Functions
DNS Authentication Setup
func SetAPIKey(key string)
SetAPIKey sets the global API key to the specified value. It allows you to configure the API key used for authentication in your application.
Example usage:
dns.SetAPIKey("your_api_key_here")
Parameters:
- key: A string representing the API key to be set.
DNS Historical Lookup
func GetHistoricalResponse(dnsType, domain, page string) (*modal.HistoricalDnsInfo, *modal.Error)
GetHistoricalResponse
performs a historical DNS lookup using the WhoisFreaks API. It retrieves historical DNS information for a specific domain and DNS type.
Parameters:
- dnsType: The type of DNS record to look up (e.g., "A", "MX", "CNAME").
- domain: The domain name for which historical DNS information is requested.
- page: The optional page number for paginated results. Leave empty for the first page.
Returns:
- *modal.HistoricalDnsInfo: A pointer to a HistoricalDnsInfo struct containing historical DNS information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example Usage:
dns.SetAPIKey("your_api_key_here")
historicalDnsInfo, err := dns.GetHistoricalResponse("A", "example.com", "1")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Historical DNS Info:", historicalDnsInfo)
DNS Live Lookup
func GetLiveResponse(dnsType, domain string) (*modal.DNSInfo, *modal.Error)
GetLiveResponse
performs a live DNS lookup using the WhoisFreaks API. It retrieves real-time DNS information for a specific domain and DNS type.
Parameters:
- dnsType: The type of DNS record to look up (e.g., "A", "MX", "CNAME").
- domain: The domain name for which live DNS information is requested.
Returns:
- *modal.DNSInfo: A pointer to a DNSInfo struct containing live DNS information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example Usage:
dns.SetAPIKey("your_api_key_here")
dnsInfo, err := dns.GetLiveResponse("a", "example.com")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Live DNS Info:", dnsInfo)
DNS Reverse Lookup
func GetReverseResponse(dnsType, value, page string) (*modal.ReverseDnsInfo, *modal.Error)
GetReverseResponse
performs a reverse DNS lookup using the WhoisFreaks API.
Parameters:
- dnsType: The type of DNS record to look up (e.g., "a"). Multiple records are not supported.
- value: The IP address or value for which reverse DNS information is requested.
- page: The optional page number for paginated results. Leave empty for the first page.
Returns:
- *modal.ReverseDnsInfo: A pointer to a ReverseDnsInfo struct containing reverse DNS information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usages:
dns.SetAPIKey("your_api_key_here")
reverseDnsInfo, err := dns.GetReverseResponse("a", "8.8.8.8", "1")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Reverse DNS Info:", reverseDnsInfo)
dns.SetAPIKey("your_api_key_here")
reverseDnsInfo, err := dns.GetReverseResponse("mx", "mx.zoho.com", "1")
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Reverse DNS Info:", reverseDnsInfo)
SSL Lookup
This package is for performing any type of SSL lookup.
Index
SSL Authentication Setup
SSL Live Lookup
Functions
SSL Authentication Setup
func SetAPIKey(key string)
SetAPIKey sets the global API key to the specified value. It allows you to configure the API key used for authentication in your application.
Example usage:
ssl.SetAPIKey("your_api_key_here")
Parameters:
- key: A string representing the API key to be set.
SSL Live Lookup
func GetLiveResponse(domain string, chain bool, raw bool) (*modal.DomainSslInfo, *modal.Error)
GetLiveResponse retrieves live SSL information for a specific domain using the WhoisFreaks API.
Parameters:
- domain: The domain name for which live SSL information is requested (e.g., "example.com").
- chain: A boolean flag indicating whether to include SSL certificate chain information.
- raw: A boolean flag indicating whether to include raw SSL certificate information.
Returns:
- *modal.DomainSslInfo: A pointer to a DomainSslInfo struct containing live SSL information.
- *modal.Error: A pointer to an Error struct if there is an API error, or nil if the request is successful.
Example usage:
ssl.SetAPIKey("your_api_key_here")
sslInfo, err := ssl.GetLiveResponse("example.com", true, false)
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println("Live SSL Info:", sslInfo)
Documentation
¶
Overview ¶
Package whoisfreaks provides a client for using the Whoisfreaks APIs.
Usage:
import "github.com/WhoisFreaks/whoisfreaks/whois" import "github.com/WhoisFreaks/whoisfreaks/dns" import "github.com/WhoisFreaks/whoisfreaks/ssl" import "github.com/WhoisFreaks/whoisfreaks/domainavailability"
Authorization ¶
To perform authorized API calls, pass your apiKey to SetAPIKey method of the respective package. For example:
whois.SetAPIKey("your_api_key") dns.SetAPIKey("your_api_key") ssl.SetAPIKey("your_api_key") domainavailability.SetAPIKey("your_api_key")
For more detailed usage of whois, dns, ssl and domainavailability modules go through their documentation in Directories section.
Directories
¶
Path | Synopsis |
---|---|
This package is for performing any type of DNS lookup, such as live, historical, or reverse lookups.
|
This package is for performing any type of DNS lookup, such as live, historical, or reverse lookups. |
This package is for performing any type of Domain Availability lookup.
|
This package is for performing any type of Domain Availability lookup. |
This package contains Modals or types that will be useful for analyzing response from different available services.
|
This package contains Modals or types that will be useful for analyzing response from different available services. |
This package is for performing any type of SSL lookup.
|
This package is for performing any type of SSL lookup. |
This package is for performing any type of WHOIS lookup, such as live, historical, or reverse lookups.
|
This package is for performing any type of WHOIS lookup, such as live, historical, or reverse lookups. |