IP查询

更新时间:2024-03-20 11:56:34

适用产品

IP查询

接口描述

查询IP是否归属于CDN厂商

调用频率

单用户调用频率:300/5min

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Body 参数

参数名称描述
*ip
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 参数

参数名称描述
checkList
结果数据
response
yes:ip属于我司,no:ip不属于我司
ip
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://open.chinanetcenter.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
  }
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!