传入 IP 地址,返回该 IP 的蜘蛛类型与访问时间记录。极简高效,开箱即用。
$_REQUEST 兼容),适配不同调用场景code(状态码)、msg(提示信息)、data(结果数据)ip 参数是否存在且非空filter_var 验证 IP 地址合法性,避免无效查询mysqli_real_escape_string 转义 IP 参数spider(蜘蛛类型)和 time(访问时间),符合核心需求http://jiaotu.wanyouhui.com/api.php?ip=85.208.96.204
POST /api.php
Content-Type: application/x-www-form-urlencoded
ip=85.208.96.204
有数据时:
{
"code": 200,
"msg": "success",
"data": [
{
"spider": "百度蜘蛛",
"time": "2026-01-26 10:30:00"
},
{
"spider": "百度蜘蛛",
"time": "2026-01-26 09:15:00"
}
]
}
无数据时:
{
"code": 200,
"msg": "未查询到该IP的蜘蛛信息",
"data": []
}
参数错误时:
{
"code": 400,
"msg": "IP地址格式不正确",
"data": []
}