数据面板接口返回结构化的统计数据,专为仪表盘和可视化图表设计。包含实时数据、趋势图表、TOP 排行等多维度信息。
✓ 免费接口:数据面板接口完全免费,不消耗任何次数或 Credits。
POST https://api.jisuapi.com/agent/stats/dashboard
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
period | string | 否 | 统计周期:today/7d/30d,默认 today |
timezone | string | 否 | 时区,默认 Asia/Shanghai |
| Header | 值 | 说明 |
|---|---|---|
Authorization | Bearer {appkey} | APPKEY 认证 |
Content-Type | application/json | 请求体格式 |
{
"status": 0,
"msg": "ok",
"result": {
"overview": {
"total_calls": 1250,
"success_rate": 0.9584,
"total_cost": 15.80,
"avg_response_time": 145,
"active_tools": 12
},
"realtime": {
"calls_last_hour": 52,
"calls_last_5min": 8,
"current_qps": 0.027
},
"trend": {
"labels": ["06-01", "06-02", "06-03"],
"calls": [410, 438, 402],
"success": [392, 420, 386],
"cost": [5.20, 5.60, 5.00]
},
"top_tools": [
{
"tool_id": "shouji_query",
"tool_name": "手机号码归属地查询",
"calls": 580,
"percentage": 46.4
},
{
"tool_id": "weather_forecast",
"tool_name": "天气预报",
"calls": 420,
"percentage": 33.6
}
],
"recent_errors": [
{
"time": "2026-06-03T11:45:23Z",
"tool_name": "天气预报",
"error": "上游超时",
"execution_id": "exe_xxx"
}
],
"cost_breakdown": {
"free": 580,
"package": 420,
"credits": 250
}
},
"request_id": "req_..."
} | status | msg | 说明 |
|---|---|---|
| 101 | APPKEY为空或不存在 | 未提供有效的APPKEY |
| 203 | period 参数无效 | 只支持 today/7d/30d |
curl -X POST "https://api.jisuapi.com/agent/stats/dashboard" \
-H "Authorization: Bearer 你的APPKEY" \
-H "Content-Type: application/json" \
-d '{}' curl -X POST "https://api.jisuapi.com/agent/stats/dashboard" \
-H "Authorization: Bearer 你的APPKEY" \
-H "Content-Type: application/json" \
-d '{
"period": "7d"
}' import requests
import matplotlib.pyplot as plt
url = "https://api.jisuapi.com/agent/stats/dashboard"
headers = {
"Authorization": "Bearer 你的APPKEY",
"Content-Type": "application/json"
}
data = {"period": "7d"}
response = requests.post(url, headers=headers, json=data)
result = response.json()
if result["status"] == 0:
dashboard = result["result"]
# 打印概览
print("=== 数据概览 ===")
print(f"总调用: {dashboard['overview']['total_calls']}")
print(f"成功率: {dashboard['overview']['success_rate']*100:.2f}%")
print(f"总费用: ¥{dashboard['overview']['total_cost']}")
print(f"平均响应: {dashboard['overview']['avg_response_time']}ms")
# 绘制趋势图
trend = dashboard['trend']
plt.figure(figsize=(10, 5))
plt.plot(trend['labels'], trend['calls'], marker='o', label='总调用')
plt.plot(trend['labels'], trend['success'], marker='s', label='成功调用')
plt.title('调用趋势')
plt.legend()
plt.savefig('trend.png')
print("\n趋势图已保存到 trend.png")
# TOP工具
print("\n=== TOP 工具 ===")
for tool in dashboard['top_tools'][:5]:
print(f"{tool['tool_name']}: {tool['calls']} 次 ({tool['percentage']:.1f}%)")
else:
print(f"查询失败: {result['msg']}") | 字段 | 类型 | 说明 |
|---|---|---|
total_calls | integer | 总调用次数 |
success_rate | float | 成功率(0-1) |
total_cost | float | 总费用(元) |
avg_response_time | integer | 平均响应时间(ms) |
active_tools | integer | 活跃工具数量 |
包含三个并行数组,索引对应:
labels:时间标签(日期或小时)calls:总调用次数success:成功次数cost:费用适配主流可视化库:
注意:虽然接口免费,但建议合理控制刷新频率,避免不必要的请求。
A: 实时数据延迟 < 1 分钟,历史数据每 5 分钟更新一次。
A: 目前仅支持 today/7d/30d 三个预设周期。如需自定义,请使用 stats 接口。
A: today 按小时,7d 按天,30d 按天。数据点数量自动调整以适应图表展示。


© 2015-2025 杭州极速互联科技有限公司 版权所有 浙ICP备17047587号-4 浙公网安备33010502005096 增值电信业务经营许可证:浙B2-20190875