接口地址:https://api.uouin.com/index.php/index/Tyrand
返回格式:Json
请求方式:Http/Https Get请求
请求示例:https://api.uouin.com/index.php/index/Tyrand?username=用户名&key=密钥&url=http://www.qq.com
接口说明:该接口为特殊接口,调用时会扣除次数,购买或续费月付会员会送1万次,次数不足时可以充值购买次数
请求参数说明:
参数名称 | 必填 | 类型 | 说明 |
---|---|---|---|
username | 是 | string | 用户名 |
key | 是 | string | 账户密钥! |
url | 是 | string | 你要缩短的地址! |
返回参数说明:
参数名称 | 类型 | 说明 |
---|---|---|
code | string | 系统返回状态码 |
short | string | 缩短后短网址! |
statu | 状态码 | 正常为true! |
url | 地址 | 检测的地址! |
响应文本:
{
"short": "https://w.url.cn/s/Av3s7za",
"statu": true,
"url": "http:\/\/qq.com",
"code": "1"
}
系统状态码参考:
状态码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/Tyrand?username=用户名&key=密钥&url=".urlencode($url));
$json = json_decode($arr,true);
$short = $json[short];
echo $short;//$short为缩短后的地址