事件趋势

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

功能介绍

获取单个事件的趋势报告数据

接口

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

请求参数

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

获取表格数据

参数名参数类型是否必须描述
methodstringevents/trend/a,events/trend/f
metricsstring指标列表,指标间逗号分隔
eventIduint当前需要获取趋势的事件ID

指标

指标名描述适用接口
event_count事件数量events/trend/a,events/trend/f
event_user_count触发用户数events/trend/a,events/trend/f
average_event_time事件平均使用时长events/trend/a,events/trend/f

示例

获取事件趋势表格数据

请求

https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey?access_token=[ACCESS_TOKEN]&key=[APP_KEY]&method=event/trend/a&start-date=20171102000000&end-date=20171107232359&metrics=event_count,event_user_count,average_event_time&eventId=232222

响应

{
    "status": 0,
    "msg": "",
    "data": {
        "offset": 0,
        "timeSpan": [
            "2017\/11\/07 - 2017\/11\/08"
        ],
        "fields": [
            "simple_date_title",
            "event_count",
            "event_user_count",
            "average_event_time"
        ],
        "total": 2,
        "end": 0,
        "sum": [
            [
                8646,
                2959,
                0
            ],
            []
        ],
        "pageSum": [],
        "items": [
            [
                [
                    "2017\/11\/08"
                ],
                [
                    "2017\/11\/07"
                ]
            ],
            [
                [
                    4348,
                    1455,
                    0
                ],
                [
                    4298,
                    1504,
                    0
                ]
            ],
            [],
            []
        ]
    }
}