实时检测域名在QQ环境是否被拦截,方便快捷,稳定性强,准确性高。
接口地址: http://api.70api.com/api/qqcheck/
支持协议: HTTP/HTTPS
返回格式: JSON
请求方式: GET
请求示例: http://api.70api.com/api/qqcheck/?apiKey=5c181488bdff9fce310708be9641e505&url=http://baidu.com
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
apiKey | 是 | string | 登录平台购买对应API产品获得唯一标识 : apiKey |
url | 是 | string | 需要检测的域名 |
返回参数说明:
名称 | 类型 | 说明 |
---|---|---|
res | boolean | 返回结果 true|false |
data | array | 返回的结果 |
msg | string | 提示信息 |
code | int | 0为正常 其他为异常 |
返回示例:
{ "res": true, "code": 0, "msg": "成功", "data": { "status": 0, "message": "正常", "domain": "baidu.com" }, "timestamp": 1584968930 }
参数名称 | 参数值 |
---|---|
{ "res": true, "code": 0, "msg": "成功", "data": { "status": 0, "message": "正常", "domain": "baidu.com" }, "timestamp": 1584968930 }
错误码格式说明:
名称 | 类型 | 说明 |
---|---|---|
40001 | string | 请求频繁,请稍后再试! |
40004 | string | 非法请求 |
10009 | string | 该api暂时停止服务 |
10001 | string | 参数错误,请参考文档传递正确参数 |
10000 | string | 缺少必填参数,请参考文档传递必填参数 |
代码示例:
$domain = 'baidu.com';
$api = 'http://api.70api.com/api/qqcheck/?apiKey=5c181488bdff9fce310708be9641e505&url=' . $domain;
$result = json_decode(file_get_contents($api), 1);
if (!empty($result['data']) && isset($result['data']['status'])) {
echo $result['data']['domain'].' 检测结果: ' . $result['data']['message'];
} else {
echo '获取失败:' . (empty($result['msg']) ? '未知错误' : $result['msg']);
}