Skip to content

直播详情

基本信息

项目说明
接口路径POST /v1/live/detail
响应类型application/json
认证方式API Key + 请求签名(认证说明

请求体

json
{
  "id": 123,
  "language": "zh"
}
字段类型必填说明
idnumber直播 ID,来自直播列表接口
languagestring语言代码,如 zhenja

响应格式

成功响应

json
{
  "code": 10200,
  "success": true,
  "message": "OK",
  "data": {
    "id": "123",
    "agent_id": "agent-uuid",
    "agent_name": "Aria",
    "cover": "https://cdn.example.com/cover.jpg",
    "scenes": [
      {
        "scene_id": "1",
        "scene_display_name": "办公室",
        "scene_order": 1,
        "videos": [
          {
            "video_id": "101",
            "video_display_name": "日常问候",
            "video_type": "free",
            "video_url": "https://cdn.example.com/video.mp4",
            "video_order": 1,
            "play_coins": 0,
            "show_hardware_sync": false,
            "prev_video_id": null,
            "next_video_id": "102"
          }
        ]
      }
    ]
  }
}
字段类型说明
data.idstring直播 ID
data.agent_idstring角色 ID
data.agent_namestring角色名称
data.coverstring封面图 URL
data.scenesarray场景列表,按 scene_order 升序排列
data.scenes[].scene_idstring场景 ID
data.scenes[].scene_display_namestring场景展示名称
data.scenes[].scene_ordernumber场景排序权重
data.scenes[].videosarray场景内视频列表,按 video_order 升序排列
data.scenes[].videos[].video_idstring视频 ID
data.scenes[].videos[].video_display_namestring视频展示名称
data.scenes[].videos[].video_typestring视频类型(如 freepaid
data.scenes[].videos[].video_urlstring视频播放地址
data.scenes[].videos[].video_ordernumber视频排序权重
data.scenes[].videos[].play_coinsnumber解锁所需金币数,0 表示免费
data.scenes[].videos[].show_hardware_syncboolean是否展示硬件同步功能
data.scenes[].videos[].prev_video_idstring | null前一个视频 ID,无则为 null
data.scenes[].videos[].next_video_idstring | null后一个视频 ID,无则为 null

错误响应

HTTP 状态码说明
401认证失败
400请求参数缺失或格式错误
500服务内部错误

业务错误(HTTP 200):

message说明
Live stream not found直播不存在或无对应语言内容
Invalid API keyAPI Key 无效或已禁用

客户端示例

javascript
async function getLiveDetail(apiKey, apiSecret, userId, liveId, language = 'zh') {
  const body = { id: liveId, language }
  const headers = await buildAuthHeaders(apiKey, apiSecret, userId, body)

  const response = await fetch('/v1/live/detail', {
    method: 'POST',
    headers,
    body: JSON.stringify(body),
  })

  const result = await response.json()
  if (!result.success) throw new Error(result.message)
  return result.data // { id, agent_id, agent_name, cover, scenes }
}

Released under the MIT License.