网页加速
根据IP查询使用域名
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
ip | List | 是 | IP |
参数名称 | 类型 | 描述 |
---|---|---|
code | String | 请求结果状态码 |
message | String | 请求结果信息 |
data | List | 请求结果的详细数据 |
ip | String | IP名称 |
status | String | 是否使用: idle -- 暂未使用; runing -- 使用中; out of range -- 不在查询范围内的ip |
domainList | List | 用该IP的域名列表,未使用的ip/不在查询范围内的ip,域名列表为空 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
INVALID_HTTP_REQUEST | There was an error in the body of your HTTP request. | 400 | ip没有传递 |
SYSTEM_ERROR | We encountered an system error. Please try again. | 500 | 系统发生错误 |
#!/bin/bash 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/tools/ip/domain-list" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '{ "ip": ["1.1.1.1","2.2.2.2"] }'
{ "code": "0", "message": "success", "data": [ { "ip": "1.1.1.1", "status": "idle" }, { "ip": "2.2.2.2", "status": "running", "domainList": [ "a.net", "b.net", "c.net", "d.com" ] } ] }