网络查询
查询 IP 地址 RDAP
GET
/rdap/ip公开访问
按 IANA ipv4.json 或 ipv6.json 的最长前缀选择注册局,查询 IP 网络 RDAP。只使用 HTTPS,不查询 WHOIS。 访问类别:匿名 API,可携带 Token 使用独立额度
请求参数
addressquery必填- IPv4、IPv6,或 IPv4 映射的 IPv6。映射地址按 IPv4 查询。
- string · IPv4、IPv6,或 IPv4 映射的 IPv6。映射地址按 IPv4 查询。 · 最短:1 字符 · 最长:128 字符
rawquery- true 时在 raw 返回注册局原始 RDAP JSON
- string · true 时在 raw 返回注册局原始 RDAP JSON · 默认值:"false" · 可选:true、false
响应
200 IP 网络注册数据。成功结果缓存 300 秒。
application/json
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"domain",
"ip",
"asn"
]
},
"query": {
"type": "string"
},
"service": {
"type": "string",
"description": "命中的 IANA 引导项,例如 com、8.0.0.0/8 或 13312-15359"
},
"registry": {
"type": "string",
"description": "选中的 HTTPS RDAP 基址"
},
"objectClass": {
"type": "string"
},
"handle": {
"type": [
"string",
"null"
]
},
"name": {
"type": [
"string",
"null"
]
},
"status": {
"type": "array",
"items": {
"type": "string"
}
},
"dates": {
"type": "object",
"properties": {
"registration": {
"type": [
"string",
"null"
]
},
"expiration": {
"type": [
"string",
"null"
]
},
"lastChanged": {
"type": [
"string",
"null"
]
},
"lastUpdateOfRdap": {
"type": [
"string",
"null"
]
}
},
"required": [
"registration",
"expiration",
"lastChanged",
"lastUpdateOfRdap"
],
"description": "保留注册局返回的时间原文;缺失为 null"
},
"events": {
"type": "array",
"items": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"date": {
"type": "string"
}
},
"required": [
"action",
"date"
]
}
},
"entities": {
"type": "array",
"items": {
"type": "object",
"properties": {
"handle": {
"type": [
"string",
"null"
]
},
"roles": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": [
"string",
"null"
]
},
"kind": {
"type": [
"string",
"null"
]
}
},
"required": [
"handle",
"roles",
"name",
"kind"
]
}
},
"nameservers": {
"type": [
"array",
"null"
],
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"ipv4": {
"type": "array",
"items": {
"type": "string"
}
},
"ipv6": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"name",
"ipv4",
"ipv6"
]
},
"description": "仅域名对象提供;IP 与 ASN 为 null"
},
"network": {
"type": [
"object",
"null"
],
"properties": {
"startAddress": {
"type": "string"
},
"endAddress": {
"type": "string"
},
"ipVersion": {
"type": "string"
},
"name": {
"type": [
"string",
"null"
]
},
"type": {
"type": [
"string",
"null"
]
},
"parentHandle": {
"type": [
"string",
"null"
]
},
"country": {
"type": [
"string",
"null"
]
}
},
"required": [
"startAddress",
"endAddress",
"ipVersion",
"name",
"type",
"parentHandle",
"country"
]
},
"asn": {
"type": [
"object",
"null"
],
"properties": {
"start": {
"type": "integer"
},
"end": {
"type": "integer"
},
"name": {
"type": [
"string",
"null"
]
},
"type": {
"type": [
"string",
"null"
]
},
"country": {
"type": [
"string",
"null"
]
}
},
"required": [
"start",
"end",
"name",
"type",
"country"
]
},
"links": {
"type": "array",
"items": {
"type": "object",
"properties": {
"rel": {
"type": [
"string",
"null"
]
},
"href": {
"type": "string"
},
"type": {
"type": [
"string",
"null"
]
}
},
"required": [
"rel",
"href",
"type"
]
}
},
"raw": {
"description": "raw=true 时为注册局返回的 RDAP JSON;默认省略"
}
},
"required": [
"type",
"query",
"service",
"registry",
"objectClass",
"handle",
"name",
"status",
"dates",
"events",
"entities",
"nameservers",
"network",
"asn",
"links"
]
}400 请求校验或执行失败
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}401 凭据无效、停用、过期或缺少所需 Token
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}403 需要管理员 Token
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}404 请求校验或执行失败
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}413 请求体过大
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}415 请求内容类型无效
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}422 请求校验或执行失败
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}429 请求过于频繁,Retry-After 为建议等待秒数;匿名额度及认证保护在各 Cloudflare 地点近似计数,Token 业务额度使用 D1 原子计数
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}500 内部执行失败
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}502 请求校验或执行失败
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}504 请求校验或执行失败
application/json
{
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
},
"issues": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "string",
"enum": [
"body",
"query",
"path",
"header"
]
},
"field": {
"type": "string"
},
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"location",
"field",
"code",
"message"
]
}
}
},
"required": [
"code",
"message"
]
}
},
"required": [
"error"
]
}响应示例
运行命令前,将环境变量 BASE_URL 设置为站点地址。
成功响应
curl --silent --show-error -H 'User-Agent: simpleWebUtils-example/1.1.0' -H 'Accept: application/json' "$BASE_URL"'/rdap/ip?address=8.8.8.8&raw=false'
HTTP 200
content-type: application/json
content-encoding: gzip
cache-control: public, max-age=300
{
"type": "ip",
"query": "8.8.8.8",
"service": "8.0.0.0/8",
"registry": "https://rdap.arin.net/registry/",
"objectClass": "ip network",
"handle": "NET-8-8-8-0-2",
"name": "GOGL",
"status": [
"active"
],
"dates": {
"registration": "2023-12-28T17:24:33-05:00",
"expiration": null,
"lastChanged": "2023-12-28T17:24:56-05:00",
"lastUpdateOfRdap": null
},
"events": [
{
"action": "last changed",
"date": "2023-12-28T17:24:56-05:00"
},
{
"action": "registration",
"date": "2023-12-28T17:24:33-05:00"
}
],
"entities": [
{
"handle": "GOGL",
"roles": [
"registrant"
],
"name": "Google LLC",
"kind": "org"
},
{
"handle": "ABUSE5250-ARIN",
"roles": [
"abuse"
],
"name": "Abuse",
"kind": "group"
},
{
"handle": "ZG39-ARIN",
"roles": [
"technical",
"administrative"
],
"name": "Google LLC",
"kind": "group"
}
],
"nameservers": null,
"network": {
"startAddress": "8.8.8.0",
"endAddress": "8.8.8.255",
"ipVersion": "v4",
"name": "GOGL",
"type": "DIRECT ALLOCATION",
"parentHandle": "NET-8-0-0-0-0",
"country": null
},
"asn": null,
"links": [
{
"rel": "self",
"href": "https://rdap.arin.net/registry/ip/8.8.8.0",
"type": "application/rdap+json"
},
{
"rel": "alternate",
"href": "https://whois.arin.net/rest/net/NET-8-8-8-0-2",
"type": "application/xml"
}
]
}错误示例
curl --silent --show-error -H 'User-Agent: simpleWebUtils-example/1.1.0' -H 'Accept: application/json' "$BASE_URL"'/rdap/ip?address=invalid+value&raw=false'
HTTP 400
content-type: application/json
content-encoding: gzip
cache-control: no-store
{
"error": {
"code": "INVALID_INPUT",
"message": "参数无效",
"issues": [
{
"location": "query",
"field": "address",
"code": "custom",
"message": "需要有效的 IPv4 或 IPv6 地址"
}
]
}
}在线调试
调用示例
curl -X GET 'https://oit.sh/rdap/ip?address=8.8.8.8'
响应
等待发送请求
配置上方请求参数后点击「发送请求」查看实时响应
快捷键:Ctrl / ⌘ + Enter