EdgeOne Logo
Documentation
请选择
请选择
Overview
Menu

DescribeBillingData

1. API Description

Domain name for API request: teo.tencentcloudapi.com.

This API is used to query billing data.

A maximum of 50 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 NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: DescribeBillingData.
VersionYesStringCommon Params. The value used for this API: 2022-09-01.
RegionNoStringCommon Params. This parameter is not required.
StartTimeYesTimestamp ISO8601Start time of the query.
EndTimeYesTimestamp ISO8601End time of the query.
ZoneIds.NYesArray of StringZone ID set. This parameter is required.
MetricNameYesStringIndicator list. Valid values:
  • acc_flux: Content acceleration traffic, in bytes;
  • smt_flux: Smart acceleration traffic, in bytes;
  • l4_flux: Layer 4 acceleration traffic, in bytes;
  • sec_flux: Exclusive DDoS mitigation traffic, in bytes;
  • zxctg_flux: Cross-MLC-border acceleration traffic, in bytes;
  • acc_bandwidth: Content acceleration bandwidth, in bps;
  • smt_bandwidth: Smart acceleration bandwidth, in bps;
  • l4_bandwidth: Layer 4 acceleration bandwidth, in bps;
  • sec_bandwidth: Exclusive DDoS mitigation bandwidth, in bps;
  • zxctg_bandwidth: Cross-MLC-border acceleration bandwidth, in bps;
  • sec_request_clean: HTTP/HTTPS requests, in count;
  • smt_request_clean: Smart acceleration requests, in count;
  • quic_request: QUIC requests, in count;
  • bot_request_clean: Bot requests, in count;
  • cls_count: Real-time log delivery log counts, in count;
  • ddos_bandwidth: Exclusive DDoS mitigation elastic bandwidth, in bps.
  • IntervalYesStringQuery granularity. Valid values:
  • 5min: 5-minute granularity;
  • hour: 1-hour granularity;
  • day: 1-day granularity.
  • Filters.NNoArray of BillingDataFilterFilter. The detailed filters are as follows:
  • host: Filter by Domain Name. Example: test.example.com.
  • proxy-id: Filter by Layer 4 Proxy Instance ID. Example: sid-2rugn89bkla9.
  • region-id: Filter by Billing Region.Options are:
    CH: Chinese mainland
    AF: Africa
    AS1: Asia-Pacific Region 1
    AS2: Asia-Pacific Region 2
    AS3: Asia-Pacific Region 3
    EU: Europe
    MidEast: Middle East
    NA: North America
    SA: South America
  • 3. Output Parameters

    Parameter NameTypeDescription
    DataArray of BillingData
    Note: This field may return null, indicating that no valid values can be obtained.
    RequestIdStringThe 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 Querying content acceleration traffic in the specified zone and billing region

    This example shows you how to query the billing volume of content acceleration traffic with a specific zone ID and region ID on a daily granularity.

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeBillingData
    <Common Request Parameters>
    
    {
        "StartTime": "2024-01-01T00:00:00+08:00",
        "EndTime": "2024-01-24T03:20:00+08:00",
        "Interval": "day",
        "MetricName": "acc_flux",
        "Filters": [
            {
                "Type": "region-id",
                "Value": "MidEast"
            }
        ],
        "ZoneIds": [
            "zone-2smdfso9dr58"
        ]
    }
    

    Output Example

    {
        "Response": {
            "RequestId": "457e8933-4296-4878-9a7f-fb888559e29e",
            "Data": [
                {
                    "Time": "2023-12-31T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-01T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-02T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-03T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-04T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-05T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-06T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-07T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-08T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-09T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-10T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-11T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-12T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-13T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-14T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-15T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-16T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-17T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-18T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-19T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-20T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-21T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-22T16:00:00Z",
                    "Value": 0
                },
                {
                    "Time": "2024-01-23T16:00:00Z",
                    "Value": 0
                }
            ]
        }
    }
    

    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 CodeDescription
    InternalError.ProxyServerAn unknown error occurred in the backend server.
    InvalidParameter.InvalidIntervalInvalid interval. The value should be either [min 5min hour day].
    InvalidParameter.InvalidMetricThe query dimension is invalid.
    InvalidParameter.ZoneHasNotBeenBoundToPlanThe zone is not bound to a package.