实时访客
优质
小牛编辑
137浏览
2023-12-01
功能介绍
获取实时访客报告数据,包括表格详情数据与趋势数据,所获取数据与 https://mtj.baidu.com 中报告数据一致
接口
https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey
此处仅列本接口特有参数,公共参数请参考报告级API说明
获取表格数据
参数名 | 参数类型 | 是否必须 | 描述 |
---|---|---|---|
method | string | 是 | sample/a |
sessionType | int | 是 | 访客类型(0:近期访客,1:在线访客) |
示例
获取实时访客数据
请求
https://openapi.baidu.com/rest/2.0/mtj/svc/app/getDataByKey?access_token=[ACCESS_TOKEN]&key=[APPKEY]&method=sample/a
响应
{
"status": 0,
"msg": "",
"data": {
"offset": 0,
"fields": [
"session_start_time",
"sample_version",
"sample_channel",
"sample_area",
"first_page",
"last_page",
"session_duration",
"session_depth"
],
"total": 300,
"items": [
[
[
{
"start_time": "2017/11/08 12:54:11",
"os_version": "iOS 10.2",
"device": "iPhone 5s",
"screen": "640*1136",
"network": "WIFI",
"pages": [
{
"duration": 0,
"page": "logsHomePagePv",
"alias": "2.0首页精彩推荐tab"
},
{
"duration": 1,
"page": "searchindex",
"alias": "搜索页"
},
{
"duration": 3,
"page": "summary_view",
"alias": "目录页"
},
{
"duration": 3,
"page": "summary_view",
"alias": "目录页"
},
{
"duration": 1,
"page": "summary_view",
"alias": "目录页"
},
{
"duration": 4,
"page": "searchindex",
"alias": "搜索页"
}
]
}
],
[
{
"start_time": "2017/11/08 12:53:10",
"os_version": "iOS 10.2",
"device": "iPhone 5s",
"screen": "640*1136",
"network": "WIFI",
"pages": [
{
"duration": 0,
"page": "logsHomePagePv",
"alias": "2.0首页精彩推荐tab"
},
{
"duration": 10,
"page": "searchindex",
"alias": "搜索页"
},
{
"duration": 2,
"page": "online_view",
"alias": "在线词条页"
},
{
"duration": 0,
"page": "searchindex",
"alias": "搜索页"
},
{
"duration": 6,
"page": "searchindex",
"alias": "搜索页"
}
]
}
]
...
],
[
[
"2.0.1",
"1.2+AppStore",
"广西",
"2.0首页精彩推荐tab",
"搜索页",
"69",
"6"
],
[
"2.0.1",
"1.2+AppStore",
"广西",
"2.0首页精彩推荐tab",
"搜索页",
"47",
"5"
],
...
]
]
}
}