2020-05-24 18:42:01 +02:00
# WhoisParser
2019-12-22 18:20:45 +01:00
[![License ](https://img.shields.io/badge/license-Apache%202.0-blue.svg )](LICENSE)
2021-11-12 12:28:10 +01:00
[![GoDoc ](https://pkg.go.dev/badge/github.com/likexian/whois-parser.svg )](https://pkg.go.dev/github.com/likexian/whois-parser)
[![Go Report Card ](https://goreportcard.com/badge/github.com/likexian/whois-parser )](https://goreportcard.com/report/github.com/likexian/whois-parser)
[![Build Status ](https://github.com/likexian/whois-parser/actions/workflows/gotest.yaml/badge.svg )](https://github.com/likexian/whois-parser/actions/workflows/gotest.yaml)
[![Code Cover ](https://release.likexian.com/whois-parser/coverage.svg )](https://github.com/likexian/whois-parser/actions/workflows/gotest.yaml)
2019-12-22 18:20:45 +01:00
2021-11-12 12:28:10 +01:00
WhoisParser is a simple Go module for domain whois information parsing.
2019-12-22 18:20:45 +01:00
## Overview
2021-11-12 12:28:10 +01:00
This module parses the provided domain whois information and returns a readable data struct.
2019-12-22 18:20:45 +01:00
## Verified Extensions
2021-11-12 12:28:10 +01:00
It is supposed to be working with all domain extensions, but [verified extensions ](testdata/noterror/README.md ) must works, because I have checked them one by one manually.
2019-12-22 18:20:45 +01:00
2021-11-12 12:28:10 +01:00
If there is any problem, please feel free to open a new issue.
2019-12-22 18:20:45 +01:00
2020-05-24 18:42:01 +02:00
## Binary distributions
2021-11-12 12:28:10 +01:00
For binary distributions of whois information query and parsing, please download [whois release tool ](https://github.com/likexian/whois/tree/master/cmd/whois ).
2020-05-24 18:42:01 +02:00
2019-12-22 18:20:45 +01:00
## Installation
2020-05-24 18:42:01 +02:00
```shell
2021-11-12 12:28:10 +01:00
go get github.com/likexian/whois-parser
2020-05-24 18:42:01 +02:00
```
2019-12-22 18:20:45 +01:00
## Importing
2020-05-24 18:42:01 +02:00
```go
import (
2021-11-12 12:28:10 +01:00
"github.com/likexian/whois-parser"
2020-05-24 18:42:01 +02:00
)
```
2019-12-22 18:20:45 +01:00
## Documentation
2021-11-12 12:28:10 +01:00
Visit the docs on [GoDoc ](https://pkg.go.dev/github.com/likexian/whois-parser )
2019-12-22 18:20:45 +01:00
## Example
```go
result, err := whoisparser.Parse(whois_raw)
if err == nil {
// Print the domain status
fmt.Println(result.Domain.Status)
// Print the domain created date
fmt.Println(result.Domain.CreatedDate)
// Print the domain expiration date
fmt.Println(result.Domain.ExpirationDate)
// Print the registrar name
fmt.Println(result.Registrar.Name)
// Print the registrant name
fmt.Println(result.Registrant.Name)
// Print the registrant email address
fmt.Println(result.Registrant.Email)
}
```
2020-05-24 18:42:01 +02:00
## Whois information query
2019-12-22 18:20:45 +01:00
2021-11-12 12:28:10 +01:00
Please refer to [whois ](https://github.com/likexian/whois )
2019-12-22 18:20:45 +01:00
2020-05-24 18:42:01 +02:00
## License
2019-12-22 18:20:45 +01:00
2022-08-18 01:16:43 +02:00
Copyright 2014-2022 [Li Kexian ](https://www.likexian.com/ )
2019-12-22 18:20:45 +01:00
Licensed under the Apache License 2.0
2020-05-24 18:42:01 +02:00
## Donation
2019-12-22 18:20:45 +01:00
2020-05-24 18:42:01 +02:00
If this project is helpful, please share it with friends.
2019-12-22 18:20:45 +01:00
2020-05-24 18:42:01 +02:00
If you want to thank me, you can [give me a cup of coffee ](https://www.likexian.com/donate/ ).