logo
On this page

Get Business Usage


Description

This interface can be used to query the real-time audio-video data statistics within a specified time period, including room concurrency peak, user concurrency, push and pull stream concurrency, and push and pull stream cumulative total.

Note
The query time period is consistent with the Data Storage and Query effective period in the package you purchased. For details, please refer to Pricing - Package Function.

Request method and endpoint

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

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
StartDateStringYesThe start date of the query, the format must be a string format of yyyyMMdd.
Note
When used with EndDate, the date range formed by the two does not exceed the Data Storage and Query effective period in the package you purchased. For details, please refer to Pricing - Package Function.
EndDateStringYesThe end date of the query, the format must be a string format of yyyyMMdd.
Metrics[]Array of StringYesThe metrics to be queried, supported strings:
  • room_concurrent: Room concurrency.
  • user_concurrent: Room user concurrency.
  • publish_concurrent: Push stream concurrency.
  • play_concurrent: Pull stream concurrency.
  • publish_count: Push stream cumulative.
  • play_count: Pull stream cumulative.

Request Example

https://analytics-api.zego.im/?Action=GetBizUsage
&StartDate=20250110
&EndDate=20250112
&Metrics[]=publish_count
&Metrics[]=play_count
&<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.
    └DateStringDate, format as "yyyyMMdd".
    └ValueNumberMetric value.

Response Example

{
    "Code": 0,
    "Data": {
        "Metrics": [
            {
                "Metric": "publish_count",
                "Values": [
                    {
                        "Date": "20250110",
                        "Value": 100
                    },
                    {
                        "Date": "20250111",
                        "Value": 30
                    },
                    {
                        "Date": "20250112",
                        "Value": 40
                    }
                ]
            },
            {
                "Metric": "play_count",
                "Values": [
                    {
                        "Date": "20250110",
                        "Value": 60
                    },
                    {
                        "Date": "20250111",
                        "Value": 20
                    },
                    {
                        "Date": "20250112",
                        "Value": 10
                    }
                ]
            }
        ]
    },
    "Message": "success",
    "RequestId": 1659512998878671000
}

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

Get Real-time Quality

Next

Get Business Quality

On this page

Back to top