当前浏览的是 v7 预览版文档(v7 尚未正式发布,API 可能随版本调整)。本页是 v7 新增内容,去 v6 正式版文档首页
@ikenxuan/amagi

直播间信息

取指定直播间的当前信息。variant=h5 走 h5 接口,否则走 web;web 端请提供 request_user_id 或含 userId 的 Cookie。

GET
/api/xiaohongshu/fetch_live_room

Authorization

bearerAuth
AuthorizationBearer <token>

仅在 startServer 传了 token 时生效

In: header

Query Parameters

room_id*string

直播间 ID

Length1 <= length
variant?string

端类型,默认 web

Value in

  • "h5"
  • "web"
request_user_id?string

请求方用户 ID;web 默认从 Cookie 的 userId 读取,h5 不使用

Length1 <= length
source?string

来源标识,默认按端类型取(web=web_live)

client_type?integer

客户端类型,web 端默认 1

Range1 <= value <= 9007199254740991

Response Body

application/json

application/json

curl -X GET "https://example.com/api/xiaohongshu/fetch_live_room?room_id=string"
{  "success": true,  "data": {    "code": 0,    "data": {      "host_info": {        "avatar": "string",        "nick_name": "string",        "user_id": "string"      },      "room_info": {        "deeplink": "string",        "display_count": 0,        "display_member_count": "string",        "display_praise_count": "string",        "display_viewer_count": "string",        "is_sports_event": true,        "join_limit_types": [          0        ],        "monetize_type": 0,        "pull_config": "string",        "pv": 0,        "room_cover": "string",        "room_id": "string",        "room_title": "string",        "settings": {          "camera_direction": 0,          "hide_viewer_switch": 0,          "is_filter_on": true        },        "status": 0,        "tab_config": {          "tab_bg_color": "string",          "tab_items": [            {              "competition_id": 0,              "match_id": 0,              "page_type": 0,              "season_id": 0,              "tab_index": 0,              "tab_name": "string",              "tab_type": 0,              "tab_url": "string"            }          ]        },        "viewer_info_display_type": 0      }    },    "msg": "string",    "success": true  },  "error": {    "kind": "validation",    "code": "string",    "message": "string",    "retryable": true,    "platform": {      "code": "string",      "message": "string"    },    "http": {      "status": 0,      "statusText": "string"    },    "issues": [      {        "path": "string",        "message": "string",        "received": null      }    ]  },  "message": "string",  "meta": {    "requestId": "string",    "clientId": "string",    "platform": "douyin",    "endpoint": "string",    "durationMs": 0,    "attempts": 0,    "trace": [      {        "url": "string",        "method": "string",        "status": 0,        "durationMs": 0,        "reason": "initial",        "retryOf": "string"      }    ]  },  "requestPath": "/api/bilibili/fetch_one_video?bvid=BV1xx"}