IP查询

更新时间:2024-07-29 19:58:51

查询IP是否归属于CDN厂商

  • 单用户调用频率: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
  }
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!