实时检测域名在抖音环境是否被拦截,稳定性强.准确性高。(三个状态:0 终止访问, 1 提示访问, 2 直接访问)
接口地址: http://api.70api.com/api/dy-urlck/
支持协议: HTTP/HTTPS
返回格式: JSON
请求方式: GET
请求示例: http://api.70api.com/api/dy-urlck/?apiKey=f9f7ed766261ca1948818c3faf63c654&url=http://s.yam.com
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
apiKey | 是 | string | 登录平台购买对应API产品获得唯一标识 : apiKey |
url | 是 | string | 需要被检测的域名 |
返回参数说明:
名称 | 类型 | 说明 |
---|---|---|
res | boolean | 返回结果 true|false |
data | array | 返回的结果 |
msg | string | 提示信息 |
code | int | 0为正常 其他为异常 |
返回示例:
注意:(三个状态:status为 0 是终止访问,status为 1 是提示访问,status为 2是 直接访问) { "res": true, "code": 0, "msg": "成功", "data": { "status": 0, "message": "终止访问", "domain": "s.yam.com" }, "timestamp": 1584968930 }
参数名称 | 参数值 |
---|---|
注意:(三个状态:status为 0 是终止访问,status为 1 是提示访问,status为 2是 直接访问) { "res": true, "code": 0, "msg": "成功", "data": { "status": 0, "message": "终止访问", "domain": "s.yam.com" }, "timestamp": 1584968930 }
错误码格式说明:
名称 | 类型 | 说明 |
---|---|---|
40001 | string | 请求频繁,请稍后再试! |
40004 | string | 非法请求 |
10009 | string | 该api暂时停止服务 |
10001 | string | 参数错误,请参考文档传递正确参数 |
10000 | string | 缺少必填参数,请参考文档传递必填参数 |
代码示例:
$domain = 'baidu.com';
$api = 'http://api.70api.com/api/dy-urlck/?apiKey=f9f7ed766261ca1948818c3faf63c654&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']);
}