# 使用方法

### 接口地址

```
GET https://api.8i5.net/whois/whois.php?domain={domain}
```

### 请求方式

```
GET
```

### 调用参数

| 参数     | 类型     | 必填 | 描述                         |
| ------ | ------ | -- | -------------------------- |
| domain | string | 是  | 需要查询的域名，例如 `lilianhua.com` |

### 返回格式

响应格式为 JSON，包含域名的注册信息。

### 响应参数

| 字段     | 类型     | 描述                   |
| ------ | ------ | -------------------- |
| domain | string | 查询的域名                |
| whois  | string | 域名的 Whois 信息，包含多个子字段 |

#### Whois 字段说明

* **Domain Name**: 域名
* **Registry Domain ID**: 注册域的唯一标识
* **Registrar WHOIS Server**: 注册商的 WHOIS 服务器地址
* **Registrar URL**: 注册商的网站链接
* **Updated Date**: 最近更新日期
* **Creation Date**: 创建日期
* **Registry Expiry Date**: 过期日期
* **Registrar**: 注册商名称
* **Registrar IANA ID**: 注册商的 IANA 标识符
* **Registrar Abuse Contact Email**: 注册商的滥用联系邮箱
* **Registrar Abuse Contact Phone**: 注册商的滥用联系电话
* **Domain Status**: 域名状态
* **Name Server**: 域名服务器
* **DNSSEC**: DNSSEC 状态
* **URL of the ICANN Whois Inaccuracy Complaint Form**: ICANN Whois 不准确投诉表的链接
* **Last update of whois database**: Whois 数据库的最后更新时间

### 示例请求

```
GET https://api.8i5.net/whois/whois.php?domain=lilianhua.com
```

### 返回实例

```json
{
  "domain": "lilianhua.com",
  "whois": "Domain Name: LILIANHUA.COM\nRegistry Domain ID: 2931331037_DOMAIN_COM-VRSN\nRegistrar WHOIS Server: grs-whois.hichina.com\nRegistrar URL: http://wanwang.aliyun.com\nUpdated Date: 2024-11-03T23:20:51Z\nCreation Date: 2024-11-03T23:17:39Z\nRegistry Expiry Date: 2025-11-03T23:17:39Z\nRegistrar: Alibaba Cloud Computing Ltd. d/b/a HiChina (www.net.cn)\nRegistrar IANA ID: 1599\nRegistrar Abuse Contact Email: DomainAbuse@service.aliyun.com\nRegistrar Abuse Contact Phone: +86.95187\nDomain Status: ok https://icann.org/epp#ok\nName Server: DNS29.HICHINA.COM\nName Server: DNS30.HICHINA.COM\nDNSSEC: unsigned\nURL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/\n>>> Last update of whois database: 2025-04-17T02:39:22Z <<<"
}
```

### 错误的返回示例

#### 1. 域名未找到

```json
{
  "error": {
    "code": 404,
    "message": "Domain not found."
  }
}
```

#### 2. 请求参数无效

```json
{
  "error": {
    "code": 400,
    "message": "Invalid domain format."
  }
}
```

#### 3. 服务器错误

```json
{
  "error": {
    "code": 500,
    "message": "Internal server error."
  }
}
```

### 注意事项

* 返回的过期日期是注册商在注册库中设置的到期日期，可能与注册人协议的到期日期不同。
* 使用 Whois 数据仅限于合法目的，禁止高频率自动查询。违反条款可能导致访问限制。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-doc.8i5.net/whois-cha-xun/shi-yong-fang-fa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
