You need to enable JavaScript to run this app.
最新活动
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们
导航

自定义查询直播间信息

最近更新时间2023.08.31 12:08:05

首次发布时间2022.09.15 14:09:46

按需查询直播间信息,包括直播间基础信息、基础配置、流信息及在线人数。

注意事项

请求频率:单用户请求频率限制为 120 次/分钟

请求说明

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

请求参数

以下请求参数列表仅列出了该接口的部分公共参数,完整公共参数列表见公共请求参数

Query

参数类型是否必选示例值描述
ActionStringGetCustomActMsgAPI接口名称。当前 API 的名称为 GetCustomActMsgAPI
VersionString2020-06-01接口版本。当前 API 的版本为 2020-06-01
ActivityIdLong172183460671直播间 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 时间戳,单位为秒。

IsCoverImageEnable

Integer

1

是否开启直播封面。支持以下取值:

  • 0:关闭
  • 1:开启

CoverImageUrl

String

//gjrfd7ferd-image.image

横屏直播的封面图 URL。当 IsCoverImageEnable 取值为 1 时,此处为横屏直播的封面图 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 端背景颜色。
FontColorString55557777字体颜色。
InteractionColorString45784444PC 端互动区颜色。

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:H5 端

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 http://livesaas.volcengineapi.com/?Action=GetCustomActMsgAPI&Version=2020-06-01&ActivityId=172183460671&NeedActBasicMsg=1&NeedActMsg=1&NeedActStreamMsg=1&NeedRealTimeOnlineNumber=1

返回示例

{
		"ResponseMetadata":{
				"RequestId":"202201201826170101501312091D1C09D2",
				"Action":"GetCustomActMsgAPI",
				"Version":"2020-06-01",
				"Service":"livesaas",
				"Region":"cn-north-1",
				"SystemTime":1656067132
		},
		"Result":{
				"ActMsg":{
						"Id":172183460671,
						"Name":"直播间 A",
						"Status":2,
						"ViewUrl":"https://live.xxx.com/xxx",
						"LiveTime":1642070520,
						"IsLockPreview":0,
						"CoverImage":"https://image1.xxx",
						"VerticalCoverImage":"https://image2.xxx",
						"OwnerSubAccount":"admin@bytedance.com",
						"LiveReviewStatus":2
				},
				"ActBasicMsg":{
				    "ActivityId":172183460671,
				    "Name":"直播间 A",
				    "LiveTime":1625129340,
				    "IsCoverImageEnable":1,
				    "CoverImageUrl":"https://image1.xxx",
				    "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":0,
				    "PreviewVideoVid":"",
				    "IsPeopleCountEnable":0,
				    "IsHeaderImageEnable":0,
				    "HeaderImageUrl":"",
				    "IsWatermarkImageEnable":0,
				    "WatermarkImageUrl":"",
				    "IsThumbUpEnable":0,
				    "ThumbUpUrl":"",
				    "IsShareIconEnable":1,
				    "ShareIconUrl":"//p-imagex-live18n.test.org/tos-live18n-i-fhdptwgppv.png",
				    "IsCommentTranslateEnable":0,
				    "Announcement":"",
				    "BackgroundColor":"",
				    "FontColor":"",
				    "InteractionColor":"",
				    "ColorThemeIndex":"",
				    "IsCountDownEnable":0,
				    "IsAutoStartEnable":0,
				    "IsPCHeaderImageEnable":"0",
				    "PCHeaderImageUrl":"",
				    "IsPageLimitEnable":0,
				    "PageLimitType":"",
				    "IsLanguageEnable":1,
				    "PlayerTopType":1,
				    "IsReplayAutoOnlineEnable":1,
				    "SiteTags":	[
				        {"Index":0,"Value":"标签1","Name":"分类标签"}
				        ],
				    "TextSiteTags":	[
				        {"Index":0,"Value":"标签2",	"Name":"文本标签"}
				        ]
				},
				"ActStreamMsg": {
				    "LineDetails":[
				        {
				            "LineId":123,
				            "LineName":"线路1",
				            "MainPushInfo":{
				                "PushPath":"https://example-livesaas.com/example",
				                "StreamingCode":"livesaas?key=example",
				                "PushUrl":"https://example-livesaas.com/example/livesaas?key=example"
			                },
			                "BackPushInfo":{
				                "PushPath":"",
				                "StreamingCode":"",
				                "PushUrl":""
			                },
			                "ForwardInfo":{
			                    "PullStreamUrl":"https://example-livesaas.com/example/livesaas?key=example",
			                    "PullStreamStatus":"1",
			                    "PullStreamCheckStatus":"1"
			                },
			                "BackupForwardInfo":{
			                    "PullStreamUrl":"https://example-livesaas.com/example/livesaas?key=example",
			                    "PullStreamStatus":"1",
			                    "PullStreamCheckStatus":"1"
			                },
			                "ExpireTime":1643004493
				        }
					]
			    },
				"RealTimeOnlineNumber":	{
				    "RealPopularity":2000,
				    "FakePopularity":2000
				}
		}
}

错误码

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