API
API 文档
面向程序化 WHOIS 与 RDAP 域名查询的 API 文档:查询注册数据、解析域名输入并浏览最新域名。
域名查询
请求地址
GET https://whois.litelake.cn/api/public/whois?domain={domain}
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| domain | string | 是 | 要查询的域名(例如 example.com) |
| force_refresh | boolean | 否 | 强制刷新缓存数据 |
响应示例
{
"code": 200,
"message": "Query successful",
"data": {
"domain": "example.com",
"tld": "com",
"registrar": "Example Registrar, Inc.",
"registry_domain_id": "123456789_DOMAIN_COM-VRSN",
"created_date": "1995-08-14T04:00:00Z",
"updated_date": "2023-08-14T04:00:00Z",
"expiry_date": "2024-08-13T04:00:00Z",
"status": ["clientTransferProhibited"],
"name_servers": ["ns1.example.com", "ns2.example.com"],
"query_count": 150,
"last_queried_at": "2024-03-05T12:34:56Z"
}
}错误响应
400 请求错误
{
"code": 400,
"message": "Missing domain parameter"
}不可注册的输入(子域名、URL)将返回 400,并附带 suggested_domain 修正提示:
{
"code": 400,
"message": "invalid registrable domain: www.example.com, did you mean: example.com?",
"data": {
"input": "www.example.com",
"suggested_domain": "example.com"
}
}400 Unsupported TLD
{
"code": 400,
"message": "Unsupported TLD: be",
"data": {
"reason": "UNSUPPORTED_TLD",
"tld": "be"
}
}该后缀没有 RDAP 服务器,WHOIS 也不支持;这是永久结果,不要重试。
404 未找到
{
"code": 404,
"message": "Domain not found"
}429 请求过多
429 表示调用方超出配额:公共 IP 档(30 次/分钟/IP)或 API Key 每分钟限额;不是上游 WHOIS/RDAP 限流。
// Public IP tier (framework envelope)
{
"error": "Too many requests, please try again after 1m0s",
"code": "RATE_LIMIT_EXCEEDED"
}// API key tier (Retry-After: 60)
{
"code": 429,
"message": "API key rate limit exceeded, please try again later",
"data": {
"reason": "RATE_LIMITED_API_KEY"
}
}503 Service Unavailable
该域名近期失败,被负缓存临时拦截(5 分钟窗口);按响应指示的延迟重试。
{
"code": 503,
"message": "Query temporarily unavailable after a recent failure, please retry later",
"data": {
"reason": "QUERY_TEMPORARILY_BLOCKED",
"retry_after_seconds": 60
}
}500 服务器错误
{
"code": 500,
"message": "Query failed, please try again later"
}域名输入解析
将任何形式的域名输入(URL、子域名、国际化域名、大小写混合)规范化为可注册域名。子域名输入返回 200 及 is_registrable: false;仅 IP 地址、裸公共后缀和无法解析的输入返回 400。
请求地址
GET https://whois.litelake.cn/api/public/domain/parse?input={input}
参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| input | string | 是 | 任意形式的原始域名输入(URL、子域名、国际化域名、大小写混合)。返回规范化后的可注册域名。 |
响应示例
{
"code": 200,
"message": "Parse successful",
"data": {
"input": "https://www.example.com/path?q=1",
"domain": "example.com",
"is_registrable": false
}
}错误响应
400 请求错误
{
"code": 400,
"message": "IP query is not supported: 1.2.3.4",
"data": {
"input": "1.2.3.4"
}
}