CDN

查询用户区域占比

最近更新时间:2019-11-10 19:20:27

GetAreaData

描述

本接口用于获取国内各省份、海外地区及运营商的访问流量、访问次数、流量占比、请求数占比数据

  • 支持按指定的起止时间查询,两者需要同时指定
  • 支持批量域名查询,多个域名ID用逗号(半角)分隔
  • 最多可获取最近一年内93天跨度的数据
  • 时效性:5分钟延迟
  • 使用场景:

    • 查询用户区域统计分析数据,包含各省份及运营商的流量、访问次数、流量占比、请求数占比,海外地区的流量、访问次数、流量占比、请求数占比,用于绘制用户区域数据分布表。
  • 说明:

    • 运营商包含:电信、联通、移动、铁通、鹏博士、教育网、国内其他、海外ISP
    • 地区包含:国内32个省、香港、台湾、澳门,其他海外各地区统一合并为海外

请求语法

本接口请求需要包含指定目录 /2016-09-01/statistics/GetAreaData和公共请求header和该接口所特有的请求参数,具体请求语句参照下文请求示例。

请求参数

参数名 必选 类型及范围 说明
StartTime String 获取数据起始时间点,日期格式按ISO8601表示法,北京时间,格式为:YYYY-MM-DDThh:mm+0800,例如: 2016-08-01T21:14+0800
EndTime String 结束时间需大于起始时间;获取日期格式按照ISO8601表示法,北京时间,格式为:YYYY-MM-DDThh:mm+0800,例如: 2016-08-01T21:14+0800
CdnType String 产品类型,只允许输入一种类型,取值为file:大文件下载,video:音视频点播,page:图片小文件,live:流媒体直播,当前暂不支持直播类型
DomainIds String 域名ID,缺省为当前产品类型下的全部域名,可输入需要查询的域名ID,支持批量域名查询,多个域名ID用逗号(半角)分隔,当选择多个域名时,数据做合并返回

返回参数

参数名 类型及范围 说明
StartTime String 开始时间
EndTime String 结束时间
CdnType String 产品类型
DomainIds String 域名ID列表,逗号(半角)间隔
Datas AreaDataByArea[] 查询时间段内的地区数据

AreaDataByArea

参数名 类型及范围 说明
Area String 地区名称,国内为省份,海外为国家。具体枚举类型表见使用须知
Flow Long 服务流量(所选域名、所选时间段内合并值)
Pv Long 服务请求数(所选域名、所选时间段内合并值)
FlowProportion Double 流量占比(所选域名在所选时间段内在该区域的流量合并值占总量的百分比)
PvProportion Double 请求数占比(所选域名在所选时间段内在该区域的请求数合并值占总请求数的百分比)
Isps AreaDataByIsp[] 该区域各运营商的统计数据,当区域为海外国家时

AreaDataByIsp

参数名 类型及范围 说明
Isp String Isp名称,国内运营商为:电信,铁通,联通,移动,鹏博士,教育网,国内其他,海外运营商为:海外运营商。具体枚举类型表见附录
Flow Long 服务流量(所选域名、所选时间段内合并值)
Pv Long 服务请求数(所选域名、所选时间段内合并值)
FlowProportion Double 流量占比(所选域名在所选时间段内在该区域该运营商的流量合并值占总量的百分比)
PvProportion Double 请求数占比(所选域名在所选时间段内在该区域该运营商的请求数合并值占总请求数的百分比)

示例

请求示例

GET方式:

GET /2016-09-01/statistics/GetAreaData?DomainIds=&StartTime=2019-03-06T00%3A00%2B0800&EndTime=2019-05-15T00%3A15%2B0800&CdnType=file
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: GetAreaData
x-version: 2016-09-01

POST方式:

POST /2016-09-01/statistics/GetAreaData 1.1
Host: cdn.api.ksyun.com
X-Amz-Date: date
Authorization:authorization string
x-action: GetAreaData
x-version: 2016-09-01
Content-Type: application/json
{
    "DomainIds": "",
    "StartTime": "2019-03-06T00:00+0800",
    "EndTime": "2019-05-15T00:15+0800",
    "CdnType": "file"
}

返回示例

{
    "StartTime": "2019-03-06T00:00+0800",
    "EndTime": "2019-05-15T00:15+0800",
    "CdnType": "file",
    "DomainIds": "2D098TV,2D098TU,2D098TQ,2D098TP,2D098CR,2D0981C,2D097WG,2D097VG,2D097TQ,2D097RE,2D097RD,2D097R5,2D097R3,2D097R2,2D097R0,2D097Q1,2D097Q0,2D097PJ,2D097PF,2D097PD,2D097P0,2D097NC,2D097KU,2D097G8,2D09777,2D09755,2D0974U,2D0974H,2D096DF,2D096DE,2D096DA,2D0964B,2D0964A,2D093PD,2D093JD,2D093JC,2D093EX,2D093A9,2D0931G,2D092NG,2D092MW,2D092KM,2D092KJ,2D092KC,2D092K9,2D092K3,2D092HX,2D092HU,2D092CD,2D092CB,2D092CA,2D091WC,2D091P1,2D091GU,2D091GT,2D091GN,2D091GJ,2D091FX,2D090WN,2D090WM,2D090RS,2D090HU,2D090GJ,2D090DC,2D090AF,2D0902M,2D09007,2D08XV2,2D08XSJ,2D08XFC,2D08X50,2D08X0G,2D08X0F,2D08WXK,2D08WMU,2D08WKU,2D08WK9,2D08W0R,2D08VCA,2D08V69,2D08V2X,2D08V1H,2D08V0H,2D08UVS,2D08UVR,2D08UVQ,2D08UVP,2D08UVN,2D08UVK,2D08UVJ,2D08UVH,2D08UVG,2D08UVA,2D08UU5,2D08UP7,2D08UP4,2D08UP3,2D08UM5,2D08UM3,2D08UKX,2D08UJA,2D08UG5,2D08UEQ,2D08U7V,2D08U7U,2D08U44,2D08TSS,2D08TNN,2D08TK0,2D08TJP,2D08TCK,2D08TCJ,2D08T6A,2D08T25",
    "Datas": [
        {
            "Area": "jiangsu",
            "Flow": 12266,
            "Pv": 4,
            "FlowProportion": 3.7982640576954636,
            "PvProportion": 5.194805194805195,
            "Isps": [
                {
                    "Isp": "UN",
                    "Flow": 1095,
                    "Pv": 3,
                    "FlowProportion": 8.92711560410892,
                    "PvProportion": 75.0
                },
                {
                    "Isp": "CT",
                    "Flow": 11171,
                    "Pv": 1,
                    "FlowProportion": 91.07288439589108,
                    "PvProportion": 25.0
                }
            ]
        },
        {
            "Area": "henan",
            "Flow": 269709,
            "Pv": 58,
            "FlowProportion": 83.51752818661224,
            "PvProportion": 75.32467532467533,
            "Isps": [
                {
                    "Isp": "UN",
                    "Flow": 44788,
                    "Pv": 20,
                    "FlowProportion": 16.606045775261485,
                    "PvProportion": 34.48275862068966
                },
                {
                    "Isp": "CT",
                    "Flow": 224921,
                    "Pv": 38,
                    "FlowProportion": 83.39395422473851,
                    "PvProportion": 65.51724137931035
                }
            ]
        },
        {
            "Area": "shanghai",
            "Flow": 11224,
            "Pv": 1,
            "FlowProportion": 3.475600504123095,
            "PvProportion": 1.2987012987012987,
            "Isps": [
                {
                    "Isp": "CT",
                    "Flow": 11224,
                    "Pv": 1,
                    "FlowProportion": 100.0,
                    "PvProportion": 100.0
                }
            ]
        },
        {
            "Area": "zhejiang",
            "Flow": 11117,
            "Pv": 1,
            "FlowProportion": 3.4424671065873533,
            "PvProportion": 1.2987012987012987,
            "Isps": [
                {
                    "Isp": "CT",
                    "Flow": 11117,
                    "Pv": 1,
                    "FlowProportion": 100.0,
                    "PvProportion": 100.0
                }
            ]
        },
        {
            "Area": "hubei",
            "Flow": 721,
            "Pv": 2,
            "FlowProportion": 0.22326336096514182,
            "PvProportion": 2.5974025974025974,
            "Isps": [
                {
                    "Isp": "UN",
                    "Flow": 721,
                    "Pv": 2,
                    "FlowProportion": 100.0,
                    "PvProportion": 100.0
                }
            ]
        },
        {
            "Area": "shandong",
            "Flow": 17900,
            "Pv": 11,
            "FlowProportion": 5.542876784016697,
            "PvProportion": 14.285714285714285,
            "Isps": [
                {
                    "Isp": "UN",
                    "Flow": 17900,
                    "Pv": 11,
                    "FlowProportion": 100.0,
                    "PvProportion": 100.0
                }
            ]
        }
    ]
}

金山云,开启您的云计算之旅

注册有礼