tencent cloud

Statistics of Concurrent Online Users
Last updated:2025-06-19 15:32:54
Statistics of Concurrent Online Users
Last updated: 2025-06-19 15:32:54
There are two methods for counting concurrent online users. According to different playback protocols, select the suitable statistical method:

Method One: The Playback Protocol Is RTMP or FLV

If the playback protocol is RTMP or FLV, the number of concurrent connections equals the number of online users. You can directly view the number of online users through the console. For specific operations, see Documentation guide. You can also obtain the number of online viewers by calling the DescribeStreamPlayInfoList of Cloud Streaming Services (CSS) API 3.0.

Method Two: The Playback Protocol Is HLS

If the playback protocol is HLS, statistics of the number of concurrent users are inaccurate if relying only on the cloud data due to the non-persistent connection attribute of the protocol. It is necessary for the user-side playback request URL to carry a UUID string, and statistics need to be enabled on the cloud. Below is an introduction to the practical solution for counting concurrent users when the playback protocol is HLS.

User Side

This solution is implemented based on the UUID, which is generated by the customer's application server and is appended as a request parameter to the end of the playback URL address. Each user's UUID is unique.
Playback URL example:
http(s)://${your_domain_name}/${path}/${to}/${stream}/${playlist_name}.m3u8?uuid=c44ada05-3431-442f-9233-cb245d3624c8
or
http(s)://${your_domain_name}/${app_name}/${stream_name}.m3u8?uuid=2c2b59d0-e0c7-4877-9823-e4965d92f7bf

Cloud Support

You can submit a ticket to support statistics of concurrent users for HLS based on UUID.

API Description

API request domain name: live.tencentcloudapi.com.
This API is used to query statistics of concurrent online users for HLS, including the number of accesses, the number of online users, and traffic.

Input Parameters

The following list of request parameters only includes API request parameters and some common request parameters. For the complete list of common request parameters, see Common Request Parameters.
Parameter Name
Required
Type
Description
Action
Yes
String
Common parameter. The value for this API is DescribeHLSConcurrentUserInfo.
Version
Yes
String
Common parameter. The value for this API is 2018-08-01.
Region
No
String
Common parameter. This parameter is not required for this API.
StartTime
Yes
String
UTC start time, in the format of yyyy-mm-ddTHH:MM:SSZ. See ISO Date Format for details.
For example, UTC+8 time 2019-01-08 10:00:00 corresponds to UTC time 2019-01-08T10:00:00+08:00.
Supports queries for the past month.
Example value: 2006-01-02T15:04:05Z.
EndTime
Yes
String
UTC end time, in the format of yyyy-mm-ddTHH:MM:SSZ. See ISO Date Format for details.
For example, UTC+8 time 2019-01-08 10:00:00 corresponds to UTC time 2019-01-08T10:00:00+08:00.
Supports queries for the past month, with a time span between start time and end time not exceeding six hours.
Example value: 2006-01-02T15:04:05Z.
PlayDomains.N
No
Array of String
List of playback domain names. If it is empty, query all domain names by default.
Example value: testplay.com.
StreamNames.N
No
Array of String
List of stream names. If it is empty, check all streams by default.
Queries the stream name in the publish model. Value of the StreamName field (streamid is the stream ID in the publish model):
hls:
Multi-bitrate: streamid_sub-bitrate template name.
Single-bitrate transcoding: streamid_template name.
No transcoding: streamid.
dash:
Single-bitrate transcoding: streamid_template name.
No transcoding: streamid.
Example value: test

Output Parameters

Parameter Name
Type
Description
DataInfoList
Array of HLSConcurrentUserInfo
Statistics of concurrent users for HLS live streaming.
RequestId
String
Unique request ID. It is generated by the server and is returned for each request. (No RequestId is returned if the request is not received by the server due to certain reasons.) RequestId is required for locating an issue.

Example

Input Example

This API shows you how to query statistics of the number of concurrent online users for HLS.
POST / HTTP/1.1
Host: live.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeHLSConcurrentUserInfo
<Common request parameters>

{"StartTime": "2022-10-12T14:00:00+08:00",
"EndTime": "2022-10-12T15:10:00+08:00"}

Output Example

{
"Response": {
"DataInfoList": [
{
"Flux": 2893,
"OnlineNums": 1,
"RequestCount": 11,
"Bandwidth": 123,
"Time": "2022-10-12T14:35:00+08:00"
}
],
"RequestId": "b725570a-c1f1-4df7-b864-5ec3a9326cc0"
}
}

Developer Resources

SDK

TencentCloud API 3.0 provides a supporting software development kit (SDK) that supports multiple programming languages, making it easier to call the API.

Command Line Interface

Error Code

Below are the error codes related to the API business logic. For other error codes, see Common Error Code.
Error Code
Description
FailedOperation
Operation failed.
FailedOperation.NotFound
Unable to find the records.
InternalError
Internal error.
InvalidParameter
Parameter error.
ResourceNotFound.ForbidService
The user is disabled.
ResourceNotFound.FreezeService
The user service is frozen.
ResourceNotFound.StopService
The account is suspended. Please activate the service after topping up the account until the balance is positive and then perform operations.
ResourceNotFound.UserDisableService
The user proactively cancels the account.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback