文档中心 API文档 查询单域名的各流名独立IP数汇总

查询单域名的各流名独立IP数汇总

更新时间:2023-06-01 13:55:30

适用产品

直播分发

接口描述

获取特定时间段内,每路流的独立IP数(天粒度)。

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Body 参数

参数名称类型必填描述
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.不传时默认查询域名下所有流名,同时受流名数量上限限制;

返回参数

Body 参数

参数名称类型描述
result
List
domain
String域名
details
List
stream
String流名
timestamp
String时间,格式为yyyy-MM-dd
total
Integer独立IP数

错误码

错误代码(code)描述(message)HTTP状态码语义
NotAcceptableThe   accept header specified in your request is not acceptable.400Accept请求头不支持,接口仅支持json格式
InvalidHTTPRequestThere   was an error in the body of your HTTP request.400请求体格式错误
DateSpanErrorYou   cannot specify a period greater than 3.400datefrom和dateto相差超过3天
InvalidDatePeriodThe   date specified is invalid.400datefrom或dateto不符合规范
DomainsExcessiveThe   number of domain is excessive once.403域名数量超出限制
StreamsExcessiveThe   number of stream is excessive once.403流名数量超出限制
PARAM_INVALIDparam:   stream is null or invalid.400参数stream不符合规范
NoSuchDomainThe   specified domain does not exist.404域名不存在或不属于当前调用账号
InternalErrorWe   encountered an internal error. Please try again.500系统发生错误

示例

JSON
JSON
请求示例
复制代码 复制成功
#!/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
                  }
              ]
          }
      ]
  }
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!