网络检测-支持DNS、ICMP Ping、HTTP、HTTPS
https://v2.xxapi.cn/api/netCheck
接口描述
免费API提供全方位网络检测服务,支持DNS解析、ICMP Ping、HTTP/HTTPS请求等多维度检测。快速获取域名解析、延迟、可达性、网站响应状态和证书有效期,适用于网络诊断、性能优化、运维监控和网站可用性测试。
请求参数
请求示例
var axios = require('axios')
var config = {
method: 'get',
url: 'https://v2.xxapi.cn/api/netCheck?host=https://xxapi.cn'
}
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
axios
ajax
fetch
xhr
php
python
返回示例
{
"code": 200,
"msg": "数据请求成功",
"data": {
"dns": { // DNS 解析结果
"A": [
"182.140.222.120", // 域名解析得到的 IPv4 地址之一
"119.84.242.205" // 另一个 IPv4 地址
],
"AAAA": [
"240e:930:c200:71::73", // 域名解析得到的 IPv6 地址之一
"240e:94c:0:2701:3d::20" // 另一个 IPv6 地址
],
"CNAME": "cloud.tencent.com.eo.dnse5.com.", // CNAME 别名解析结果
"MX": null, // 邮件交换记录(未配置)
"NS": null, // 域名服务器记录(未返回)
"TXT": null, // TXT 文本记录(未配置)
"domain": "cloud.tencent.com", // 查询的域名
"time": "176.02793ms" // DNS 查询耗时
},
"http": { // HTTP 请求检测(默认 http://)
"content_length": -1, // 响应长度(-1 表示未返回或分块传输)
"final_url": "https://cloud.tencent.com/", // 最终跳转到的 URL(自动跳转到 https)
"headers": { // HTTP 响应头
"Content-Type": "text/html; charset=utf-8", // 内容类型:HTML 页面,UTF-8 编码
"Server": "nginx" // Web 服务器信息
},
"latency": "168.052458ms", // HTTP 请求耗时
"method": "GET", // 请求方法
"ok": true, // 请求是否成功(状态码 200~399 为 true)
"redirects": 1, // 跳转次数(http -> https)
"status": 200, // HTTP 状态码
"url": "http://cloud.tencent.com" // 原始请求地址
},
"https": { // HTTPS 请求检测(https://)
"cipher_suite": "0x1302", // 使用的加密套件(TLS_AES_256_GCM_SHA384)
"content_length": -1, // 响应长度(未返回)
"days_left": 249, // HTTPS 证书剩余有效期天数
"final_url": "https://cloud.tencent.com", // 最终访问的 URL
"headers": { // HTTPS 响应头
"Content-Type": "text/html; charset=utf-8",
"Server": "nginx"
},
"issuer": "CN=GlobalSign RSA OV SSL CA 2018,O=GlobalSign nv-sa,C=BE", // 证书颁发者信息
"latency": "74.715338ms", // HTTPS 请求耗时
"method": "GET", // 请求方法
"not_after": "2026-05-03T09:46:01Z", // 证书到期时间
"not_before": "2025-04-01T09:46:02Z", // 证书生效时间
"ok": true, // 请求是否成功
"redirects": 0, // 跳转次数(HTTPS 没有再跳转)
"server_name": "cloud.tencent.com", // SNI(证书绑定的服务器域名)
"status": 200, // HTTPS 状态码
"tls_version": "TLS1.3", // 使用的 TLS 协议版本
"url": "https://cloud.tencent.com" // 原始请求地址
},
"input_host": "cloud.tencent.com", // 用户输入的检测目标
"ping": { // ICMP Ping 检测
"identifier": 19786, // ICMP 包 ID(通常是进程 PID 的低位)
"ip": "182.140.222.120", // 实际 Ping 的 IP 地址
"protocol": "icmp", // 协议类型(IPv4 下为 icmp,IPv6 下为 icmpv6)
"reachable": true, // 是否可达
"rtt": "1.371116ms", // 往返延迟(Round-Trip Time)
"sequence": 1, // ICMP 包的序列号
"target": "cloud.tencent.com" // Ping 的目标域名
}
},
"request_id": "99642f24817b8ad296e7b53e"
}