API 文档
正在加载文档
最近更新时间: 2026-06-04 16:37:39
| 接口功能 | 请求方法 | 接口路径 | 核心参数 | 成功响应 |
|---|---|---|---|---|
| 计量带宽查询 | POST | /v2/tune/bandwidth | domains、startDate、endDate、granularity | {"code":200,"data":{...}} |
| 计量流量查询 | POST | /v2/tune/flux | domains、startDate、endDate、granularity | {"code":200,"data":{...}} |
| 监控带宽查询 | POST | /v2/tune/monitoring/bandwidth | domains、startDate、endDate、granularity | {"code":200,"data":{...}} |
| 监控流量查询 | POST | /v2/tune/monitoring/flow | domains、startDate、endDate、granularity | {"code":200,"data":{...}} |
fusion.qiniuapi.com| 参数名 | 类型 | 必填 | 说明 | 示例值 |
|---|---|---|---|---|
| domains | string | 是 | 域名列表,分号分隔,最多 50 个 | "a.com;b.com" |
| startDate | string | 是 | 开始日期,格式 yyyy-MM-dd | "2026-02-01" |
| endDate | string | 是 | 结束日期,格式 yyyy-MM-dd,跨度 ≤ 31 天 | "2026-02-10" |
| granularity | string | 否 | 时间粒度,不传默认 5min | "5min" / "hour" / "day" |
| Type | string | 否 | 指定带宽/流量类型,根据接口查询内容设定 | "" / "bandwidth"|"flux" |
{
"code": <code>,
"error": <error>,
"time": <time>,
"data": {
...
<Domain_i>: {
"china": <Domain_i_China>,
"oversea": <Domain_i_Oversea>
},
...
}
}| 参数名 | 类型 | 说明 |
|---|---|---|
| code | int | 响应状态码 |
| error | string | 响应错误描述 |
| time | []string | 时间点数组,如2026-01-02 00:00:00 |
| data | map | 响应数据 |
| Domain_i | string | 域名 |
| Domain_i_China | []int | Domain_i 国内带宽/流量数据,与 time 一一对应 |
| Domain_i_Oversea | []int | Domain_i 海外带宽/流量数据,与 time 一一对应 |
https://fusion.qiniuapi.com/v2/tune/bandwidthcurl -X POST 'https://fusion.qiniuapi.com/v2/tune/bandwidth' \
-H 'Host: fusion.qiniuapi.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: QBox <AK>:<Sign>' \
-d '{"domains":"test.example.com","startDate":"2026-02-01","endDate":"2026-02-10","granularity":"5min"}'成功 (HTTP 200):
{
"code": 200,
"error": "",
"time": [
"2026-02-01 00:00:00",
"2026-02-01 00:05:00"
],
"data": {
"test.example.com": {
"china": [
1252,
4431
],
"oversea": [
678,
414
]
}
}
}https://fusion.qiniuapi.com/v2/tune/fluxcurl -X POST 'https://fusion.qiniuapi.com/v2/tune/flux' \
-H 'Host: fusion.qiniuapi.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: QBox <AK>:<Sign>' \
-d '{"domains":"test.example.com","startDate":"2026-02-01","endDate":"2026-02-10","granularity":"day"}'https://fusion.qiniuapi.com/v2/tune/monitoring/bandwidthcurl -X POST 'https://fusion.qiniuapi.com/v2/tune/monitoring/bandwidth' \
-H 'Host: fusion.qiniuapi.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: QBox <AK>:<Sign>' \
-d '{"domains":"test.example.com","startDate":"2026-02-10","endDate":"2026-02-10","granularity":"5min"}'https://fusion.qiniuapi.com/v2/tune/monitoring/flowcurl -X POST 'https://fusion.qiniuapi.com/v2/tune/monitoring/flow' \
-H 'Host: fusion.qiniuapi.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: QBox <AK>:<Sign>' \
-d '{"domains":"test.example.com","startDate":"2026-02-10","endDate":"2026-02-10","granularity":"5min"}'| 错误码 | 描述 | 场景 | 解决方案 |
|---|---|---|---|
| 400 | domains 类型错误 | 传了数组而非字符串 | domains 必须为 string,分号分隔 |
| 400080 | 开始时间格式错误 | startDate 非 yyyy-MM-dd | 修正日期格式 |
| 400081 | 结束时间格式错误 | endDate 非 yyyy-MM-dd | 修正日期格式 |
| 400082 | 无效的时间范围 | startDate 大于 endDate、跨度超 31 天、或超出数据保留期 | 调整时间范围 |
| 400032 | 无效域名 | 域名未接入 CDN | 确认域名已创建且上线 |
参考: 鉴权详见 鉴权指南,错误码详见 公共错误码&通用约束。
这篇文档有帮助吗?
正在加载反馈服务…