接口地址:https://api.uouin.com/index.php/index/Jiance/add
返回格式:Json
请求方式:Http/Https Get请求
请求示例:https://api.uouin.com/index.php/index/Jiance/add?username=用户名&key=密钥&type=ping&url=http://www.qq.com
接口说明:域名Ping检测可实时检测域名的Ping信息,支持电信 联通 移动节点检测
请求参数说明:
参数名称 | 必填 | 类型 | 说明 |
---|---|---|---|
username | 是 | string | 用户名 |
key | 是 | string | 账户密钥! |
type | 是 | string | 默认为ping |
url | 是 | string | 你要缩短的地址! |
返回参数说明:
参数名称 | 类型 | 说明 |
---|---|---|
code | string | 系统返回状态码 |
statu | 状态码 | 正常为true! |
ip | string | IP地址 |
ipaddress | string | IP对应实际地址 |
data | json | Ping数据 |
url | 地址 | 检测的地址! |
响应文本:
{
"msg": "获取成功",
"ip": "101.91.28.164",
"ipaddress": "中国上海 电信",
"data": {"telecom":{"time":"12.5 ms","ttl":"52"},"unicom":{"time":"5.99 ms","ttl":"52"},"move":{"time":"13.7 ms","ttl":"52"}},
"statu": true,
"url": "http:\/\/qq.com",
"code": "1001"
}
系统状态码参考:
状态码code | 说明 | |
---|---|---|
-200 | 用户名不能空! | |
-201 | key不能空! | |
-202 | url不能为空! | |
-203 | 特殊接口次数用尽! | |
-204 | 访问接口频率超过限制! | |
-205 | 未输入type类型或type错误! | |
-206 | 账户VIP接口服务已过期! | |
-207 | 用户名或key不对! | |
-208 | 非白名单IP禁止调用! | |
-209 | 账户违规被封禁! | |
-210 | 接口异常,查询失败! | |
-211 | 请登陆账户绑定手机号后再调用短网址接口! | |
1001 | 检测类接口域名正常访问! | |
1002 | 检测类接口域名已被封禁! | |
1 | 短网址类调用生成成功! |
对接代码演示:
//$url为要缩短的长链接
$arr = file_get_contents("https://api.uouin.com/index.php/index/Jiance/add?username=用户名&key=密钥&type=ping&url=".urlencode($url));
$json = json_decode($arr,true);
$time = $json[data][telecom][time];
echo $time;