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/domain/availability?apiKey=API_KEY&domain=whoisfreaks.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 payload := strings.NewReader("{"domainNames":["jfreaks.pk","whoisfreaks.com"]}")
12 req, _ := http.NewRequest("POST", "https://api.whoisfreaks.com/v1.0/domain/availability?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 WhoisFreaks Go SDK enables you to check the availability status of domain names, helping developers determine whether a domain is available for registration. This feature supports domain acquisition, brand protection, and proactive management of digital assets by identifying potential domain opportunities.
This package is for performing any type of Domain Availability Lookup.
To utilize the WhoisFreaks Go SDK for checking the availability of domain names, 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.
Check performs a domain availability check using the WhoisFreaks API. It checks whether a specific domain name is available for registration.
func Check(domain string) (*modal.DomainAvailability, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/domainavailability"
)
func main() {
domainavailability.SetAPIKey("your_api_key")
domain := "example.com"
result, err := domainavailability.Check(domain)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace "example.com" with the domain you wish to check.
CheckAndSuggest performs a domain availability check and suggests similar domain names using the WhoisFreaks API.
func CheckAndSuggest(domain string, sug bool, count string) (*modal.BulkDomainAvailability, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/domainavailability"
)
func main() {
domainavailability.SetAPIKey("your_api_key")
domain := "example.com"
suggestions := true
count := "5" // Number of suggestions
result, err := domainavailability.CheckAndSuggest(domain, suggestions, count)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace "example.com" with the domain you wish to check, set suggestions to true to enable suggestions, and specify the number of suggestions with count.
Bulk performs a bulk domain availability check using the WhoisFreaks API. It checks the availability of multiple domain names in bulk.
func Bulk(domains []string) (*modal.BulkDomainAvailability, *modal.Error)Parameters:
Returns:
Example Usage:
package main
import (
"fmt"
"log"
"github.com/WhoisFreaks/whoisfreaks/domainavailability"
)
func main() {
domainavailability.SetAPIKey("your_api_key")
domains := []string{"example1.com", "example2.com", "example3.com"}
result, err := domainavailability.Bulk(domains)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)
}Replace the domain names in the domains slice with the domains you wish to check.
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