เอกสาร API
เอกสาร API สำหรับค้นหาโดเมน WHOIS และ RDAP แบบโปรแกรม ดึงข้อมูลการลงทะเบียน แปลงข้อมูลป้อนเข้าโดเมน และเรียกดูโดเมนล่าสุด
ค้นหาโดเมน
URL คำขอ
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 Bad Request
{
"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"
}
}404 Not Found
{
"code": 404,
"message": "Domain not found"
}429 Too Many Requests
{
"code": 429,
"message": "Rate limit exceeded, please try again later"
}500 Internal Server Error
{
"code": 500,
"message": "Query failed, please try again later"
}แปลงข้อมูลป้อนเข้าโดเมน
แปลงข้อมูลป้อนเข้าโดเมนในรูปแบบใดก็ได้ (URL, ซับโดเมน, IDN, ตัวพิมพ์ผสม) ให้เป็นโดเมนที่ลงทะเบียนได้ อินพุตแบบซับโดเมนจะส่งกลับ 200 พร้อม is_registrable: false โดยมีเพียงที่อยู่ IP, public suffix เปล่า ๆ และอินพุตที่แปลงไม่ได้เท่านั้นที่ส่งกลับ 400
URL คำขอ
GET https://whois.litelake.com/api/public/domain/parse?input={input}พารามิเตอร์
| พารามิเตอร์ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
| input | string | ใช่ | ข้อมูลป้อนเข้าโดเมนดิบในรูปแบบใดก็ได้ (URL, ซับโดเมน, IDN, ตัวพิมพ์ผสม) ส่งกลับโดเมนที่ลงทะเบียนได้หลังจัดรูปแบบแล้ว |
ตัวอย่างการตอบกลับ
{
"code": 200,
"message": "Parse successful",
"data": {
"input": "https://www.example.com/path?q=1",
"domain": "example.com",
"is_registrable": false
}
}การตอบกลับข้อผิดพลาด
400 Bad Request
{
"code": 400,
"message": "IP query is not supported: 1.2.3.4",
"data": {
"input": "1.2.3.4"
}
}