tencent cloud

APIs

DescribeCDNUsageData

Download
Focus Mode
Font Size
Last updated: 2026-09-22 22:25:38

1. API Description

Domain name for API request: vod.intl.tencentcloudapi.com.

This API is used to query VOD CDN traffic, bandwidth, and other stats.

  1. CDN usage data is retained on the system side for 13 months. You can only query usage data from the most recent 365 days through the API. To retrieve historical usage data beyond 365 days, contact us.
    1. The query time span should not exceed 90 days.
  2. You can specify the time granularity of usage data, supporting 5-minute, 1-hour, and 1-day granularities.
  3. Traffic is the total traffic within the query time granularity, and bandwidth is the peak bandwidth within the query time granularity.
  4. Playback statistics only target VOD domains, excluding EdgeOne domain distribution.

A maximum of 100 requests can be initiated per second for this API.

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 Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeCDNUsageData.
Version Yes String Common Params. The value used for this API: 2018-07-17.
Region No String Common Params. This parameter is not required.
StartTime Yes String Start date. Use the ISO date format.
EndTime Yes String End date, which should be greater than the start date. Use the ISO date format.
DataType Yes String CDN statistics data type. Valid values:
  • Flux: Traffic, unit: byte.
  • Bandwidth: bandwidth, in bps.
  • SubAppId No Integer VOD application ID. For customers who activate VOD from December 25, 2023, this field must be set to the app ID when accessing resources in VOD applications, whether it is the default application or a newly created application.
    DataInterval No Integer Time granularity of usage data. Measurement unit: minute. Valid values:
  • 5: 5 minutes. Return detailed data at a 5-minute granularity within the specified query time.
  • 60: 1-hour granularity, returns data at 1-hour granularity within the specified query time.
  • 1440: day granularity, returns the data of 1-day granularity within the specified query time.

  • Default value: 1440. The data of day granularity is returned.
    DomainNames.N No Array of String Domain name list. Up to 20 domain names can be queried for usage data at a time. Multiple domain names can be specified to query the combined usage data of these domain names. By default, the combined usage data of all domain names is returned.

    3. Output Parameters

    Parameter Name Type Description
    DataInterval Integer Time granularity. Unit: minute.
    Data Array of StatDataItem CDN stats.
    RequestId String The 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 Query the 5-minute granularity bandwidth data of example1.com and example2.com from 2018-12-01 to 2018-12-07.

    Input Example

    https://vod.intl.tencentcloudapi.com/?Action=DescribeCDNUsageData
    &DomainNames.0=example1.com
    &DomainNames.1=example2.com
    &StartTime=2018-12-01T00:00:00+08:00
    &EndTime=2018-12-03T00:00:00+08:00
    &DataType=Bandwidth
    &DataInterval=5
    &<Common request parameters>

    Output Example

    {
        "Response": {
            "DataInterval": 5,
            "Data": [
                {
                    "Time": "2018-12-01T00:00:00+08:00",
                    "Value": 100000
                },
                {
                    "Time": "2018-12-01T05:00:00+08:00",
                    "Value": 200000
                },
                {
                    "Time": "2018-12-01T10:00:00+08:00",
                    "Value": 350000
                }
            ],
            "RequestId": "requestId"
        }
    }

    Example2 Query VOD CDN traffic data

    Query CDN traffic data from December 1, 2018 (inclusive) to December 3, 2018 (inclusive).

    Input Example

    https://vod.intl.tencentcloudapi.com/?Action=DescribeCDNUsageData
    &StartTime=2018-12-01T00:00:00+08:00
    &EndTime=2018-12-03T00:00:00+08:00
    &DataType=Flux
    &<Common request parameters>

    Output Example

    {
        "Response": {
            "DataInterval": 1440,
            "Data": [
                {
                    "Time": "2018-12-01T00:00:00+08:00",
                    "Value": 1000000
                },
                {
                    "Time": "2018-12-02T00:00:00+08:00",
                    "Value": 1500000
                },
                {
                    "Time": "2018-12-03T00:00:00+08:00",
                    "Value": 1500000
                }
            ],
            "RequestId": "requestId"
        }
    }

    Example3 Query all bandwidth statistics of all domain names from 2018-12-01 to 2018-12-07 as an admin

    Input Example

    https://vod.intl.tencentcloudapi.com/?Action=DescribeCDNUsageData
    &StartTime=2018-12-01T00:00:00+08:00
    &EndTime=2018-12-03T00:00:00+08:00
    &DataType=Bandwidth
    &SubAppId=1
    &<Common request parameters>

    Output Example

    {
        "Response": {
            "DataInterval": 1440,
            "Data": [
                {
                    "Time": "2018-12-01T00:00:00+08:00",
                    "Value": 700000
                },
                {
                    "Time": "2018-12-01T05:00:00+08:00",
                    "Value": 800000
                },
                {
                    "Time": "2018-12-01T10:00:00+08:00",
                    "Value": 920000
                }
            ],
            "RequestId": "requestId"
        }
    }

    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 Code Description
    FailedOperation Operation failed.
    FailedOperation.InvalidVodUser The VOD service is not enabled.
    FailedOperation.NetWorkError Network error.
    InternalError Internal error.
    InvalidParameterValue Parameter value error.
    InvalidParameterValue.DataInterval Parameter value error. Time granularity.
    InvalidParameterValue.DataType Parameter value error. Data type.
    InvalidParameterValue.DomainName Parameter error: non-existent domain name.
    InvalidParameterValue.DomainNames Parameter value error: The domain name list is too large.
    InvalidParameterValue.EndTime Invalid parameter value: EndTime is invalid.
    InvalidParameterValue.StartTime Invalid parameter value: StartTime is invalid.
    UnauthorizedOperation Unauthorized operation.

    Help and Support

    Was this page helpful?

    Help us improve! Rate your documentation experience in 5 mins.

    Feedback