API 文件
程式化 WHOIS 與 RDAP 域名查詢的 API 文件:查詢註冊資料、解析域名輸入,並瀏覽最新收錄域名。
域名查詢
請求位址
GET https://whois.litelake.com/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"
}不可註冊的輸入(子域名、網址)會回傳 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"
}
}404 未找到
{
"code": 404,
"message": "Domain not found"
}429 請求過多
{
"code": 429,
"message": "Rate limit exceeded, please try again later"
}500 伺服器錯誤
{
"code": 500,
"message": "Query failed, please try again later"
}域名輸入解析
將任何形式的域名輸入(網址、子域名、國際化域名、大小寫混用)標準化為可註冊域名。子域名輸入會回傳 200 與 is_registrable: false;只有 IP 位址、裸公共後綴及無法解析的輸入會回傳 400。
請求位址
GET https://whois.litelake.com/api/public/domain/parse?input={input}參數
| 參數 | 類型 | 必填 | 說明 |
|---|---|---|---|
| input | string | 是 | 任何形式的原始域名輸入(網址、子域名、國際化域名、大小寫混用)。回傳標準化後的可註冊域名。 |
回應範例
{
"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"
}
}