CloudFlare优选IP

接口地址:https://api.uouin.com/app/cloudflare

返回格式:Json

请求方式:Http(s) Get/Post请求

请求示例:https://api.uouin.com/app/cloudflare?username=用户名&key=密钥

接口说明:CloudFlare为全球知名的CDN服务商,免费提供不限流量的CC防护、DDOS防护、CDN加速,但许多节点IP国内访问不佳,甚至无法打开。CloudFlare优选IP通过在全国部署节点测试CloudFlare的公布的IP地址,从而优选国内访问质量较好的IP地址,并可通过官方的SAAS方式A记录接入或购买官方收费版本即可自定义接入,优选IP每10分钟自动更新一次。

请求参数说明:

参数名称必填类型说明
usernamestring用户名
keystring密钥
nodeidstring默认为ctcc的电信CloudFlare优选IPV4
ctcc为电信CloudFlare优选IPV4
cmcc为移动CloudFlare优选IPV4
cucc为联通CloudFlare优选IPV4
ipv6为国内CloudFlare优选IPV6
bgp为多线CloudFlare优选IPV4
支持自选优选的类型,标签之间用|间隔,例如ctcc|cmcc|cucc则获取电信、移动、联通的优选IP,上限为3个。
urlstring需要传入的数据或地址

返回参数说明:

参数名称类型说明
codenumber200获取成功 201获取失败
datastring返回的数据,如有则返回!
statustring异常为false,正常为true!
countnumber点数包,如按量计费则返回!
urlstring传入的数据!

响应文本:

{
    "msg": "获取成功",
    "data": {
        "ctcc": {
            "code": 200,
            "info": [
                {
                    "ip": "172.64.160.3",
                    "loss": "0.00%",
                    "ping": "133.61ms",
                    "speed": "4.11mb/s",
                    "bandwidth": "32.88mb"
                },
                {
                    "ip": "172.64.202.89",
                    "loss": "0.00%",
                    "ping": "135.78ms",
                    "speed": "3.96mb/s",
                    "bandwidth": "31.68mb"
                },
                {
                    "ip": "172.64.139.218",
                    "loss": "0.00%",
                    "ping": "136.40ms",
                    "speed": "3.17mb/s",
                    "bandwidth": "25.36mb"
                },
                {
                    "ip": "172.64.194.242",
                    "loss": "0.00%",
                    "ping": "135.74ms",
                    "speed": "3.16mb/s",
                    "bandwidth": "25.28mb"
                },
                {
                    "ip": "172.64.96.52",
                    "loss": "0.00%",
                    "ping": "135.89ms",
                    "speed": "3.13mb/s",
                    "bandwidth": "25.04mb"
                },
                {
                    "ip": "172.64.105.188",
                    "loss": "0.00%",
                    "ping": "136.16ms",
                    "speed": "3.01mb/s",
                    "bandwidth": "24.08mb"
                },
                {
                    "ip": "172.64.192.178",
                    "loss": "0.00%",
                    "ping": "134.98ms",
                    "speed": "2.77mb/s",
                    "bandwidth": "22.16mb"
                },
                {
                    "ip": "172.64.103.110",
                    "loss": "0.00%",
                    "ping": "137.16ms",
                    "speed": "2.68mb/s",
                    "bandwidth": "21.44mb"
                },
                {
                    "ip": "172.64.140.125",
                    "loss": "0.00%",
                    "ping": "136.78ms",
                    "speed": "1.94mb/s",
                    "bandwidth": "15.52mb"
                },
                {
                    "ip": "172.64.85.239",
                    "loss": "0.00%",
                    "ping": "136.70ms",
                    "speed": "1.55mb/s",
                    "bandwidth": "12.4mb"
                }
            ],
            "uptime": 1712592712
        }
    },
    "statu": "true",
    "code": "200"
}

系统状态码参考:

 状态码code说明
 -200用户名不能空
 -201key不能空
 -202url不能为空
 -203点数包余额不足
 -204访问API频率超过套餐限制,请升级套餐
 -205请求的接口地址有误,请到API文档获取请求地址
 -206账户VIP会员没开通或已过期
 -207用户名或key不对
 -208非白名单IP,请添加白名单IP
 -209账户状态异常
 -210接口异常,查询失败
 -211账户未绑定手机号
 -212检测超时,请重试
 -213网址存在安全风险,如误报可添加白名单域名
 -214API功能未开通
 1001检测域名状态正常
 1002检测域名状态异常或封禁
 200获取数据成功
 1短网址类调用生成成功

对接代码演示:


$result = file_get_contents("https://api.uouin.com/app/cloudflare?username=用户名&key=密钥&url=".urlencode($url));
$json = json_decode($result,true);
if($json[code] < 0){
    echo $json[msg];// API接口异常,返回异常信息
}
if($code == 1001){
    echo "域名正常"; //判断code为1001即为正常
}
if($code == 1002){ //判断code为1002即为拦截
    echo "已被封禁";
}
//可通过sleep()或usleep()函数控制调用频率

找不到你想要的?

需要我们的帮助!
联系我们