tencent cloud

Feedback

DescribeCostExplorerSummary

Last updated: 2024-05-16 15:10:23

1. API Description

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

This API is used to view cost analysis details.

A maximum of 20 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: DescribeCostExplorerSummary.
Version Yes String Common Params. The value used for this API: 2018-07-09.
Region No String Common Params. This parameter is not required.
BeginTime Yes String The start time of the period in the format of yyyy-mm-dd hh:ii:ss.
EndTime Yes String The end time of the period in the format of yyyy-mm-dd hh:ii:ss.
BillType Yes String Bill type: 1-cost bill, 2-consumption bill
PeriodType Yes String Statistical period: day-day, month-month;
Dimensions Yes String Classification dimension (data aggregation dimension). Query classification dimension. (Use classification dimension code input parameter.) Input parameter enumeration value:default = Total only
feeType = Fee typebillType = Bill typebusiness = Product
product = Sub-productregion=Region
zone = Availability zoneactionType = Transaction typepayMode = Billing modetags = Tagproject = ProjectpayerUin = Payer accountownerUin = User account
FeeType Yes String Fee type: cost-total cost, totalCost-original price cost
PageSize Yes Integer Quantity. The maximum value per page is 100.
PageNo Yes Integer Starting page, where PageNo=1 indicates the first page, PageNo=2 indicates the second page, and so on.
TagKeyStr No String Cost allocation tag value
NeedConditionValue No String Whether the filter box is needed: 1- indicates it is needed, 0- indicates it is not needed. If it is not specified, it is not required by default.
Conditions No AnalyseConditions Filter parameters

3. Output Parameters

Parameter Name Type Description
Total Integer Number of data entries
Note: This field may return null, indicating that no valid values can be obtained.
Header AnalyseHeaderDetail Header informationNote: This field may return null, indicating that no valid values can be obtained.
Detail Array of AnalyseDetail Data detailsNote: This field may return null, indicating that no valid values can be obtained.
TotalDetail AnalyseDetail Data amountNote: This field may return null, indicating that no valid values can be obtained.
ConditionValue AnalyseConditionDetail Filter boxNote: This field may return null, indicating that no valid values can be obtained.
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 Monthly query cost analysis APIs

Input Example

POST / HTTP/1.1
Host: billing.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeCostExplorerSummary
<Common request parameters>{
    "Dimensions": "business",
    "PeriodType": "month",
    "FeeType": "cost",
    "BillType": "1",
    "BeginTime": "2023-12-31 00:00:00",
    "EndTime": "2024-01-07 23:00:00",
    "PageSize": 100,
    "PageNo": 1
}

Output Example

{
    "Response": {
        "Total": 21,
        "Header": {
            "Name": "Product",
            "Total": "Total",
            "HeadDetail": [
                {
                    "Name": "2023-12-01 00:00:00"
                },
                {
                    "Name": "2023-12-02 00:00:00"
                }
            ]
        },
        "ConditionValue": {},
        "Detail": [
            {
                "Name": "Cloud Virtual Machine CVM",
                "Total": "211.52000096",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "211.52000048"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "0.00000048"
                    }
                ]
            },
            {
                "Name": "Elastic MapReduce",
                "Total": "169.55291616",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "84.77645808"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "84.77645808"
                    }
                ]
            },
            {
                "Name": "T-Sec-Cloud Workload Protection (CWP)",
                "Total": "104.40081600",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "52.20040800"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "52.20040800"
                    }
                ]
            },
            {
                "Name": "Billing test product",
                "Total": "100.00000000",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "100.00000000"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "0"
                    }
                ]
            },
            {
                "Name": "TencentDB for MySQL",
                "Total": "38.77000000",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "0.00000000"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "38.77000000"
                    }
                ]
            },
            {
                "Name": "Face recognition",
                "Total": "36.00000000",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "0"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "36.00000000"
                    }
                ]
            },
            {
                "Name": "Tencent Kubernetes Engine (TKE)",
                "Total": "19.00184160",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "9.50092080"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "9.50092080"
                    }
                ]
            },
            {
                "Name": "NAT gateway",
                "Total": "16.28275200",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "8.14137600"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "8.14137600"
                    }
                ]
            },
            {
                "Name": "BM EIP",
                "Total": "9.60076800",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "4.80038400"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "4.80038400"
                    }
                ]
            },
            {
                "Name": "Saving plan",
                "Total": "7.20000000",
                "TimeDetail": [
                    {
                        "Time": "2023-12-01 00:00:00",
                        "Money": "3.60000000"
                    },
                    {
                        "Time": "2023-12-02 00:00:00",
                        "Money": "3.60000000"
                    }
                ]
            }
        ],
        "TotalDetail": {
            "Name": "Total",
            "Total": "724.5825514",
            "TimeDetail": [
                {
                    "Time": "2023-12-01 00:00:00",
                    "Money": "480.64255140"
                },
                {
                    "Time": "2023-12-02 00:00:00",
                    "Money": "243.94000000"
                }
            ]
        },
        "RequestId": "18619d53-8b77-45f2-a685-ac4490e74c06"
    }
}

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

There is no error code related to the API business logic. For other error codes, please see Common Error Codes.