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
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | DescribeLiveStreamHistoryUserNum | The operation that you want to perform. Set the value to DescribeLiveStreamHistoryUserNum. |
DomainName | String | Yes | example.com | The streaming domain. |
AppName | String | Yes | liveApp**** | The name of the application to which the live stream belongs. |
StreamName | String | Yes | liveStream**** | The name of the live stream. |
StartTime | String | Yes | 2017-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. |
EndTime | String | Yes | 2017-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
Parameter | Type | Example | Description |
RequestId | String | 16A96B9A-F203-4EC5-8E43-CB92E68F5FF8 | The ID of the request. |
LiveStreamUserNumInfos | Array of LiveStreamUserNumInfo | The number of historical online users for the live stream. | |
LiveStreamUserNumInfo | |||
UserNum | String | 1 | The number of users. |
StreamTime | String | 2017-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
HttpCode | Error code | Error message | Description |
400 | InvalidStartTime.Malformed | Specified 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. |
400 | InvalidEndTime.Malformed | Specified 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.