Queries the number of historical online users for a live stream.

Usage notes

  • The data returned after you call this operation is delayed for an average of 2 to 5 minutes.
  • This operation only queries the number of historical online users for Flash Video (FLV) and Real-Time Messaging Protocol (RTMP) streams.
  • This operation does not query the number of viewers that are watching transcoded streams.

QPS limit

You can call this operation up to 30 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limit on an API operation in ApsaraVideo Live.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesDescribeLiveStreamHistoryUserNum

The operation that you want to perform. Set the value to DescribeLiveStreamHistoryUserNum.

DomainNameStringYesexample.com

The streaming domain.

AppNameStringYesliveApp****

The name of the application to which the live stream belongs.

StreamNameStringYesliveStream****

The name of the live stream.

StartTimeStringYes2017-12-21T08:00:00Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note You can query data over the last 30 days.
EndTimeStringYes2017-12-22T08:00:00Z

The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

Note The time range specified by the StartTime and EndTime parameters cannot exceed one day. The time specified by the EndTime parameter must be earlier than the current time.

Response parameters

ParameterTypeExampleDescription
RequestIdString16A96B9A-F203-4EC5-8E43-CB92E68F5FF8

The ID of the request.

LiveStreamUserNumInfosArray of LiveStreamUserNumInfo

The number of historical online users for the live stream.

LiveStreamUserNumInfo
UserNumString1

The number of users.

StreamTimeString2017-10-20T06:20:00Z

The time when the stream occurred. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=DescribeLiveStreamHistoryUserNum
&AppName=liveApp****
&DomainName=example.com
&EndTime=2017-12-22T08:00:00Z
&StartTime=2017-12-21T08:00:00Z
&StreamName=liveStream****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<DescribeLiveStreamHistoryUserNumResponse>
<LiveStreamUserNumInfos>
    <LiveStreamUserNumInfo>
        <StreamTime>2017-10-20T06:20:00Z</StreamTime>
        <UserNum>1</UserNum>
    </LiveStreamUserNumInfo>
</LiveStreamUserNumInfos>
<RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F5FF8</RequestId>
</DescribeLiveStreamHistoryUserNumResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "DescribeLiveStreamHistoryUserNumResponse" : {
    "LiveStreamUserNumInfos" : {
      "LiveStreamUserNumInfo" : {
        "StreamTime" : "2017-10-20T06:20:00Z",
        "UserNum" : 1
      }
    },
    "RequestId" : "16A96B9A-F203-4EC5-8E43-CB92E68F5FF8"
  }
}

Error codes

HttpCodeError codeError messageDescription
400InvalidStartTime.MalformedSpecified StartTime is malformed.The error message returned because the format of the start time is invalid. Check whether the value of the StartTime parameter is valid.
400InvalidEndTime.MalformedSpecified EndTime is malformed.The error message returned because the format of the end time is invalid. Check whether the value of the EndTime parameter is valid.

For a list of error codes, visit the Service error codes.