> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/zga/analysis/describetraffic.md). Agents can also search and read this documentation through its [MCP server](https://docs.console.zenlayer.com/api-reference/~gitbook/mcp).

# DescribeTraffic

## 1. API Description

This API (DescribeTraffic) is used to query ZGA Traffic.

{% hint style="info" %}
**Notes**

* The bandwidth return value time granularity is 300s.
* Bandwidth and traffic data are obtained through acceleration log aggregation. Due to log collection delays, current bandwidth values may show 0 or be inaccurate. Generally, data before 15 minutes ago has no integrity issues. You can set endTime=(current time - 15 minutes) and query backwards in 5-minute multiples (see input parameter description). Due to possible data collection delays, each data point has a chance to be corrected within 24 hours. If you require 100% data integrity, you can call again after 24 hours for data coverage.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API Input Parameters.

| Parameter Name     | Required | Type                                                                                                  | Description                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------ | -------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| startTime          | Yes      | [Timestamp](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/datatype.md) | <p>Query start time.</p><p>Uses the <code>ISO8601</code> standard and UTC time. Format: <code>YYYY-MM-ddTHH:mm:ssZ</code>.</p><p>mm must be a multiple of 5, such as: 0/5/10/15/20/25/30/35/40/45/55. Example: 2025-06-11T00:05:00Z</p><p>Note:</p><ul><li>Start time must be less than end time</li><li>Returned time granularity: 300s.</li><li>Time range: \[startTime, endTime).</li></ul> |
| endTime            | Yes      | [Timestamp](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/datatype.md) | <p>Query end time.</p><p>Uses the <code>ISO8601</code> standard and UTC time. Format: <code>YYYY-MM-ddTHH:mm:ssZ</code>.</p><p>mm must be a multiple of 5, such as: 0/5/10/15/20/25/30/35/40/45/55. Example: 2025-06-11T00:25:00Z</p><p>Note:</p><ul><li>Start time must be less than end time</li><li>Returned time granularity: 300s.</li><li>Time range: \[startTime, endTime).</li></ul>   |
| acceleratorIds     | Optional | Array of String                                                                                       | <p>Accelerator ID.</p><p>\* Query aggregated Traffic data for multiple Accelerators.</p><p>\* By default, query aggregated customer Traffic data.</p>                                                                                                                                                                                                                                          |
| originRegionId     | Optional | String                                                                                                | <p><a href="https://docs.console.zenlayer.com/api-reference/zga/datastructure.md#region">Origin Region Id</a></p><p>When configured together with accelerateRegionId, query aggregated Traffic data for the route.</p>                                                                                                                                                                         |
| accelerateRegionId | Optional | String                                                                                                | <p><a href="https://docs.console.zenlayer.com/api-reference/zga/datastructure.md#region">Acceleration Region Id</a></p><p>When configured together with originRegionId, query aggregated Traffic data for the route.</p>                                                                                                                                                                       |
| resourceGroupId    | Optional | String                                                                                                | <p>The ID of the Resource Group.</p><p>Query aggregated Traffic data for the Resource Group.</p>                                                                                                                                                                                                                                                                                               |

## 3. Output Parameters

| Parameter Name | Type                                                                                                                           | Description                                                                                                           |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String                                                                                                                         | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| dataList       | Array of [AcceleratorTrafficData](https://docs.console.zenlayer.com/api-reference/zga/datastructure.md#acceleratortrafficdata) | Bandwidth data list                                                                                                   |
| inMax          | Integer                                                                                                                        | Maximum inbound bandwidth                                                                                             |
| inMin          | Integer                                                                                                                        | Minimum inbound bandwidth                                                                                             |
| inTotal        | Integer                                                                                                                        | Total inbound bandwidth traffic                                                                                       |
| outMax         | Integer                                                                                                                        | Maximum outbound bandwidth                                                                                            |
| outMin         | Integer                                                                                                                        | Minimum outbound bandwidth                                                                                            |
| outTotal       | Integer                                                                                                                        | Total outbound bandwidth traffic                                                                                      |
| unit           | String                                                                                                                         | Bandwidth value unit. For example: bps                                                                                |
| totalUnit      | String                                                                                                                         | Traffic value unit. For example: B                                                                                    |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}

1. **Query ZGA Traffic.**

```json
POST / HTTP/1.1
Host: console.zenlayer.com/api/v2/zga
Content-Type: application/json
X-TC-Action: DescribeTraffic
<Common Request Params>

Request:
{
  "startTime": "2025-11-19T07:00:00Z", 
  "endTime": "2025-11-19T07:20:00Z"
}
Response:
{
    "requestId": "TB3288525-E0E7-400F-9053-34BAB27E5CCF",
    "response": {
        "requestId": "TB3288525-E0E7-400F-9053-34BAB27E5CCF",
        "dataList": [
            {
                "internetRX": 2054,
                "internetTX": 13579,
                "time": "2025-11-19T07:00:00Z"
            },
            {
                "internetRX": 3452,
                "internetTX": 22814,
                "time": "2025-11-19T07:05:00Z"
            },
            {
                "internetRX": 82,
                "internetTX": 543,
                "time": "2025-11-19T07:10:00Z"
            }
        ],
        "inMax": 3452,
        "inMin": 82,
        "inTotal": 5588,
        "outMax": 22814,
        "outMin": 543,
        "outTotal": 36936,
        "unit": "bps",
        "totalUnit": "B"
    }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode.md).
