You need to enable JavaScript to run this app.
导航
GetCustomActMsgAPI - 自定义查询直播间信息
最近更新时间:2025.03.21 16:48:05首次发布时间:2022.09.15 14:09:46
我的收藏
有用
有用
无用
无用

按需查询直播间信息,包括直播状态等直播间基础信息、外观主题等直播间基础配置、直播间内各直播频道的推拉流信息及直播间在线人数。

注意事项

  • 请求频率:单用户请求频率限制为 120 次/分钟
  • 前提条件:确保您拥有火山引擎主账号或具备直播间的观看页管理 > 仅查看可编辑权限的子账号。有关如何添加子账号,详见子账号管理

请求说明

  • 请求方式:GET
  • 请求地址:https://livesaas.volcengineapi.com/?Action=GetCustomActMsgAPI&Version=2020-06-01

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息详见公共参数

Query

参数类型是否必选示例值描述
ActionStringGetCustomActMsgAPI接口名称。当前 API 的名称为 GetCustomActMsgAPI
VersionString2020-06-01接口版本。当前 API 的版本为 2020-06-01

ActivityId

Long

172183460671

直播间 ID。您可以通过 ListActivityAPI 接口查询 ID。

说明

使用子账号调用接口时,确保该直播间对子账号可见。有关如何配置子账号的可见范围,详见子账号管理

NeedActMsg

Integer

1

是否查询直播状态、观看地址等直播间基础信息,默认不查询。

  • 1:是
  • 其他值:否

NeedActBasicMsg

Integer

1

是否查询文本标签、外观主题等直播间基础配置,默认不查询。

  • 1:是
  • 其他值:否

NeedActStreamMsg

Integer

1

是否查询直播间内各直播频道的推拉流信息,默认不查询。

  • 1:是
  • 其他值:否

NeedRealTimeOnlineNumber

Integer

1

是否查询直播间在线人数(包含虚拟人气),默认不查询。

  • 1:是
  • 其他值:否

返回参数

参数类型示例值描述
ActMsgObject of ActMsg-直播状态、观看地址等直播间基础信息。
ActBasicMsgObject of ActBasicMsg-文本标签、外观主题等直播间基础配置。
ActStreamMsgObject of ActStreamMsg-直播间内各直播频道的推拉流信息。
RealTimeOnlineNumberObject of RealTimeOnlineNumber-直播间在线人数(包含虚拟人气)。

ActMsg

参数类型示例值描述
IdLong172183460671直播间 ID。
NameString直播间 A直播间名称。
LiveTimeLong1642070520直播间的开播时间。Unix 时间戳,单位为秒。

CoverImage

String

https://image1.xxx

横屏直播的封面图 URL。

  • 若通过控制台配置横屏直播封面图且配置成功,则封面图的 URL 无协议头。
  • 若通过调用 API 接口配置横屏直播封面,则封面图的 URL 有协议头。
VerticalCoverImageStringhttps://image2.xxx竖屏直播的封面图 URL,包含协议头。

Status

Integer

2

直播状态。支持以下取值:

  • 1:直播中
  • 2:预告
  • 3:回放
  • 4:已结束
ViewUrlStringhttps://live.xxx.com/xxx直播间的观看地址。

IsLockPreview

Integer

0

是否锁定预告。支持以下取值:

  • 0:否
  • 1:是
OwnerSubAccountStringadmin@bytedance.com创建直播间的账号信息。 返回 admin@bytedance.com 表示当前直播间由主账号创建。

LiveReviewStatus

Integer

2

直播间审核状态。支持以下取值:

  • 1:审核中
  • 2:审核通过
  • 3:审核驳回
  • 4:审核归档
  • 5:草稿
  • 6:无需审核

ActBasicMsg

参数类型示例值描述
ActivityIdLong172183460671直播间 ID。
NameString直播间 A直播间名称。
LiveTimeLong1642070520直播间的开播时间。Unix 时间戳,单位为秒。
IsCoverImageEnableInteger1开启直播封面。取值固定为 1

CoverImageUrl

String

//gjrfd7ferd-image.image

横屏直播封面图的 URL。

  • 若通过控制台配置横屏直播封面图且配置成功,则封面图的 URL 无协议头。
  • 若通过调用 API 接口配置横屏直播封面,则封面图的 URL 有协议头。

IsPcBackImageEnable

Integer

1

是否开启 PC 端背景图和背景颜色。支持以下取值:

  • 0:关闭背景图
  • 1:开启背景图
  • 2:开启背景颜色
PcBackImageUrlString//p-imagex-live18n.test.org/tos-live18n-i-fhdptwgppv.pngPC 端背景图的 URL。当 IsPcBackImageEnable 取值为 1 时,此处为 PC 端背景图的 URL,否则为空。

IsMobileBackImageEnable

Integer

1

是否开启移动端背景图和背景颜色。支持以下取值:

  • 0:关闭背景图
  • 1:开启背景图
  • 2:开启背景颜色
MobileBackImageUrlString//p-imagex-live18n.test.org/tos-live18n-i-fhdptwgppv.png移动端背景图的 URL。当 IsMobileBackImageEnable 取值为 1 时,此处为移动端背景图的 URL,否则为空。

IsPreviewVideoEnable

Integer

1

是否开启预告片。支持以下取值:

  • 0:关闭
  • 1:开启
PreviewVideoVidString491568852预告片 Vid。当 IsPreviewVideoEnable 取值为 1 时,此处为预告片 Vid,否则为空。

IsPeopleCountEnable

Integer

0

是否在观看页显示观看人数。支持以下取值:

  • 0:关闭
  • 1:开启

IsHeaderImageEnable

Integer

0

是否开启移动端页头图。支持以下取值:

  • 0:关闭
  • 1:开启
HeaderImageUrlString//p.test.org/tos-live18n-i-fhdptwgppv.png移动端页头图的 URL。当 IsHeaderImageEnable 取值为 1 时,此处为移动端页头图的 URL,否则为空。

IsWatermarkImageEnable

Integer

0

是否在观看页显示 Logo。支持以下取值:

  • 0:关闭
  • 1:开启
WatermarkImageUrlString//p-imagex.org/tos-live18n-i-fhdptwgppv.pngLogo 的 URL。当 IsWatermarkImageEnable 取值为 1 时,此处为 Logo 的 URL,否则为空。

IsThumbUpEnable

Integer

1

是否开启直播间点赞。支持以下取值:

  • 0:关闭
  • 1:开启
ThumbUpUrlString//p-imagex.png直播间点赞图的 URL。当 IsThumbUpEnable 取值为 1 时,此处为直播间点赞图的 URL,否则为空。

IsShareIconEnable

Integer

1

是否开启分享图标。支持以下取值:

  • 0:关闭
  • 1:开启
ShareIconUrlString//p-imagex-live18n.test.org/tos-live18n-i-fhdptwgppv.pn分享图标的 URL。当 IsShareIconEnable 取值为 1 时,此处为分享图标的 URL,否则为空。
IsCommentTranslateEnableInteger-已废弃。
AnnouncementString直播间信息直播描述。
BackgroundColorString77778888PC 端背景颜色。遵循 RGB 色彩模型。
FontColorString55557777字体颜色。遵循 RGB 色彩模型。
InteractionColorString45784444PC 端互动区颜色。遵循 RGB 色彩模型。

ColorThemeIndex

String

light

外观主题。支持以下取值:

  • light:清爽模式
  • dark:暗黑模式
  • cold:经典模式
  • holiday:传统节庆

IsCountDownEnable

Integer

1

是否开启倒计时。支持以下取值:

  • 0:关闭
  • 1:开启

IsAutoStartEnable

Integer

1

是否开启自动开播。支持以下取值:

  • 0:关闭
  • 1:开启

IsPCHeaderImageEnable

Integer

1

是否开启 PC 端页头图。支持以下取值:

  • 0:关闭
  • 1:开启
PCHeaderImageUrlString//p-imagex-fhdptwgppv.pnPC 端页头图的 URL。当 IsPCHeaderImageEnable 取值为 1 时,此处为 PC 端页头图的 URL,否则为空。

IsPageLimitEnable

Integer

1

是否开启页面限制。支持以下取值:

  • 0:关闭
  • 1:开启

PageLimitType

String

pc

页面限制类型。当 IsPageLimitEnable 取值为 1 时,此处为页面限制类型,否则为空。支持以下取值:

  • pc:仅 PC 端可观看
  • mobile:仅移动端可观看

IsLanguageEnable

Integer

1

是否开启页面语言。支持以下取值:

  • 0:关闭
  • 1:开启

PlayerTopType

Array of String

1

播放器置顶的终端。支持以下取值:

  • 0:关闭(已废弃)
  • 1:PC 端
  • 2:移动端

IsReplayAutoOnlineEnable

Integer

1

是否开启回放自动上架。支持以下取值:

  • 0:关闭
  • 1:开启
SiteTagsArray of SiteTags-直播间分类标签信息列表。
TextSiteTagsArray of TextSiteTags-直播间文本标签信息列表。

ActStreamMsg

参数类型示例值描述
LineDetailsArray of LineDetails-直播频道的推拉流信息列表。

RealTimeOnlineNumber

参数类型示例值描述
RealPopularityInteger2000直播间真实人数。
FakePopularityInteger2000直播间虚拟人气。

SiteTags

参数类型示例值描述
NameString分类标签分类标签名称。
ValueString标签1分类标签的标签值。
IndexInteger0分类标签的索引值,用于标识分类标签在控制台展示的位置。取值范围为 [0,19]。

TextSiteTags

参数类型示例值描述
NameString文本标签文本标签名称。
ValueString标签2文本标签值。
IndexInteger0文本标签的索引值,用于标识文本标签在控制台展示的位置,取值范围为 [0,4]。

LineDetails

参数类型示例值描述
LineIdLong123直播频道 ID。
LineNameString线路1直播频道名称。
MainPushInfoArray of MainPushInfo-直播频道主流的推流地址。
BackPushInfoArray of BackPushInfo-直播频道备流的推流地址。
ForwardInfoArray of ForwardInfo-直播频道主流的拉流转推信息。
BackupForwardInfoArray of BackupForwardInfo-直播频道备流的拉流转推信息。
ExpireTimeLong1643004493直播频道推流码的过期时间。

MainPushInfo

参数类型示例值描述
PushPathStringhttps://example-livesaas.com/example推流服务器 URL。
PushUrlStringhttps://example-livesaas.com/example/livesaas?key=example推流完整 URL。
StreamingCodeStringlivesaas?key=example推流串流秘钥。

BackPushInfo

参数类型示例值描述
PushPathStringhttps://example2-livesaas.com/example2推流服务器 URL。
PushUrlStringhttps://example2-livesaas.com/example/livesaas?key=example2推流完整 URL。
StreamingCodeStringlivesaas?key=example2推流串流秘钥。

ForwardInfo

参数类型示例值描述
PullStreamUrlStringhttps://example-livesaas.com/example/livesaas?key=example拉流直播拉流 URL。

PullStreamStatus

String

1

拉流直播任务状态。支持以下取值:

  • 0:拉流任务初始化中
  • 1:拉流任务运行中
  • 2:拉流任务已结束

PullStreamCheckStatus

String

1

拉流检测状态。支持以下取值:

  • 0:检测中
  • 1:源流未推流
  • 2:正常拉流
  • 3:拉流结束
  • 4:拉流异常

BackupForwardInfo

参数类型示例值描述
PullStreamUrlStringhttps://example2-livesaas.com/example/livesaas?key=example2拉流直播拉流 URL。

PullStreamStatus

String

1

拉流直播任务状态。支持以下取值:

  • 0:拉流任务初始化中
  • 1:拉流任务运行中
  • 2:拉流任务已结束

PullStreamCheckStatus

String

1

拉流检测状态。支持以下取值:

  • 0:检测中
  • 1:源流未推流
  • 2:正常拉流
  • 3:拉流结束
  • 4:拉流异常

请求示例

GET https://livesaas.volcengineapi.com/?Action=GetCustomActMsgAPI&Version=2020-06-01&ActivityId=172183460671&NeedActMsg=1&NeedActBasicMsg=1&NeedActStreamMsg=1&NeedRealTimeOnlineNumber=1

返回示例

{
    "ResponseMetadata": {
        "RequestId": "20230604110420****100232280022D31",
        "Action": "GetCustomActMsgAPI",
        "Version": "2020-06-01",
        "Service": "livesaas",
        "Region": "cn-north-1",
        "SystemTime": 1697446406
    },
    "Result": {
        "ActMsg": {
            "Id": 172183460671,
            "Name": "直播间 A",
            "LiveTime": 1642070520,
            "CoverImage": "https://image1.xxx",
            "Status": 2,
            "ViewUrl": "https://live.xxx.com/xxx",
            "IsLockPreview": 0,
            "OwnerSubAccount": "admin@bytedance.com",
            "LiveReviewStatus": 2,
            "VerticalCoverImage": "https://image2.xxx"
        },
        "ActBasicMsg": {
            "ActivityId": 172183460671,
            "Name": "直播间 A",
            "LiveTime": 1642070520,
            "IsCoverImageEnable": 1,
            "CoverImageUrl": "//gjrfd7ferd-image.image",
            "IsPcBackImageEnable": 1,
            "PcBackImageUrl": "//p-imagex-live18n.test.org/tos-live18n-i-fhdptwgppv.png",
            "IsMobileBackImageEnable": 1,
            "MobileBackImageUrl": "//p-imagex-live18n.test.org/tos-live18n-i-fhdptwgppv.png",
            "IsPreviewVideoEnable": 1,
            "PreviewVideoVid": "491568852",
            "IsPeopleCountEnable": 0,
            "IsHeaderImageEnable": 0,
            "HeaderImageUrl": "//p.test.org/tos-live18n-i-fhdptwgppv.png",
            "IsWatermarkImageEnable": 0,
            "WatermarkImageUrl": "//p-imagex.org/tos-live18n-i-fhdptwgppv.png",
            "IsThumbUpEnable": 1,
            "ThumbUpUrl": "//p-imagex.png",
            "IsShareIconEnable": 1,
            "ShareIconUrl": "//p-imagex-live18n.test.org/tos-live18n-i-fhdptwgppv.pn",
            "IsCommentTranslateEnable": null,
            "Announcement": "直播间信息",
            "BackgroundColor": "77778888",
            "FontColor": "55557777",
            "InteractionColor": "45784444",
            "ColorThemeIndex": "light",
            "IsCountDownEnable": 1,
            "IsAutoStartEnable": 1,
            "IsPCHeaderImageEnable": 1,
            "PCHeaderImageUrl": "//p-imagex-fhdptwgppv.pn",
            "IsPageLimitEnable": 1,
            "PageLimitType": "pc",
            "IsLanguageEnable": 1,
            "PlayerTopType": [
                ""
            ],
            "IsReplayAutoOnlineEnable": 1,
            "SiteTags": [
                {
                    "Name": "分类标签",
                    "Value": "标签1",
                    "Index": 0
                }
            ],
            "TextSiteTags": [
                {
                    "Name": "文本标签",
                    "Value": "标签2",
                    "Index": 0
                }
            ]
        },
        "ActStreamMsg": {
            "LineDetails": [
                {
                    "LineId": 123,
                    "LineName": "线路1",
                    "MainPushInfo": [
                        {
                            "PushPath": "https://example-livesaas.com/example",
                            "PushUrl": "https://example-livesaas.com/example/livesaas?key=example",
                            "StreamingCode": "livesaas?key=example"
                        }
                    ],
                    "BackPushInfo": [
                        {
                            "PushPath": "https://example2-livesaas.com/example2",
                            "PushUrl": "https://example2-livesaas.com/example/livesaas?key=example2",
                            "StreamingCode": "livesaas?key=example2"
                        }
                    ],
                    "ForwardInfo": [
                        {
                            "PullStreamUrl": "https://example-livesaas.com/example/livesaas?key=example",
                            "PullStreamStatus": "1",
                            "PullStreamCheckStatus": "1"
                        }
                    ],
                    "BackupForwardInfo": [
                        {
                            "PullStreamUrl": "https://example2-livesaas.com/example/livesaas?key=example2",
                            "PullStreamStatus": "1",
                            "PullStreamCheckStatus": "1"
                        }
                    ],
                    "ExpireTime": 1643004493
                }
            ]
        },
        "RealTimeOnlineNumber": {
            "RealPopularity": 2000,
            "FakePopularity": 2000
        }
    }
}

错误码

访问公共错误码错误码获取详细信息。