IP历史Whois信息查询
接口说明
该接口是一个通过IP查询历史Whois注册信息的服务,仅支持IPv4的查询。用法是在接口路由后面拼接上一个IPv4格式的IP地址,然后发出HTTP请求,最终会返回该IP的历史Whois注册信息,返回信息包括除当前的whois注册信息以外的全部历史的whois注册信息列表。以39.106.22.138这个IPv4格式地址为例,拼接后的完整接口路由为/ips/std/v2/whois_history/39.106.22.138。仅支持单个IP查询,仅支持IPv4格式的IP。
推荐应用场景
查询IP的历史注册信息
请求地址
https://api.f.360.cn/ips/std/v2/whois_history/:ip
请求方法
POST
请求参数
| 参数名 | 类型 | 位置 | 必选 | 示例值 | 说明 |
|---|---|---|---|---|---|
| ip | string | path | 是 | 1.21.4.2 | 查询对象 |
| limit | int | query | 否 | 1000 | 返回数据条数,默认值为1000 |
| skip | int | query | 否 | 0 | 跳过条数,默认值为0 |
响应参数
| 一级字段 | 二级字段 | 类型 | 可选值 | 说明 |
|---|---|---|---|---|
| code | int | 200 | 响应状态码 | |
| msg | string | 结果说明 | ||
| inetnum | string | 地址范围 | ||
| ip_version | string | v4/v6 | IP版本 | |
| start_ip | string | 开始IP地址 | ||
| end_ip | string | 结束IP地址 | ||
| net_name | string | 网络名称 | ||
| org_name | string | 组织名称 | ||
| desc | Array<string> | 描述 | ||
| country | string | 国家 | ||
| net_type | string | 网络类型 | ||
| parent_net | string | 父网络 | ||
| object_class_name | string | 类型名称 | ||
| last_modified | string | 最后更新时间 | ||
| rdap_conformance | Array<string> | 一致性 | ||
| server | string | Whois服务器 | ||
| status | string | 状态 | ||
| links | Array<object> | 链接 | ||
| href | string | 链接 | ||
| rel | string | self/alternate/related | 自己/替换/相关 | |
| source | string | 数据来源 | ||
| notice | object | 通知信息 | ||
| source | object | | 源 | |
| terms_and_conditions | object | | 条款和条件 | |
| whois_inaccuracy_reporting | object | | Whois错误报告 | |
| copyright_notice | object | | 版权声明 | |
| filtered | object | | 过滤 | |
| entity | Array<object> | 实体信息 | ||
| events | Array<object> | | 事件 | |
| address | string | 地址 | ||
| string | 邮箱 | |||
| handle | string | 实体标识符 | ||
| links | Array<string> | | 链接 | |
| name | string | 实体名称 | ||
| remark_info | Array<object> | | 评论 | |
| roles | Array<string> | noc/technical/administrative/abuse | noc/技术/管理员/滥用 | |
| tel | string | 电话 | ||
| type | string | group/individual | 组织/个人 | |
| version | string | 版本号 | ||
| first_seen | timestamp<int> | 首次发现时间,秒级 | ||
| last_seen | timestamp<int> | 最近发现时间,秒级 |
请求示例
支持cUrl、Python、Java、PHP、Go语言的请求,示例如下
#!/usr/bin/env bash
set -euo pipefail
APPID="" # apikey
SECRET="" # salt
URL="https://api.f.360.cn/ips/std/v2/whois_history/36.99.173.14"
BODY='{}'
NONCE=$(printf '%08d' $((RANDOM % 100000000)))
TIMESTAMP=$(date +%s)
BODY_MD5=$(printf '%s' "$BODY" | openssl dgst -md5 -hex | awk '{print $NF}')
SIGNATURE=$(printf '%s' "${BODY_MD5}${APPID}${NONCE}${TIMESTAMP}${SECRET}" | openssl dgst -md5 -hex | awk '{print $NF}')
SIGNATURE=${SIGNATURE:16}
curl --location --request POST "$URL" \
--header "Content-Type: application/json" \
--header "X-360-Key: ${APPID}" \
--header "X-360-Nonce: ${NONCE}" \
--header "X-360-Timestamp: ${TIMESTAMP}" \
--header "X-360-Signature: ${SIGNATURE}" \
--data "${BODY}"# -*- coding:utf-8 -*—
import hashlib
import json
import random
import time
import requests
APPID = "" # apikey
SECRET = "" # salt
def make_headers(appid, secret, body):
headers = {}
headers["X-360-Key"] = appid
headers["X-360-Nonce"] = str(random.randint(0, 99999999)).zfill(8)
headers["X-360-Timestamp"] = str(int(time.time()))
s = (
hashlib.md5(body.encode("utf8")).hexdigest()
+ headers["X-360-Key"]
+ headers["X-360-Nonce"]
+ headers["X-360-Timestamp"]
+ secret
)
md5 = hashlib.md5(s.encode("utf8")).hexdigest()
headers["X-360-Signature"] = md5[16:]
headers["Content-Type"] = "application/json"
return headers
def do_post(url, body):
res = requests.post(
url,
data=json.dumps(params),
headers=make_headers(APPID, SECRET, json.dumps(body)),
)
print(res.text)
if __name__ == "__main__":
# 请求地址
url = "https://api.f.360.cn/ips/std/v2/whois_history/36.99.173.14"
params = {}
do_post(url, params)import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.concurrent.ThreadLocalRandom;
public class Demo {
static String md5(String input) throws Exception {
byte[] digest = MessageDigest.getInstance("MD5")
.digest(input.getBytes(StandardCharsets.UTF_8));
StringBuilder sb = new StringBuilder();
for (byte b : digest) {
sb.append(String.format("%02x", b & 0xff));
}
return sb.toString();
}
public static void main(String[] args) throws Exception {
String appid = ""; // apikey
String secret = ""; // salt
String url = "https://api.f.360.cn/ips/std/v2/whois_history/36.99.173.14";
String body = "{}";
String nonce = String.format("%08d", ThreadLocalRandom.current().nextInt(100000000));
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String signature = md5(md5(body) + appid + nonce + timestamp + secret).substring(16);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("X-360-Key", appid)
.header("X-360-Nonce", nonce)
.header("X-360-Timestamp", timestamp)
.header("X-360-Signature", signature)
.POST(HttpRequest.BodyPublishers.ofString(body, StandardCharsets.UTF_8))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(
request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
System.out.println(response.body());
}
}<?php
// apikey
$appid = "";
// salt
$secret = "";
$url = 'https://api.f.360.cn/ips/std/v2/whois_history/36.99.173.14';
$body = json_encode([], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$nonce = str_pad((string) random_int(0, 99999999), 8, "0", STR_PAD_LEFT);
$timestamp = (string) time();
$signature = substr(md5(md5($body) . $appid . $nonce . $timestamp . $secret), 16);
$ch = curl_init($url);
$options = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-360-Key: {$appid}",
"X-360-Nonce: {$nonce}",
"X-360-Timestamp: {$timestamp}",
"X-360-Signature: {$signature}",
],
];
$options[CURLOPT_POST] = true;
$options[CURLOPT_POSTFIELDS] = $body;
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
if ($response === false) {
echo curl_error($ch), PHP_EOL;
} else {
echo $response, PHP_EOL;
}
curl_close($ch);package main
import (
"bytes"
"crypto/md5"
"encoding/hex"
"fmt"
"io"
"math/rand"
"net/http"
"time"
)
func md5Hex(s string) string {
sum := md5.Sum([]byte(s))
return hex.EncodeToString(sum[:])
}
func main() {
appid := "" // apikey
secret := "" // salt
url := "https://api.f.360.cn/ips/std/v2/whois_history/36.99.173.14"
body := []byte(`{}`)
nonce := fmt.Sprintf("%08d", rand.Intn(100000000))
timestamp := fmt.Sprintf("%d", time.Now().Unix())
signature := md5Hex(md5Hex(string(body)) + appid + nonce + timestamp + secret)[16:]
req, err := http.NewRequest(http.MethodPost, url, bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-360-Key", appid)
req.Header.Set("X-360-Nonce", nonce)
req.Header.Set("X-360-Timestamp", timestamp)
req.Header.Set("X-360-Signature", signature)
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(respBody))
}响应示例
业务正常响应
{
"status": "ok",
"code": 200,
"data": [
{
"status": "active",
"org_name": "",
"notice": {
"filtered": {
"rel": "",
"desc": "This output has been filtered."
},
"whois_inaccuracy_reporting": {
"rel": "inaccuracy-report",
"desc": "If you see inaccuracies in the results, please visit: https://www.ripe.net/contact-form?topic=ripe_dbm&show_form=true"
},
"terms_and_conditions": {
"rel": "terms-of-service",
"desc": "This is the RIPE Database query service. The objects are in RDAP format. http://www.ripe.net/db/support/db-terms-conditions.pdf"
},
"source": {
"desc": "Objects returned came from source RIPE"
}
},
"last_seen": 1742197704,
"net_name": "ORCL-AMER-OCI-22",
"links": [
{
"href": "https://rdap.db.ripe.net/ips/rirSearch1/up/2.2.0.0%20-%202.2.255.255",
"rel": "up"
},
{
"href": "https://rdap.db.ripe.net/ips/rirSearch1/up/2.2.0.0%20-%202.2.255.255?status=active",
"rel": "up-active"
},
{
"href": "https://rdap.db.ripe.net/ips/rirSearch1/down/2.2.0.0%20-%202.2.255.255",
"rel": "down"
},
{
"href": "https://rdap.db.ripe.net/ips/rirSearch1/top/2.2.0.0%20-%202.2.255.255",
"rel": "top"
},
{
"href": "https://rdap.db.ripe.net/ips/rirSearch1/top/2.2.0.0%20-%202.2.255.255?status=active",
"rel": "top-active"
},
{
"href": "https://rdap.db.ripe.net/ips/rirSearch1/bottom/2.2.0.0%20-%202.2.255.255",
"rel": "bottom"
},
{
"href": "https://rdap.db.ripe.net/ip/2.2.0.0",
"rel": "self"
},
{
"href": "http://www.ripe.net/data-tools/support/documentation/terms",
"rel": "copyright"
}
],
"rdap_conformance": [
"geofeed1",
"rirSearch1",
"ips",
"cidr0",
"rdap_level_0",
"nro_rdap_profile_0",
"redacted"
],
"country": "US",
"parent_net": "2.0.0.0 - 2.2.255.255",
"object_class_name": "ip network",
"entity": [
{
"handle": "ORCL-MNT",
"roles": [
"registrant"
],
"links": [
{
"href": "https://rdap.db.ripe.net/entity/ORCL-MNT",
"rel": "self"
},
{
"href": "http://www.ripe.net/data-tools/support/documentation/terms",
"rel": "copyright"
}
],
"version": "4.0",
"type": "individual",
"events": [],
"name": "ORCL-MNT"
},
{
"handle": "ORCL1-RIPE",
"roles": [
"administrative",
"technical"
],
"links": [
{
"href": "https://rdap.db.ripe.net/entity/ORCL1-RIPE",
"rel": "self"
},
{
"href": "http://www.ripe.net/data-tools/support/documentation/terms",
"rel": "copyright"
}
],
"events": [],
"version": "4.0",
"address": "500 Oracle Parkway, M/S 501ip3\nRedwood Shores\nCA, 94065",
"type": "group",
"email": "domain-contact_ww_grp@oracle.com",
"name": "Domain Administrator"
},
{
"handle": "ORG-OAI2-RIPE",
"roles": [
"registrant"
],
"links": [
{
"href": "https://rdap.db.ripe.net/entity/ORG-OAI2-RIPE",
"rel": "self"
},
{
"href": "http://www.ripe.net/data-tools/support/documentation/terms",
"rel": "copyright"
}
],
"version": "4.0",
"address": "2300 Oracle Way Austin, TX 78741 USA",
"type": "org",
"events": [],
"name": "Oracle America Inc."
},
{
"handle": "AR17199-RIPE",
"roles": [
"abuse"
],
"links": [],
"events": [],
"version": "4.0",
"address": "Oracle Svenska AB\nKronborgsgrand 17\n164 46 Kista\nSE",
"type": "group",
"email": "abuse@oracleemaildelivery.com",
"name": "Abuse-C Role"
}
],
"source": "RIPE",
"end_ip": "2.2.255.255",
"net_type": "SUB-ALLOCATED PA",
"inetnum": "2.2.0.0 - 2.2.255.255",
"last_modified": "2024-10-04T14:24:27Z",
"start_ip": "2.2.0.0",
"first_seen": 1740991800,
"server": "whois.ripe.net",
"ip_version": "v4",
"desc": []
},
{
"status": "active",
"org_name": "",
"notice": {
"filtered": {
"rel": "",
"desc": "This output has been filtered."
},
"whois_inaccuracy_reporting": {
"rel": "inaccuracy-report",
"desc": "If you see inaccuracies in the results, please visit: https://www.ripe.net/contact-form?topic=ripe_dbm&show_form=true"
},
"terms_and_conditions": {
"rel": "terms-of-service",
"desc": "This is the RIPE Database query service. The objects are in RDAP format. http://www.ripe.net/db/support/db-terms-conditions.pdf"
},
"source": {
"desc": "Objects returned came from source RIPE"
}
},
"last_seen": 1740987021,
"net_name": "ORCL-AMER-OCI-22",
"links": [
{
"href": "https://rdap.db.ripe.net/ip/2.2.0.0",
"rel": "self"
},
{
"href": "http://www.ripe.net/data-tools/support/documentation/terms",
"rel": "copyright"
}
],
"rdap_conformance": [
"geofeed1",
"cidr0",
"rdap_level_0",
"nro_rdap_profile_0",
"redacted"
],
"country": "US",
"parent_net": "2.0.0.0 - 2.2.255.255",
"object_class_name": "ip network",
"entity": [
{
"handle": "ORCL-MNT",
"roles": [
"registrant"
],
"links": [
{
"href": "https://rdap.db.ripe.net/entity/ORCL-MNT",
"rel": "self"
},
{
"href": "http://www.ripe.net/data-tools/support/documentation/terms",
"rel": "copyright"
}
],
"version": "4.0",
"type": "individual",
"events": [],
"name": "ORCL-MNT"
},
{
"handle": "ORCL1-RIPE",
"roles": [
"administrative",
"technical"
],
"links": [
{
"href": "https://rdap.db.ripe.net/entity/ORCL1-RIPE",
"rel": "self"
},
{
"href": "http://www.ripe.net/data-tools/support/documentation/terms",
"rel": "copyright"
}
],
"events": [],
"version": "4.0",
"address": "500 Oracle Parkway, M/S 501ip3\nRedwood Shores\nCA, 94065",
"type": "group",
"email": "domain-contact_ww_grp@oracle.com",
"name": "Domain Administrator"
},
{
"handle": "ORG-OAI2-RIPE",
"roles": [
"registrant"
],
"links": [
{
"href": "https://rdap.db.ripe.net/entity/ORG-OAI2-RIPE",
"rel": "self"
},
{
"href": "http://www.ripe.net/data-tools/support/documentation/terms",
"rel": "copyright"
}
],
"version": "4.0",
"address": "2300 Oracle Way Austin, TX 78741 USA",
"type": "org",
"events": [],
"name": "Oracle America Inc."
},
{
"handle": "AR17199-RIPE",
"roles": [
"abuse"
],
"links": [],
"events": [],
"version": "4.0",
"address": "Oracle Svenska AB\nKronborgsgrand 17\n164 46 Kista\nSE",
"type": "group",
"email": "abuse@oracleemaildelivery.com",
"name": "Abuse-C Role"
}
],
"source": "RIPE",
"end_ip": "2.2.255.255",
"net_type": "SUB-ALLOCATED PA",
"inetnum": "2.2.0.0 - 2.2.255.255",
"last_modified": "2024-10-04T14:24:27Z",
"start_ip": "2.2.0.0",
"first_seen": 1728055663,
"server": "whois.ripe.net",
"ip_version": "v4",
"desc": []
}
]
}业务异常响应
{
"code": 422,
"status": "bad",
"err": "xxx"
}{
"code": "GC00101",
"msg": "param missing"
}