直播分发
获取特定时间段内,每路流的峰值独立IP数(小时粒度)。
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
datefrom | String | 是 | 开始时间 1.格式为yyyy-MM-dd'T'HH:mm:ss+08:00; 2.必须小于当前时间和dateTo; 3.dateFrom和dateTo相差不能超过1天(可联系技术支持调整); 4.只能查询最近2年内数据。 |
dateto | String | 是 | 结束时间 1.格式为yyyy-MM-dd'T'HH:mm:ss+08:00; 2.必须大于dateFrom; |
domain | String | 是 | 域名,数量上限1个 |
stream | String | 否 | 流名 1.流名个数限制根据账号可调,默认为20个; 2.不传时默认查询域名下所有流名,同时接受流名数量上限限制; |
参数名称 | 类型 | 描述 |
---|---|---|
domain | String | 域名 |
stream | String | 流名 |
peakTime | String | 峰值时间,格式为yyyy-MM-dd HH:mm;每一个时间片数据值代表的是前一个时间粒度范围内的数据值。 |
peakValue | Number | 峰值独立ip数 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
NotAcceptable | The accept header specified in your request is not acceptable. | 400 | Accept请求头不支持,接口仅支持json格式 |
InvalidDatePeriod | The date specified is invalid. | 400 | datefrom或dateto不符合规范 |
DateSpanError | You cannot specify a period greater than 1. | 400 | datefrom和dateto相差超过1天 |
InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 | 请求体格式错误 |
PARAM_INVALID | param: stream is null or invalid. | 400 | 参数stream不符合规范 |
NoSuchDomain | The specified domain does not exist. | 404 | 域名不存在或不属于当前调用账号 |
DomainsExcessive | The number of domain is excessive once. | 403 | 域名数量超出限制 |
StreamsExcessive | The number of stream is excessive once. | 403 | 流名数量超出限制 |
InternalError | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
#!/bin/bash # 请将示例中的(-H "X-Time-Zone") 参数设置为您希望在返回结果中获得的时区 # Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response username='example_username' apiKey='example_apiKey' date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"` password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64` curl -i --url "https://open.chinanetcenter.com/api/report/visitor/peak/stream?datefrom=2017-11-01T00:00:00%2B08:00&dateto=2017-11-02T00:00:00%2B08:00" \ -X "GET" \ -H "X-Time-Zone:GMT+08:00" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -d '[ { "domain":"test.com", "stream":[ "test.com/abc/steam01" ] } ]'
{ "result":[ { "domain":"test.com", "details":[ { "stream":"test.com/abc/steam01", "peakTime":"2017-01-03 00:00", "peakValue":100024 } ] } ] }