接口标识: Whois 接口状态: 正常 模块状态: 正常 数据来源: 自营 计费模式: 按次 免KEY调用: 不允许 所属分类: 站长工具 (开通后可享无并发限制, 及KEY相关功能设置)
接口地址:
返回格式:
请求方式:
请求示例:
域名Whois查询 域名Whois查询api Whois查询 全球Whois查询 全球Whois查询接口
请求参数:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
返回参数:
名称 | 类型 | 说明 |
---|---|---|
返回示例:
API响应码:
名称 | 类型 | 响应码 | 说明 | 解决方案 |
---|---|---|---|---|
code | String | 1 | 查询成功 | 查询成功直接返回Whois信息 |
code | String | 0 | 查询失败 | 重新发起请求,一般是因为请求Whois服务器超时 |
code | String | 11001 | 参数不可为空 | 查看文档获取完整参数 |
code | String | 11002 | 根域名格式错误 | 参数不正确,同上 |
code | String | 11003 | 暂不支持此域名后缀查询 | 检查查询的域名后缀是否为真实存在 |
code | String | 11004 | 参数识别失败 | 无法识别当前请求的参数,换参数尝试一下 |
系统响应码:
名称 | 类型 | 响应码 | 说明 | 解决方案 |
code | String | 10001 | 域名效验失败 | 请求了错误的域名,检查请求域名是否正确 |
code | String | 10002 | 请求被拒绝 | 可能是你的IP、参数、来源 不在允许范围内 |
code | String | 10003 | 调用服务已关闭 | 管理员暂时关闭了调用功能,可能是在维护 |
code | String | 10004 | 接口不存在 | 接口不存在,检查请求接口URL |
code | String | 10005 | 引导缺失 | 接口未完善,或者接口内部错误。这种情况一般联系管理员解决 |
code | String | 10006 | 接口调试中 | 接口上架前的调试,一般这种情况不超过1个小时即可恢复 |
code | String | 10007 | 接口维护中 | 接口正在维护 |
code | String | 10008 | 接口状态未知 | 检查KEY状态,或者查看接口状态 |
code | String | 10009 | 需要KEY | 注册免费开通即可获取相应KEY |
code | String | 10010 | 无效KEY | 检查KEY是否正确,登录控制台获取正确的KEY |
code | String | 10011 | 请求过于频繁 | 请求并发高出系统限制,(无KEY请求 10秒10次,有KEY请求10秒100次) |
code | String | 10012 | 账户被禁用 | 一般不会出现这种情况,如果你遇到恭喜你! |
code | String | 10013 | 该KEY已过期 | KEY过期了,登录控制台续费 |
code | String | 10014 | 该KEY被开发者禁用 | KEY被开发者禁用了,登录控制台打开 |
code | String | 10015 | 该KEY被管理员禁用 | 可能出现违规调用,KEY被管理员禁用了 |
code | String | 10016 | 该KEY状态未知 | 登录控制台检查KEY状态 |
code | String | 10017 | 没有可用次数 | KEY是按次计费,没有可用次数了,登录控制台续费 |
code | String | 10018 | 开发者启用请求规则限制 | 开发者启用了请求规则限制,登录控制台查看请求请求规则设置 |
code | String | 10019 | 未指定模块 | 请求接口地址不完整,只带了接口标识,没有带模块标识,查看文档获取正确的URL |
code | String | 10020 | 模块不存在 | 请求地址错误,带的模块标识是错误的,查看文档获取正确的模块标识 |
code | String | 10021 | 模块维护中 | 只维护当前模块。如果接口存在多个模块 不会影响其他模块 |
code | String | 10022 | 接口内部错误 | 检查请求参数是否合法,尝试换个请求参数,如果持续性不行,请联系我们 |
#1: 10开头 为系统级响应码 、11开头 为API模块级响应码。后面数字代表具体位置
代码示例:
C#
//using System.IO;
//using System.Text;
//using System.Net;
//using System.Net.Security;
//using System.Security.Cryptography.X509Certificates;
private const String apiurl = "https://u.api.chuaini.com/api/v2/"; //统一请求URL无需修改
private const String alias = "Whois/query"; //接口唯一标识/模块
private const String key = "KEY"; //自己的KEY
private const String method = "GET";
static void Main(string[] args)
{
String params = "&domain=qq.net"; //参数
String bodys = "";
String url = apiurl + alias;
HttpWebRequest httpRequest = null;
HttpWebResponse httpResponse = null;
if (0 < params.Length)
{
url = url + "?key="+ key + params;
}
if (apiurl.Contains("https://"))
{
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
}
else
{
httpRequest = (HttpWebRequest)WebRequest.Create(url);
}
httpRequest.Method = method;
if (0 < bodys.Length)
{
byte[] data = Encoding.UTF8.GetBytes(bodys);
using (Stream stream = httpRequest.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
}
try
{
httpResponse = (HttpWebResponse)httpRequest.GetResponse();
}
catch (WebException ex)
{
httpResponse = (HttpWebResponse)ex.Response;
}
Console.WriteLine(httpResponse.StatusCode);
Console.WriteLine(httpResponse.Method);
Console.WriteLine(httpResponse.Headers);
Stream st = httpResponse.GetResponseStream();
StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
Console.WriteLine(reader.ReadToEnd());
Console.WriteLine("\n");
}
public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
}
PHP
<?php
$apiurl = "https://u.api.chuaini.com/api/v2/"; //统一请求URL无需修改
$alias = "Whois/query"; //接口唯一标识/模块
$key = "KEY"; //自己的KEY
$method = "GET";
$headers = array();
$params = "&domain=qq.net"; //参数
$bodys = "";
$url = $apiurl . $alias . "?key=" .$key. $params;
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
if (1 == strpos("$".$apiurl, "https://"))
{
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
print_r(curl_exec($curl));
?>
Python
import urllib, urllib2, sys
import ssl
apiurl = 'https://u.api.chuaini.com/api/v2/' //统一请求URL无需修改
alias = 'Whois/query' //接口唯一标识/模块
key = 'KEY' //自己的KEY
params = '&domain=qq.net' //参数
method = 'GET'
bodys = {}
url = apiurl + alias + '?key=' + key + params
request = urllib2.Request(url)
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urllib2.urlopen(request, context=ctx)
content = response.read()
if (content):
print(content)
ObjectC
NSString *apiurl = @"https://u.api.chuaini.com/api/v2/"; //统一请求URL无需修改
NSString *alias = @"Whois/query"; //接口唯一标识/模块
NSString *key = @"?KEY"; //自己的KEY
NSString *params = @"&domain=qq.net"; //参数
NSString *method = @"GET";
NSString *url = [NSString stringWithFormat:@"%@%@%@", apiurl, alias ,key , params];
NSString *bodys = @"";
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString: url] cachePolicy:1 timeoutInterval: 5];
request.HTTPMethod = method;
NSURLSession *requestSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSURLSessionDataTask *task = [requestSession dataTaskWithRequest:request
completionHandler:^(NSData * _Nullable body , NSURLResponse * _Nullable response, NSError * _Nullable error) {
NSLog(@"Response object: %@" , response);
NSString *bodyString = [[NSString alloc] initWithData:body encoding:NSUTF8StringEncoding];
//打印body
NSLog(@"Response body: %@" , bodyString);
}];
[task resume];
CURL
curl -i -k --get --include 'https://u.api.chuaini.com/api/v2/Whois/query?domain=qq.net&key=自己的KEY'