tencent cloud

云点播

DescribeCDNUsageData

Download
聚焦模式
字号
最后更新时间: 2026-05-19 15:02:54

1. API Description

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

This API is used to query traffic, bandwidth and stats of video-on-demand (VOD) CDN.

  1. The system side reserves CDN usage data for 13 months. You can query the most recent 365 days of usage data through the API. If needed, contact us to call historical usage data exceeding 365 days.
    1. The query time span should not exceed 90 days.
  2. You can specify the time granularity of usage data, which supports 5 minutes, 1 hour, and 1 day.
  3. Traffic volume 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 (EdgeOne domain name distribution is not included).

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 must be greater than the start date. Use the ISO date format.
DataType Yes String CDN statistics data type. Valid value:
  • Flux: Traffic volume, unit: byte.
  • Bandwidth: bandwidth, in bps.
  • SubAppId No Integer On-demand application ID. Customers who activate on-demand services from December 25, 2023 must fill this field with the app ID when accessing resources in on-demand applications (whether default or newly created).
    DataInterval No Integer Time granularity of usage data, unit: minute. Valid values:
  • 5: 5 minutes, return detailed data at a minute granularity for the specified query time.
  • 60: Hourly granularity. Returns the data of 1-hour granularity within the specified query time.
  • 1440: Day granularity. Returns data with day granularity within the specified query time.

  • The default value is 1440, which returns data with day granularity.
    DomainNames.N No Array of String Domain name list. Up to 20 domain names can be queried for usage data. Multiple values can be specified to query the superimposed usage data of these domains. Default returns the overlaid usage data of all domains.

    3. Output Parameters

    Parameter Name Type Description
    DataInterval Integer Time granularity, unit: minute.
    Data Array of StatDataItem CDN statistics.
    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 domain names example1.com and example2.com for 5-minute granularity bandwidth statistics 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 Querying traffic data for VOD CDN

    Query the 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 Admin query all domain name bandwidth statistics from 2018-12-01 to 2018-12-07

    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 activated.
    FailedOperation.NetWorkError Network error.
    InternalError Internal error.
    InvalidParameterValue Parameter value error.
    InvalidParameterValue.DataInterval Incorrect parameter value: time granularity.
    InvalidParameterValue.DataType Incorrect parameter value: data type.
    InvalidParameterValue.DomainName Invalid parameter: the domain name does not exist.
    InvalidParameterValue.DomainNames Parameter value. The domain name list is too large.
    InvalidParameterValue.EndTime Incorrect parameter value: invalid EndTime.
    InvalidParameterValue.StartTime Incorrect parameter value: invalid StartTime.
    UnauthorizedOperation Unauthorized operation.

    帮助和支持

    本页内容是否解决了您的问题?

    填写满意度调查问卷,共创更好文档体验。

    文档反馈