OpenAPI 接口文档
OpenAPI 接口文档
查询动态流量日用量
按 Asia/Shanghai 自然日分页查询动态子账号的每日流量使用量。
接口信息
| 项目 | 内容 |
|---|---|
| Method | GET |
| Path | /open-api/v1/dynamic/traffic/usage/daily |
| 认证 | X-API-Key |
| 处理方式 | 同步 |
Query 参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
dynamic_account_id |
string | 否 | 全部账号 | 动态子账号 ID;如提供,必须可访问且不能为空串 |
stat_date_start |
string | 否 | 今天减 29 天 | 开始日期,包含当天,格式 yyyy-MM-dd |
stat_date_end |
string | 否 | 今天 | 结束日期,包含当天,格式 yyyy-MM-dd |
page_no |
integer | 否 | 1 |
页码,大于等于 1 |
page_size |
integer | 否 | 20 |
每页 1~100 条 |
开始日期不能晚于结束日期。仅提供一端时,另一端仍使用上表默认值。
请求示例
curl --request GET \
--url 'https://api-test.puraroute.com/gin/open-api/v1/dynamic/traffic/usage/daily?stat_date_start=2026-08-01&stat_date_end=2026-08-24&page_no=1&page_size=20' \
--header 'Accept: application/json' \
--header 'X-API-Key: <YOUR_API_KEY>'
响应参数
data 使用分页结构,list 元素如下:
| 字段 | 类型 | 说明 |
|---|---|---|
id |
string | 日用量记录编号 |
dynamic_account_id |
string | 动态子账号 ID |
sub_account |
string | 子账号名称 |
stat_date |
string | 统计日期,yyyy-MM-dd |
usage_traffic_gb |
string | 当日使用流量,GB |
last_sync_time |
string | 最近更新时间,GMT+8 ISO-8601 |
成功响应示例
{
"code": 0,
"msg": "success",
"data": {
"list": [
{
"id": "1912345678901234567",
"dynamic_account_id": "1912345678901234568",
"sub_account": "team_a_01",
"stat_date": "2026-08-24",
"usage_traffic_gb": "0.125000",
"last_sync_time": "2026-08-25T00:05:00.000+08:00"
}
],
"total": 1,
"page_no": 1,
"page_size": 20
},
"next": null
}
可能的错误码
code |
说明 |
|---|---|
300001 |
指定动态子账号不存在或不可访问 |
400001 |
认证失败 |
400009 |
日期、分页或其他参数不符合要求 |
500000 |
系统处理失败,请求未完成 |
跨页汇总需由调用方完成。