tencent cloud

文档反馈

DescribeBillingData

最后更新时间:2024-10-11 15:52:46

    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 Name Required Type Description
    Action Yes String Common Params. The value used for this API: DescribeBillingData.
    Version Yes String Common Params. The value used for this API: 2022-09-01.
    Region No String Common Params. This parameter is not required.
    StartTime Yes Timestamp ISO8601 Start time.
    EndTime Yes Timestamp ISO8601 End time.
    ZoneIds.N Yes Array of String Site ID set. This parameter is required.
    MetricName Yes String Metric list. Valid values:
  • acc_flux: content acceleration traffic, in bytes;
  • smt_flux: smart acceleration traffic, in bytes;
  • l4_flux: L4 acceleration traffic, in bytes;
  • sec_flux: exclusive protection traffic, in bytes;
  • zxctg_flux: network optimization traffic in the Chinese mainland, in bytes;
  • acc_bandwidth: content acceleration bandwidth, in bps;
  • smt_bandwidth: smart acceleration bandwidth, in bps;
  • l4_bandwidth: L4 acceleration bandwidth, in bps;
  • sec_bandwidth: exclusive protection bandwidth, in bps;
  • zxctg_bandwidth: network optimization bandwidth in the Chinese mainland, in bps;
  • sec_request_clean: number of HTTP/HTTPS requests;
  • smt_request_clean: number of smart acceleration requests;
  • quic_request: number of QUIC requests;
  • bot_request_clean: number of Bot requests;
  • cls_count: number of real-time log entries pushed;
  • ddos_bandwidth: elastic DDoS protection bandwidth, in bps.
  • Interval Yes String Time granularity of the query. Valid values:
  • 5min: 5 minutes;
  • hour: 1 hour;
  • day: 1 day.
  • Filters.N No Array of BillingDataFilter Filter criteria. The detailed values of filter criteria are as follows:
  • host: Filter by domain name, such as test.example.com.
  • proxy-id: Filter by L4 proxy instance ID, such as sid-2rugn89bkla9.
  • region-id: Filter by billing region. Options:
    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 Name Type Description
    Data Array of BillingData Data point list.
    Note: This field may return null, which indicates a failure to obtain a valid value.
    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 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 Code Description
    InternalError.ProxyServer An unknown error occurred in the backend server.
    InvalidParameter.InvalidInterval Invalid interval. The value should be either [min 5min hour day].
    InvalidParameter.InvalidMetric The query dimension is invalid.
    InvalidParameter.ZoneHasNotBeenBoundToPlan The zone is not bound to a package.
    联系我们

    联系我们,为您的业务提供专属服务。

    技术支持

    如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

    7x24 电话支持