Skip to content

获取直播间观看数据

请求路径

  • 请求方式:POST
  • 请求头:Content-Type:application/json
  • 接口地址:https://gateway.nuoyunapi.com/Api/RoomRounds/getRoomUserDurationList/2.0.0
  • 频率限制:10秒30次

请求参数

参数必选类型描述
room_idinteger直播间ID
pageinteger第几页(最小值1)
page_sizeinteger一页显示多少(最小值为1,最大值500)
room_rounds_idinteger场次ID(传0时,获取全部直播数据)

请求示例

json
{
    "room_id": 1000001,
    "page": 1,
    "page_size": 10,
    "room_rounds_id": 1001
}

响应参数

参数必选类型描述
codeinteger状态码:200-成功,400-失败
msgstring提示信息
dataobject观看数据

data 参数结构

参数必选类型描述
totalinteger用户总数
listarray用户观看时长列表

list 参数结构

参数必选类型描述
wechat_user_space_idinteger用户ID
wechat_user_namestring用户昵称
wechat_user_photostring用户头像
first_timestring初次访问时间
last_timestring最近访问时间
stay_durationinteger在线时长(秒)
ipstring最近访问IP
third_uuidstring三方系统用户ID
third_wechat_infoobject第三方微信信息
live_durationinteger直播时长(秒)
playback_durationinteger回放时长(秒)

third_wechat_info 参数结构

参数必选类型描述
authorizer_appidstring第三方公众号appid
openidstring第三方openid
unionidstring第三方unionid

响应示例

json
{
    "code": 200,
    "data": {
        "total": 2,
        "list": [
            {
                "wechat_user_space_id": 1001,
                "wechat_user_name": "用户001",
                "wechat_user_photo": "https://example.com/avatar/001.jpg",
                "first_time": "2025-06-23 09:11:34",
                "last_time": "2025-07-01 14:56:14",
                "stay_duration": 180,
                "ip": "192.168.1.100",
                "third_uuid": "uuid_001",
                "third_wechat_info": {
                    "authorizer_appid": "wx1234567890abcdef",
                    "openid": "openid_example_001",
                    "unionid": "unionid_example_001"
                },
              "live_duration": 180,
              "playback_duration": 180
            },
            {
                "wechat_user_space_id": 1002,
                "wechat_user_name": "用户002",
                "wechat_user_photo": "https://example.com/avatar/002.jpg",
                "first_time": "2025-06-23 11:53:35",
                "last_time": "2025-06-30 15:04:42",
                "stay_duration": 60,
                "ip": "192.168.1.101",
                "third_uuid": "",
                "third_wechat_info": {
                    "authorizer_appid": "",
                    "openid": "",
                    "unionid": ""
                },
              "live_duration": 100,
              "playback_duration": 100
            }
        ]
    },
    "msg": "Success"
}