Help Center/ SparkRTC/ API Reference/ Statistical Analysis/ Querying Real-Time Quality Data
Updated on 2026-04-27 GMT+08:00

Querying Real-Time Quality Data

Function

This API is used to query real-time minute-level statistics for metrics within a specified period.

The maximum query time span is one day.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

GET /v1/{project_id}/rtc/realtime/quality

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

app

Yes

String

Application identifier.

room_id

No

String

Room ID.

metric

Yes

String

Data type.

  • JoinSuccessRate: success rate of joining a room

  • JoinSuccess5SecsRate: success rate of joining a room in 5 seconds

  • VideoFreezeRate: video freeze rate

  • AudioFreezeRate: audio freeze rate

sdk_type

Yes

String

SDK type.

  • native: non-web SDK

  • webrtc: web-based SDK

start_time

No

String

Time when the query starts. UTC time in the format of YYYY-MM-DDThh:mm:ssZ, for example, 2020-04-23T06:00:00Z. If this parameter is not specified, data of the last hour is read by default.

end_time

No

String

Time when the query ends. UTC time in the format of YYYY-MM-DDThh:mm:ssZ, for example, 2020-04-23T06:00:00Z. If this parameter is not specified, the current time is used by default.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. This parameter is mandatory when token authentication is used. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Authorization

No

String

Authentication information. This parameter is mandatory when AK/SK-based authentication is used.

X-Sdk-Date

No

String

Time when the request is sent. This parameter is mandatory when AK/SK-based authentication is used.

X-Project-Id

No

String

Project ID, which is the same as that used in the URI. This parameter is mandatory when AK/SK-based authentication is used.

Response Parameters

Status code: 200

Table 4 Response header parameters

Parameter

Type

Description

X-Request-Id

String

Unique ID of the request.

Table 5 Response body parameters

Parameter

Type

Description

quality

Array of TimeDoubleValueData objects

Timestamp and metric list at the corresponding time.

Table 6 TimeDoubleValueData

Parameter

Type

Description

time

String

Sampling time. The format must comply with the ISO 8601 standard (UTC time). The format is YYYY-MM-DDThh:mm:ssZ.

value

Double

Timestamp and metric list at the corresponding time.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

GET /v1/{project_id}/rtc/realtime/quality?app=5fa682b34a974f7ad24d223b

Example Responses

Status code: 200

This status code is returned if the request succeeds.

{
  "quality" : [ {
    "time" : "2020-06-04T07:00:00Z",
    "value" : 0
  } ]
}

Status code: 400

This status code is returned if the request fails.

{
  "error_code" : "DATA.100011001",
  "error_msg" : "Required String parameter 'app' is not present"
}

Status Codes

Status Code

Description

200

This status code is returned if the request succeeds.

400

This status code is returned if the request fails.

Error Codes

See Error Codes.