使用习惯

优质
小牛编辑
126浏览
2023-12-01

功能介绍

获取本APP使用习惯相关数据

接口

https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey

请求参数

此处仅列本接口特有参数,公共参数请参考报告级API说明

获取表格数据

参数名参数类型是否必须描述
methodstringvisit/character/a;visit/character/f
metricsstring指标列表,指标间逗号分隔
flagstring具体请求的报告类别,见下方

Flag

FLAG描述
depth访问深度
time使用时长
interval使用间隔
frequency使用频率

指标

指标名描述适用接口
session_count启动次数visit/character/a,visit/character/f
session_count_ratio所占比率visit/character/a

示例

获取访问深度表格数据

请求

https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey?access_token=[ACCESS_TOKEN]&key=[APP_KEY]&method=visit/character/a&start-date=20170101000000&end-date=20170101232359&metrics=session_count,session_count_ratio

响应

{
    "status": 0,
    "msg": "",
    "data": {
        "offset": 0,
        "timeSpan": [
            "2017/11/02 - 2017/11/08"
        ],
        "fields": [
            "visit_depth_title",
            "session_count",
            "session_count_ratio"
        ],
        "total": 8,
        "sum": [
            [
                25057907,
                100
            ],
            []
        ],
        "pageSum": [],
        "items": [
            [
                [
                    "1页"
                ],
                [
                    "2页"
                ],
                [
                    "3页"
                ],
                [
                    "4页"
                ],
                [
                    "5页"
                ],
                [
                    "6-10页"
                ],
                [
                    "11-50页"
                ],
                [
                    "50页以上"
                ]
            ],
            [
                [
                    7735288,
                    30.87
                ],
                [
                    4173861,
                    16.66
                ],
                [
                    2765066,
                    11.03
                ],
                [
                    1849427,
                    7.38
                ],
                [
                    1329829,
                    5.31
                ],
                [
                    3216575,
                    12.84
                ],
                [
                    3047730,
                    12.16
                ],
                [
                    940131,
                    3.75
                ]
            ],
            [],
            []
        ]
    }
}