POSTAuthorization: Bearer {your_api_key}| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| start_time | int64 | 否 | 开始时间戳(秒) | 1712563200 |
| end_time | int64 | 否 | 结束时间戳(秒) | 1712649599 |
| engines | array[int] | 否 | 搜索引擎ID列表,用于筛选特定引擎的数据 | [1, 2, 3] |
| group_by | string | 是 | 分组方式,可选值:hour(按小时)或 day(按天) | "day" |
{
"start_time": 1712563200,
"end_time": 1712649599,
"engines": [1, 2, 3],
"group_by": "day"
}{
"code": 200,
"data": [
{
"time_key": "2024-04-08",
"success_count": 1250,
"fail_count": 50,
"total_count": 1300,
"success_rate": 96.15,
"avg_response_time": 1250.5,
"total_amount": 650.25
},
{
"time_key": "2024-04-09",
"success_count": 1180,
"fail_count": 20,
"total_count": 1200,
"success_rate": 98.33,
"avg_response_time": 1180.3,
"total_amount": 600.0
}
],
"message": "查询成功",
"timestamp": 1712649600
}| 字段名 | 类型 | 说明 |
|---|---|---|
| code | int | 响应状态码,200 表示成功 |
| data | array | 统计数据数组 |
| message | string | 响应消息 |
| timestamp | int64 | 响应时间戳 |
| 字段名 | 类型 | 说明 |
|---|---|---|
| time_key | string | 时间键,格式根据 group_by 参数决定 - hour: "2024-04-08 14:00:00" - day: "2024-04-08" |
| success_count | int64 | 成功请求次数(HTTP 状态码 200) |
| fail_count | int64 | 失败请求次数(非 200 状态码或无结果) |
| total_count | int64 | 总请求次数 |
| success_rate | float64 | 成功率(百分比,保留 2 位小数) |
| avg_response_time | float64 | 平均响应时间(毫秒,保留 2 位小数) |
| total_amount | float64 | 消耗积分总额(保留 4 位小数) |
{
"code": 401,
"data": null,
"message": "用户验证失败",
"timestamp": 1712649600
}{
"code": 400,
"data": null,
"message": "参数验证失败:group_by 必须是 hour 或 day",
"timestamp": 1712649600
}{
"code": 500,
"data": null,
"message": "数据查询失败",
"timestamp": 1712649600
}start_time 和 end_time,将返回所有历史数据engines 参数为空时,返回所有搜索引擎的统计数据;传入引擎ID数组可筛选特定引擎hour: 按小时分组,适合查看短期详细趋势day: 按天分组,适合查看长期趋势