直播分发
获取特定时间段内,每路流的独立IP数(天粒度)。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
datefrom | String | 否 | 开始时间 1.格式为yyyy-MM-ddTHH:mm:ss+08:00; 2.必须小于当前时间和dateTo; 3.dateFrom和dateTo相差不能超过3天(可联系技术支持调整); 4.只能查询最近2年内数据。 |
dateto | String | 否 | 结束时间 1.格式为yyyy-MM-ddTHH:mm:ss+08:00; 2.必须大于dateFrom; |
domain | String | 否 | 域名,数量上限1个 |
stream | String | 否 | 流名: 1.流名个数限制根据账号可调,默认为20个; 2.不传时默认查询域名下所有流名,同时受流名数量上限限制; |
参数名称 | 类型 | 描述 |
---|---|---|
result | List | |
domain | String | 域名 |
details | List | |
stream | String | 流名 |
timestamp | String | 时间,格式为yyyy-MM-dd |
total | Integer | 独立IP数 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
NotAcceptable | The accept header specified in your request is not acceptable. | 400 | Accept请求头不支持,接口仅支持json格式 |
InvalidHTTPRequest | There was an error in the body of your HTTP request. | 400 | 请求体格式错误 |
DateSpanError | You cannot specify a period greater than 3. | 400 | datefrom和dateto相差超过3天 |
InvalidDatePeriod | The date specified is invalid. | 400 | datefrom或dateto不符合规范 |
DomainsExcessive | The number of domain is excessive once. | 403 | 域名数量超出限制 |
StreamsExcessive | The number of stream is excessive once. | 403 | 流名数量超出限制 |
PARAM_INVALID | param: stream is null or invalid. | 400 | 参数stream不符合规范 |
NoSuchDomain | The specified domain does not exist. | 404 | 域名不存在或不属于当前调用账号 |
InternalError | We encountered an internal error. Please try again. | 500 | 系统发生错误 |
#!/bin/bash # 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/total/stream?datefrom=2017-11-01T00:00:00%2B08:00&dateto=2017-11-02T00:00:00%2B08:00" \ -X "POST" \ -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", "timestamp":"2017-01-01", "total":900001 } ] } ] }