https://github.com/whois-api-llc/go-email-verifier
Email Verification API client library for Go
https://github.com/whois-api-llc/go-email-verifier
email email-verification go golang verification whoisxmlapi
Last synced: about 1 year ago
JSON representation
Email Verification API client library for Go
- Host: GitHub
- URL: https://github.com/whois-api-llc/go-email-verifier
- Owner: whois-api-llc
- License: mit
- Created: 2022-05-12T09:15:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-12T09:33:07.000Z (about 4 years ago)
- Last Synced: 2025-01-25T21:27:58.807Z (over 1 year ago)
- Topics: email, email-verification, go, golang, verification, whoisxmlapi
- Language: Go
- Homepage: https://emailverification.whoisxmlapi.com/api
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://opensource.org/licenses/MIT)
[](https://pkg.go.dev/github.com/whois-api-llc/go-email-verifier)
[](https://github.com/whois-api-llc/go-email-verifier/actions/)
# Overview
The client library for
[Email Verification API](https://emailverification.whoisxmlapi.com)
in Go language.
The minimum go version is 1.17.
# Installation
The library is distributed as a Go module
```bash
go get github.com/whois-api-llc/go-email-verifier
```
# Examples
Full API documentation available [here](https://emailverification.whoisxmlapi.com/api/documentation/making-requests)
You can find all examples in `example` directory.
## Create a new client
To start making requests you need the API Key.
You can find it on your profile page on [whoisxmlapi.com](https://whoisxmlapi.com/).
Using the API Key you can create Client.
Most users will be fine with `NewBasicClient` function.
```go
client := emailverifier.NewBasicClient(apiKey)
```
If you want to set custom `http.Client` to use proxy then you can use `NewClient` function.
```go
transport := &http.Transport{Proxy: http.ProxyURL(proxyUrl)}
client := emailverifier.NewClient(apiKey, emailverifier.ClientParams{
HTTPClient: &http.Client{
Transport: transport,
Timeout: 20 * time.Second,
},
})
```
## Make basic requests
Email Verification API performs a comprehensive validation of email addresses in real-time and conveniently.
```go
// Make request to get parsed Email Verification API response
evapiResp, _, err := client.EvapiService.Get(context.Background(), "support@whoisxmlapi.com")
if err != nil {
log.Fatal(err)
}
// Check if an email address is valid
if !*evapiResp.FormatCheck {
log.Printf("\"%s\" is invalid email address", evapiResp.EmailAddress)
}
// Make request to get raw Email Verification API data
resp, err := client.EvapiService.GetRaw(ctx, "whoisxmlapi.com")
if err != nil {
log.Fatal(err)
}
log.Println(string(resp.Body))
```