API中心
概览
API-Key Authentication
AK/SK Authentication
应用性能管理
边缘应用
CDN Pro
边缘云主机
访问控制
互动直播
流媒体直播
流媒体点播
云直播
低延时直播
云点播
API Shield
Application Shield
Web Application Firewall
Flood Shield
Cloud Security 2.0
Bot Shield
Flood Shield 2.0
动态加速
静态加速
CloudDNS
对象存储
本地存储
证书管理
内容管理
IP查询
ip查询
IP查询
查询IP的归属
云监控
日志下载
其他

IP查询

更新时间:2025-04-22 19:05:56

该接口用于查询给定IP地址是否属于我司CDN IP。用户需提供IP地址列表。返回结果包含每个IP地址是否归属于我司CDN IP。

  • 单用户调用频率:300/5min
  • 适用产品:IP查询

请求参数

Body 参数

参数名称描述
*ipList
ip地址,每个ip都需要符合正则((2[0-4]\d|25[0-5]|1\d\d|0|[1-9]\d?)\.){3}(2[0-4]\d|25[0-5]|1\d\d|0|[1-9]\d?),ip个数默认不能超过20(可联系技术支持调整)

返回参数

Body 参数

参数名称描述
checkListList
结果数据
responseString
yes:ip属于我司,no:ip不属于我司
ipString
ip地址

错误码

错误代码(code)描述(message)HTTP状态码语义
INVALID_HTTP_REQUESTThere was an error in the body of your HTTP request.400ip没有传递
PARAM_TOO_LONGParam length too long.400ip个数超过20个
PARSE_PARAM_ERRORparse param error400ip不符合正则
SYSTEM_ERRORWe encountered an system error. Please try again.500系统发生错误

示例

JSON
JSON
请求示例
复制代码
#!/bin/bash
# Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response

  username='example_username'
  apiKey='example_apiKey'
  date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S   GMT"`
  password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey   -binary | openssl enc -base64`
  curl -i --url   "https://api.cdnetworks.com/api/si/tools/ipCheck"   \
  -X "POST" \
-H "X-Time-Zone:GMT+08:00" \
  -u "$username:$password" \
  -H "Date: $date" \
  -H "Accept: application/json" \
 -d '{
      "ip":["1.1.1.1","2.2.2.2"]
  }'
返回示例
复制代码
{
      "result": {
          "checkList": [
              {
                  "response":   "no",
                  "ip":   "1.1.1.1"
              },
              {
                  "response":   "no",
                  "ip":   "2.2.2.2"
              }
          ]
      },
      "code": 200
  }

目录

  • 请求参数
  • 返回参数
  • 错误码
  • 示例
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!