logo
On this page

Get Real-time Usage


Description

This interface can be used to get the real-time push and pull stream concurrency, room concurrency, online user count, maximum room user count, and mixed stream concurrency within the specified time period in the last 2 hours. The data granularity is minutes.

Request method and endpoint

  • Request method: GET
  • Request URL: https://analytics-api.zego.im/?Action=GetRealtimeUsage
  • Transfer protocol: HTTPS
  • QPS limit (same AppID): 3 times/minute, 480 times/day
  • Data delay: 3 minutes

Request parameters

The following request parameter list only lists the interface request parameters and some common parameters. Please refer to Accessing Server APIs - Public Request Parameters for the complete common parameter list.

ParameterTypeRequiredDescription
Metrics[]Array of StringYesThe metrics to be queried:
  • publish_concurrent: Push stream concurrency.
  • play_concurrent: Pull stream concurrency.
  • room_concurrent: Room concurrency.
  • online_user: Online user count.
  • max_room_user: Maximum room user count.
  • mix_concurrent: Mixed stream concurrency.
StartTsNumberYesStart time, UTC timestamp in milliseconds.
EndTsNumberYesEnd time, UTC timestamp in milliseconds. If the push stream is not ended, it can be represented as 0 or the current timestamp to indicate in progress.

Request Example

https://analytics-api.zego.im/?Action=GetRealtimeUsage
&Metrics[]=publish_concurrent
&Metrics[]=online_user
&StartTs=1672565260000
&EndTs=1672565320000
&<Public Request Parameters>

Response Parameters

ParameterTypeDescription
CodeNumberReturn code.
MessageStringOperation result description.
RequestIdStringRequest ID.
DataArrayResponse data.
└MetricsArray of ObjectMetric list.
  └MetricStringMetric name.
  └ValuesArray of ObjectMetric value list.
    └TimestampNumberUTC timestamp in milliseconds.
    └ValueNumberMetric value.

Response Example

{
  "Code": 0,
  "Message": "success",
  "Data": {
    "Metrics": [
      {
        "Metric": "publish_concurrent",
        "Values": [
          {
            "Timestamp": 1660634260000,
            "Value": 1000
          },
          {
            "Timestamp": 1660634320000,
            "Value": 1100
          }
        ]
      },
      {
        "Metric": "online_user",
        "Values": [
          {
            "Timestamp": 1660634260000,
            "Value": 99999
          },
          {
            "Timestamp": 1660634320000,
            "Value": 99988
          }
        ]
      }
    ]
  },
  "RequestId": 1660645050860325000
}

Return Code

Return CodeDescriptionAction
0Success.-
500Interface error.Contact ZEGOCLOUD Technical Support.
10001Parameter format error.Check parameters.
10002Parameter error or parameter invalid.Check parameters.
30002Interface request frequency exceeds the limit.Please confirm the QPS limit of the corresponding interface and reduce the request frequency.

Previous

Query Regional Quality Real-time Data

Next

Get Real-time Quality

On this page

Back to top