Join Tencent RTC at NAB Show 2024 in Las Vegas!
Learn more 
Only  $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Only $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Grab It Now 
Join Tencent RTC at NAB Show 2024 in Las Vegas!
Learn more 
Only  $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Only $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Grab It Now 
Features & Server APIs
  • On-Cloud Recording
  • Relay to CDN
  • RTMP Streaming with TRTC
  • Event Callbacks
    • Event Callbacks
    • Relay to CDN Callback
    • Verify Signature Example
  • Sending and Receiving Messages
  • Access Management
    • Overview
    • Manageable Resources and Actions
    • Preset Policies
    • Custom Policies
  • Enabling Advanced Permission Control
  • How to push stream to TRTC room with OBS WHIP
  • Server APIs
    • API Category
    • History
    • Making API Request
      • Request Structure
      • Common Params
      • Signature v3
      • Signature
      • Responses
    • Room Management APIs
      • SetUserBlockedByStrRoomId
      • SetUserBlocked
      • RemoveUser
      • DismissRoom
      • RemoveUserByStrRoomId
      • DismissRoomByStrRoomId
    • Call Quality Monitoring APIs
      • DescribeRoomInfo
      • DescribeUserEvent
      • DescribeCallDetailInfo
      • DescribeUserInfo
      • DescribeScaleInfo
    • Pull Stream Relay Related Interface
      • StartStreamIngest
      • StopStreamIngest
      • DescribeStreamIngest
    • On-cloud Recording APIs
      • CreateCloudRecording
      • DescribeCloudRecording
      • ModifyCloudRecording
      • DeleteCloudRecording
    • Stream Mixing and Relay APIs
      • UpdatePublishCdnStream
      • StartPublishCdnStream
      • StopPublishCdnStream
    • Usage Statistics APIs
      • DescribeTrtcUsage
      • DescribeRecordingUsage
      • DescribeMixTranscodingUsage
      • DescribeRelayUsage
      • DescribeTrtcRoomUsage
    • Data Types
    • Error Codes
    • Appendix
      • Event ID Mapping Table
Features & Server APIs

DescribeTrtcRoomUsage

1. API Description

Domain name for API request: trtc.tencentcloudapi.com.

This API is used to query usage data grouped by room.

  • The queried period cannot exceed 24 hours. If the period spans two different days, the data returned may not be accurate due to a delay in data collection. You can make multiple calls to query the usage on different days.
  • You can use this API to query your historical usage or to reconcile data, but we do not recommend you use it for crucial business logic.
  • The rate limit of this API is one call every 15 seconds.
We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: DescribeTrtcRoomUsage.
VersionYesStringCommon Params. The value used for this API: 2019-07-22.
RegionYesStringCommon Params. For more information, please see the list of regions supported by the product. This API only supports: ap-guangzhou, ap-singapore.
SdkAppidYesIntegerThe SDKAppID of the room.
StartTimeYesStringThe start time in the format of YYYY-MM-DD HH:MM (accurate to the minute).
EndTimeYesStringThe end time in the format of YYYY-MM-DD HH:MM. The start and end time cannot be more than 24 hours apart.

3. Output Parameters

Parameter NameTypeDescription
DataStringThe usage data grouped by room, in CSV format.
RequestIdStringThe unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Querying usage data grouped by room

This example shows you how to query usage data grouped by room.

Input Example

POST / HTTP/1.1
Host: trtc.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeTrtcRoomUsage
<Common request parameters>

{
    "StartTime": "2023-01-06 00:00",
    "EndTime": "2023-01-06 10:00",
    "SdkAppid": 1400017192
}

Output Example

{
    "Response": {
        "RequestId": "68fccf1c-c2c7-466a-9f14-1db4bed6054b",
        "Data": "RoomId,Audio,SD,hd,FullHD,2K,4K
test_room,1,2,3,4,5,6
"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error CodeDescription
FailedOperation.SdkAppIdNotExistThe application ID does not exist.
InternalError.DBErrorAn error occurred while querying the database.
InvalidParameterParameter error.