获取计费带宽数据

最近更新时间:2023-08-10 11:00:29

我的收藏

接口描述

接口Get_BillingBandwidth:用于查询账号计费带宽数据。
地址  API 调用地址为: http://statcgi.video.qcloud.com/common_access
说明 使用该接口需要后台配置,如需调用该接口,请联系腾讯商务人员或者 提交工单,联系电话:4009100100。

输入参数

参数名
参数含义
类型
备注
是否必需
cmd
业务 appid
int
填写直播 appid,用于区分不同客户身份
Y
interface
接口名称
string
Get_BillingBandwidth
Y
t
int
UNIX 时间戳(十进制)
Y
sign
string
MD5(key+t)
Y
Param.n.start_time
查询起始时间
int
时间戳
Y
Param.n.end_time
查询结束时间
int
时间戳
Y
Param.s.domain
域名
string
域名
N
Param.n.home_foreign
国内外的数据
uint
0:不区分国内外,查询总数据(default)
1:只查询国内数据
2:只查询国外数据
N
Param.n.get_top_bd
获取峰值带宽
Uint
0:不是获取峰值带宽和流量,而是列表(default)
1:获取峰值带宽和流量
N

输出结果

参数名
参数含义
类型
备注
ret
返回码
int
0表示成功,10003表示查询成功但无数据,其他值表示失败
message
错误信息
string
错误描述
output
消息内容
array
其中 output 的主要内容为:
字段名
含义
类型
备注
total_info
计费总带宽统计信息
array
5分钟粒度
domain
域名
string
传入参后才有
其中 total_info的主要内容为:
字段名
含义
类型
备注
time
统计时间
string
bandwidth
带宽
double
Mbps
flux
流量
double
MB

调用示例

目标:查询账号计费带宽数据。
组成部分
示例内容
接口 URL
statcgi.video.qcloud.com/common_access?
cmd
1251059556
interface
Get_BillingBandwidth
Param.n.start_time
1481299200
Param.n.end_time
1481302800
Param.n.home_foreign
1
Param.s.domain
8888.liveplay.myqcloud.com
t
1471850187
sign
b17971b51ba0fe5916ddcd96692e9fb3
// copy时请去掉美化排版用的不可见换行符,否则可能出现 “appid is invalid” 等url拼装错误
URL = http://statcgi.video.qcloud.com/common_access?
cmd=1251059556
&interface=Get_BillingBandwidth
&Param.s.domain=8888.liveplay.myqcloud.com
&t=1471850187&sign=b17971b51ba0fe5916ddcd96692e9fb3
&Param.n.start_time=1481299200
&Param.n.end_time=1481302800