直播房间长链信息及心跳ID
https://member.bilibili.com/arcopen/fn/live/room/ws-start
开放能力 / 直播能力 / 直播间长连和消息
获取直播间长链及长链心跳ID
响应字段
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| conn_id | string | 是 | 心跳ID (获取后,需要在30秒内使用心跳接口对该id保持心跳,否则获取的长连地址会停止推送数据) |
| websocket_info.auth_body | string | 是 | websocket连接使用的请求参数 |
| websocket_info.wss_link | []string | 是 | websocket连接地址 |
调用方式
javascript
// 让 AI 直接调(需要开放平台凭据)
bili_api_call { "ref": "43", "query": {…}, "body": {…} }
// 只看将要发出的请求(不需要凭据)
bili_api_call { "ref": "43", "dryRun": true }
// 生成完整调用代码
bili_codegen { "ref": "43", "lang": "python" }官方请求示例
bash
curl --location --request POST 'https://member.bilibili.com/arcopen/fn/live/room/ws-start' \
--header 'Accept: application/json' \
--header 'Access-Token: a24e56a0fc0093668bca0f3a15410ea2' \
--header 'Authorization: 950a03adb287904a93bcffd7e4abf57a4c2ef0608bf1f95f3bcb2c278ae532be' \
--header 'X-Bili-Accesskeyid: 93a0f774fae84e6c' \
--header 'X-Bili-Content-Md5: d41d8cd98f00b204e9800998ecf8427e' \
--header 'X-Bili-Signature-Method: HMAC-SHA256' \
--header 'X-Bili-Signature-Nonce: 1730185575446751000' \
--header 'X-Bili-Signature-Version: 2.0' \
--header 'X-Bili-Timestamp: 1730185575' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Content-Type: application/json' \
--header 'Host: member.bilibili.com' \
--header 'Connection: keep-alive'原始文档:043_直播房间长链信息及心跳ID.md(2332 字节)。用 bili_docs_get { "ref": "43" } 读全文,或用 bili_api_spec { "ref": "43" } 取结构化规格。