---
title: "Go SDK Integration | WhoisFreaks"
slug: "/integrations/sdk/go"
description: "Integrate WhoisFreaks APIs quickly with the Go SDK. Access Whois, DNS Checker, SSL Certificate, and Domain Availability APIs using Go code examples."
---

# GO SDK Integration

## Whois API

## Best WHOIS Lookup SDK: Integrate WhoisFreaks APIs using Go

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.

### How to perform WHOIS lookup(s) in go?

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:

#### 1. WHOIS Authentication Setup

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.

go

```go
func SetAPIKey(key string)
```

Parameters:

1.  **key:** A string representing the API key to be set.

Example Usage:

go

```go
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.

#### 2. WHOIS Live Lookup

**GetLiveResponse** retrieves live WHOIS information for a specific domain using the WhoisFreaks API.

go

```go
func GetLiveResponse(domain string) (*modal.DomainInfo, *modal.Error)
```

Parameters:

1.  **domain:** The domain name for which live WHOIS information is requested (e.g., "example.com").

Returns:

1.  ***modal.DomainInfo:** A pointer to a DomainInfo struct containing live domain information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
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.

#### 3. WHOIS Bulk Live Lookup

**GetBulkLiveResponse** retrieves live WHOIS information for multiple domains in bulk using the WhoisFreaks API.

go

```go
func GetBulkLiveResponse(domains []string) (*modal.BulkDomainInfo, *modal.Error)
```

Parameters:

1.  **domains:** A slice of strings containing the domain names for which live WHOIS information is requested.

Returns:

1.  ***modal.BulkDomainInfo:** A pointer to a BulkDomainInfo struct containing live domain information for the bulk request.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
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.

#### 4. WHOIS Historical Lookup

**GetHistoricalResponse** retrieves historical WHOIS information using the WhoisFreaks API.

go

```go
func GetHistoricalResponse(domain string) (*modal.HistoricalDomainInfo, *modal.Error)
```

Parameters:

1.  **domain:** The domain name for which historical WHOIS information is requested (e.g., "example.com").

Returns:

1.  ***modal.HistoricalDomainInfo:** A pointer to a HistoricalDomainInfo struct containing historical domain information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
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.

#### 5. WHOIS Reverse Lookup

**GetReverseResponse** performs a reverse WHOIS lookup using the WhoisFreaks API.

go

```go
func GetReverseResponse(keyword, email, company, owner, page string) (*modal.ReverseDomainInfo, *modal.Error)
```

Parameters:

1.  **keyword:** The keyword to search for in domain records.
2.  **email:** The email address to search for in domain records.
3.  **company:** The company name to search for in domain records.
4.  **owner:** The owner name to search for in domain records.
5.  **page:** The optional page number for paginated results. Leave empty for the first page.

Returns:

1.  ***modal.ReverseDomainInfo:** A pointer to a ReverseDomainInfo struct containing reverse WHOIS information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
package main

import (
    "fmt"
    "log"
    "github.com/WhoisFreaks/whoisfreaks/whois"
)

func main() {
    whois.SetAPIKey("your_api_key")

    keyword := "whoisfreaks"
    email := "email@example.com"
    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**.

#### 6. WHOIS Reverse Mini Lookup

**GetReverseMiniResponse** performs a reverse WHOIS lookup in mini mode using the WhoisFreaks API.

go

```go
func GetReverseMiniResponse(keyword, email, company, owner, page string) (*modal.ReverseMiniDomainInfo, *modal.Error)
```

Parameters:

1.  **keyword:** The keyword to search for in domain records.
2.  **email:** The email address to search for in domain records.
3.  **company:** The company name to search for in domain records.
4.  **owner:** The owner name to search for in domain records.
5.  **page:** The optional page number for paginated results. Leave empty for the first page.

Returns:

1.  ***modal.ReverseMiniDomainInfo:** A pointer to a ReverseMiniDomainInfo struct containing reverse WHOIS information in mini mode.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
package main

import (
    "fmt"
    "log"
    "github.com/WhoisFreaks/whoisfreaks/whois"
)

func main() {
    whois.SetAPIKey("your_api_key")

    keyword := "whoisfreaks"
    email := "email@example.com"
    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**.

## DNS Checker API

## Best DNS Lookup SDK: Seamlessly Integrate WhoisFreaks APIs with Go

The SDK allows you to perform live, historical, and reverse DNS lookups. You can retrieve comprehensive domain name system records, which are essential for network analysis, troubleshooting, and ensuring proper domain configurations. This feature is ideal for developers managing DNS data and conducting network diagnostics.

### DNS Lookups

This package is for performing any type of DNS lookup, such as live, historical, or reverse lookups.  
To utilize the WhoisFreaks Go SDK for DNS Lookups of domain names or IP addresses, follow these steps:

#### 1. DNS Authentication Setup

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.

go

```go
func SetAPIKey(key string)
```

Parameters:

1.  **key:** A string representing the API key to be set.

Example Usage:

go

```go
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.

#### 2. DNS Live Lookup

**GetLiveResponse** performs a live DNS lookup using the WhoisFreaks API. It retrieves real-time DNS information for a specific domain and DNS type.

go

```go
func GetLiveResponse(dnsType, domain string) (*modal.DNSInfo, *modal.Error)
```

Parameters:

1.  **dnsType:** The type of DNS record to look up (e.g., "A", "MX", "CNAME", "AAAA", "NS", "TXT", "SOA", "SPF").
2.  **domain:** The domain name for which live DNS information is requested.

Returns:

1.  ***modal.DNSInfo:** A pointer to a DNSInfo struct containing live DNS information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
package main

import (
    "fmt"
    "log"
    "github.com/WhoisFreaks/whoisfreaks/dns"
)

func main() {
    dns.SetAPIKey("your_api_key")

    domain := "example.com"
    dnsType := "A" // Replace with desired DNS record type (e.g., "A", "MX", "CNAME", "AAAA", "NS", "TXT", "SOA", "SPF")

    result, err := dns.GetLiveResponse(dnsType, domain)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(result)
}
```

Replace **domain** with the domain you wish to query and **dnsType** with the desired DNS record type (e.g., "A", "MX", "CNAME").

#### 3. DNS Historical Lookup

**GetHistoricalResponse** performs a historical DNS lookup using the WhoisFreaks API. It retrieves historical DNS information for a specific domain and DNS type.

go

```go
func GetHistoricalResponse(dnsType, domain, page string) (*modal.HistoricalDnsInfo, *modal.Error)
```

Parameters:

1.  **dnsType:** The type of DNS record to look up (e.g., "A", "MX", "CNAME", "AAAA", "NS", "TXT", "SOA", "SPF").
2.  **domain:** The domain name for which historical DNS information is requested.
3.  **page:** The optional page number for paginated results. Leave empty for the first page.

Returns:

1.  ***modal.HistoricalDnsInfo:** A pointer to a HistoricalDnsInfo struct containing historical DNS information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
package main

import (
    "fmt"
    "log"
    "github.com/WhoisFreaks/whoisfreaks/dns"
)

func main() {
    dns.SetAPIKey("your_api_key")

    domain := "example.com"
    dnsType := "A" // Replace with desired DNS record type
    page := "1"     // Optional: specify the page number for paginated results

    result, err := dns.GetHistoricalResponse(dnsType, domain, page)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(result)
}
```

Replace **"example.com"** with the domain you wish to query, adjust **dnsType** as needed, and specify the **page** number if necessary.

#### 4. DNS Reverse Lookup

**GetReverseResponse** performs a reverse DNS lookup using the WhoisFreaks API.

go

```go
func GetReverseResponse(dnsType, value, page string) (*modal.ReverseDnsInfo, *modal.Error)
```

Parameters:

1.  **dnsType:** The type of DNS record to look up (e.g., "a"). Multiple records are not supported.
2.  **value:** The IP address or value for which reverse DNS information is requested.
3.  **page:** The optional page number for paginated results. Leave empty for the first page.

Returns:

1.  ***modal.ReverseDnsInfo:** A pointer to a ReverseDnsInfo struct containing reverse DNS information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
package main

import (
    "fmt"
    "log"
    "github.com/WhoisFreaks/whoisfreaks/dns"
)

func main() {
    dns.SetAPIKey("your_api_key")
    ipAddress := "8.8.8.8" // Replace with the IP address you wish to query
    dnsType := "A"         // Replace with desired DNS record type
    page := "1"            // Optional: specify the page number for paginated results
    result, err := dns.GetReverseResponse(dnsType, ipAddress, page)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(result)
}
```

Replace **"8.8.8.8"** with the IP address you wish to query, adjust **dnsType** as needed, and specify the **page** number if necessary.

## SSL Certificate API

## SSL Lookup SDK: Integrate WhoisFreaks APIs with Go

With the WhoisFreaks Go SDK, you can retrieve SSL certificate details for any domain. This includes information about the certificate's validity, issuer, and other critical details, allowing you to ensure secure communications and verify the authenticity of websites. This feature is vital for securing online transactions and maintaining web security.

### SSL Lookup

This package is for performing any type of SSL lookup.  
To utilize the WhoisFreaks Go SDK for SSL Lookup of domain names, follow these steps:

#### 1. DNS Authentication Setup

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.

go

```go
func SetAPIKey(key string)
```

Parameters:

1.  **key:** A string representing the API key to be set.

Example Usage:

go

```go
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.

#### 2. SSL Live Lookup

**GetLiveResponse** retrieves live SSL information for a specific domain using the WhoisFreaks API.

go

```go
func GetLiveResponse(domain string, chain bool, raw bool) (*modal.DomainSslInfo, *modal.Error)
```

Parameters:

1.  **domain:** The domain name for which live SSL information is requested (e.g., "example.com").
2.  **chain:** A boolean flag indicating whether to include SSL certificate chain information.
3.  **raw:** A boolean flag indicating whether to include raw SSL certificate information.

Returns:

1.  ***modal.DomainSslInfo:** A pointer to a DomainSslInfo struct containing live SSL information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
package main

import (
    "fmt"
    "log"
    "github.com/WhoisFreaks/whoisfreaks/ssl"
)

func main() {
    ssl.SetAPIKey("your_api_key")
    domain := "example.com"
    result, err := ssl.GetLiveResponse(domain)
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(result)
}
```

Replace **"example.com"** with the domain you wish to query.

## Domain Availability API

## Domain Availability Lookup SDK: Integrate WhoisFreaks APIs using Go

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.

### Domain Availability Lookup

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:

#### 1. Domain Availability Authentication Setup

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.

go

```go
func SetAPIKey(key string)
```

Parameters:

1.  **key:** A string representing the API key to be set.

Example Usage:

go

```go
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.

#### 2. Domain Availability Check

**Check** performs a domain availability check using the WhoisFreaks API. It checks whether a specific domain name is available for registration.

go

```go
func Check(domain string) (*modal.DomainAvailability, *modal.Error)
```

Parameters:

1.  **domain:** The domain name to be checked for availability (e.g., "example.com").

Returns:

1.  ***modal.DomainAvailability:** A pointer to a DomainAvailability struct containing domain availability information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
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.

#### 3. Domain Availability Check and Suggestion

**CheckAndSuggest** performs a domain availability check and suggests similar domain names using the WhoisFreaks API.

go

```go
func CheckAndSuggest(domain string, sug bool, count string) (*modal.BulkDomainAvailability, *modal.Error)
```

Parameters:

1.  **domain:** The domain name to be checked for availability (e.g., "example.com").
2.  **sug:** A boolean flag indicating whether to suggest similar domain names.
3.  **count:** The number of suggested domain names to retrieve (valid only if sug is true).

Returns:

1.  ***modal.DomainAvailability:** A pointer to a DomainAvailability struct containing domain availability information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
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**.

#### 4. Bulk Domain Availability Lookup

**Bulk** performs a bulk domain availability check using the WhoisFreaks API. It checks the availability of multiple domain names in bulk.

go

```go
func Bulk(domains []string) (*modal.BulkDomainAvailability, *modal.Error)
```

Parameters:

1.  **domains:** A slice of strings containing the domain names to be checked for availability.

Returns:

1.  ***modal.BulkDomainAvailability:** A pointer to a BulkDomainAvailability struct containing bulk domain availability information.
2.  ***modal.Error:** A pointer to an Error struct if there is an API error, or nil if the request is successful.

Example Usage:

go

```go
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.
