1package main
2
3import (
4 "fmt"
5 "net/http"
6 "strings"
7 "io/ioutil"
8)
9
10func main() {
11 var payload *strings.Reader = nil
12 req, _ := http.NewRequest("GET", "https://api.whoisfreaks.com/v1.0/whois?apiKey=API_KEY&whois=live&domainName=google.com", payload)
13 client := &http.Client{}
14 resp, _ := client.Do(req)
15 defer resp.Body.Close()
16 body, _ := ioutil.ReadAll(resp.Body)
17 fmt.Println(string(body))
18}1package main
2
3import (
4 "fmt"
5 "net/http"
6 "strings"
7 "io/ioutil"
8)
9
10func main() {
11 var payload *strings.Reader = nil
12 req, _ := http.NewRequest("GET", "https://api.whoisfreaks.com/v1.0/whois?apiKey=API_KEY&whois=historical&domainName=google.com", payload)
13 client := &http.Client{}
14 resp, _ := client.Do(req)
15 defer resp.Body.Close()
16 body, _ := ioutil.ReadAll(resp.Body)
17 fmt.Println(string(body))
18}1package main
2
3import (
4 "fmt"
5 "net/http"
6 "strings"
7 "io/ioutil"
8)
9
10func main() {
11 var payload *strings.Reader = nil
12 req, _ := http.NewRequest("GET", "https://api.whoisfreaks.com/v1.0/whois?apiKey=API_KEY&whois=reverse&keyword=youtube", payload)
13 client := &http.Client{}
14 resp, _ := client.Do(req)
15 defer resp.Body.Close()
16 body, _ := ioutil.ReadAll(resp.Body)
17 fmt.Println(string(body))
18}1package main
2
3import (
4 "fmt"
5 "net/http"
6 "strings"
7 "io/ioutil"
8)
9
10func main() {
11 payload := strings.NewReader("{"domainNames": ["amazon.ch","google.com","whoisfreaks.com","nic.dev","news.si"]}")
12 req, _ := http.NewRequest("GET", "https://api.whoisfreaks.com/v1.0/bulkwhois?apiKey=API_KEY", payload)
13 req.Header.Set("Content-Type", "application/json")
14 client := &http.Client{}
15 resp, _ := client.Do(req)
16 defer resp.Body.Close()
17 body, _ := ioutil.ReadAll(resp.Body)
18 fmt.Println(string(body))
19}The WHOIS Go Lang SDK of WhoisFreaks provides powerful WHOIS lookup capabilities, enabling developers to retrieve live and historical WHOIS data. With this feature, you can access detailed domain registration information, track ownership history, and gain insights into domain changes, making it a key tool for domain analysis and cybersecurity.
Go Whois SDK package allows you to perform various types of WHOIS lookups, including live, historical, and reverse lookups.
To use the WhoisFreaks Go SDK for WHOIS lookups, follow these steps:
To authenticate your API requests, set your API key using the SetAPIKey method provided by the SDK. This method sets the global API key to the specified value.
func SetAPIKey(key string)Parameters:
Example Usage:
package main
import (
"github.com/WhoisFreaks/whoisfreaks/whois"
)
func main() {
whois.SetAPIKey("your_api_key")
// Your code here
}Replace "your_api_key" with your actual API key.
GetLiveResponse retrieves live WHOIS information for a specific domain using the WhoisFreaks API.
func GetLiveResponse(domain string) (*modal.DomainInfo, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/whois"
)
func main() {
whois.SetAPIKey("your_api_key")
domain := "example.com"
result, err := whois.LiveLookup(domain)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace "example.com" with the domain you wish to query.
GetBulkLiveResponse retrieves live WHOIS information for multiple domains in bulk using the WhoisFreaks API.
func GetBulkLiveResponse(domains []string) (*modal.BulkDomainInfo, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/whois"
)
func main() {
whois.SetAPIKey("your_api_key")
domains := []string{"example1.com", "example2.com", "example3.com"}
results, err := whois.BulkLiveLookup(domains)
if err != nil {
log.Fatal(err)
}
for _, result := range results {
fmt.Println(result)
}
}Replace the domain names in the domains slice with the domains you wish to query.
GetHistoricalResponse retrieves historical WHOIS information using the WhoisFreaks API.
func GetHistoricalResponse(domain string) (*modal.HistoricalDomainInfo, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/whois"
)
func main() {
whois.SetAPIKey("your_api_key")
domain := "example.com"
result, err := whois.HistoricalLookup(domain)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace "example.com" with the domain you wish to query.
GetReverseResponse performs a reverse whois lookup using the WhoisFreaks API.
func GetReverseResponse(keyword, email, company, owner, page string) (*modal.ReverseDomainInfo, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/whois"
)
func main() {
whois.SetAPIKey("your_api_key")
keyword := "whoisfreaks"
email := "[email protected]"
owner := "elon"
company := "google"
page := "2"
result, err := whois.GetReverseResponse(keyword, email, company, owner, page)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace keyword, email, owner, company, and page with the desired keyword, email address, owner name, company name, and page number, respectively.
GetReverseMiniResponse performs a reverse whois lookup in mini mode using the WhoisFreaks API.
func GetReverseMiniResponse(keyword, email, company, owner, page string) (*modal.ReverseMiniDomainInfo, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/whois"
)
func main() {
whois.SetAPIKey("your_api_key")
keyword := "whoisfreaks"
email := "[email protected]"
owner := "elon"
company := "google"
page := "2"
result, err := whois.GetReverseMiniResponse(keyword, email, company, owner, page)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace keyword, email, owner, company, and page with the desired keyword, email address, owner name, company name, and page number, respectively.
Offers live, reverse, historical, IP, ASN, and bulk domain WHOIS lookups.
Provides live, reverse, historical, and bulk DNS lookup services.
Checks domain availability across TLDs and suggests alternatives.
Performs SSL lookup and shows certificate chain from start to present.

Leverage this Go Lang-based SDK and CLI tool to interact with the WhoisFreaks API seamlessly.
pkg.go.dev