DescribeBillingData
1. API Description
Domain name for API request: teo.intl.tencentcloudapi.com.
This API is used to query billing data.
A maximum of 50 requests can be initiated per second for this API.
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 | The start time. Data will be returned according to the timezone of the input timestamp. |
EndTime | Yes | Timestamp ISO8601 | The end time. The query time range (EndTime - StartTime ) must be less than or equal to 31 days. The timezone of the end timestamp must be consistent with the start timestamp, and data will be returned according to the timezone of the input timestamps. |
ZoneIds.N | Yes | Array of String | Site ID set. This parameter is required. A maximum of 100 site ids can be imported. Use * to query data for all sites under the Tencent Cloud root account. Querying account-level data requires permissions for all site resources in this API. |
MetricName | Yes | String | Metric list. Values as follows:. L4/L7 acceleration traffic: L4/L7 acceleration bandwidth: HTTP/HTTPS security requests: Value-added service usage: Edge computing usage: Media processing usage: |
Interval | Yes | String | Time granularity of the query. Valid values: |
Filters.N | No | Array of BillingDataFilter | Filter criteria. The detailed values of filter criteria are as follows: 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 Note: BillingDataFilter with the same Type have an "or" relationship with each other, while those with different Type have an "and" relationship between them. |
GroupBy.N | No | Array of String | Aggregation dimensions for grouping. You are allowed to group by up to two dimensions at the same time. Valid values are as follows: Note: The output parameter's default maximum value for the number of groups is 200. If you encounter an error related to this limit, you should reduce the number of groups in the final output by narrowing down the query scope using ZoneIds.N or Filters.N parameters, or by decreasing the number of dimensions specified in the GroupBy.N parameter. |
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 for Specified Site in Specified Billing Region
This example shows you how to query the billing usage of content acceleration traffic for a specified zone-id in a designated region-id with daily granularity.
Input Example
POST / HTTP/1.1
Host: teo.intl.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
}
]
}
}
Example2 Querying Content Acceleration Traffic of Specified Sites Grouped by Site ID
This example shows you how to query the billing usage of content acceleration traffic for a specified zone-id, grouping by zone-id with daily granularity.
Input Example
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeBillingData
<Common request parameters>
{
"StartTime": "2025-07-01T00:00:00+08:00",
"EndTime": "2025-07-02T23:59:59+08:00",
"Interval": "day",
"MetricName": "acc_flux",
"ZoneIds": [
"zone-2m2gq4dnpmd2",
"zone-30hqppzribht"
],
"GroupBy": [
"zone-id"
]
}
Output Example
{
"Response": {
"RequestId": "d2174285-8aac-4cdc-bc06-d81f2f6520da",
"Data": [
{
"Time": "2025-06-30T16:00:00Z",
"Value": 0,
"ZoneId": "zone-2m2gq4dnpmd2"
},
{
"Time": "2025-07-01T16:00:00Z",
"Value": 2751240612,
"ZoneId": "zone-2m2gq4dnpmd2"
},
{
"Time": "2025-06-30T16:00:00Z",
"Value": 0,
"ZoneId": "zone-30hqppzribht"
},
{
"Time": "2025-07-01T16:00:00Z",
"Value": 68443435,
"ZoneId": "zone-30hqppzribht"
}
]
}
}
Example3 Querying Content Acceleration Traffic for Specified Site by Domain Group
This example shows you how to query specified content acceleration traffic billing volume by domain name with daily granularity for a given zone-id.
Input Example
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeBillingData
<Common request parameters>
{
"StartTime": "2025-07-01T00:00:00+08:00",
"EndTime": "2025-07-02T23:59:59+08:00",
"Interval": "day",
"MetricName": "acc_flux",
"ZoneIds": [
"zone-2m2gq4dnpmd2",
"zone-30hqppzribht"
],
"GroupBy": [
"host"
]
}
Output Example
{
"Response": {
"RequestId": "d2174285-8aac-4cdc-bc06-d81f2f6520da",
"Data": [
{
"Host": "test1.example.com",
"Time": "2025-06-30T16:00:00Z",
"Value": 1387001003,
"ZoneId": "zone-2m2gq4dnpmd2"
},
{
"Host": "test1.example.com",
"Time": "2025-07-01T16:00:00Z",
"Value": 1390529805,
"ZoneId": "zone-2m2gq4dnpmd2"
},
{
"Host": "test2.example.com",
"Time": "2025-06-30T16:00:00Z",
"Value": 2879078,
"ZoneId": "zone-2m2gq4dnpmd2"
},
{
"Host": "test2.example.com",
"Time": "2025-07-01T16:00:00Z",
"Value": 2889084,
"ZoneId": "zone-2m2gq4dnpmd2"
}
]
}
}
Example4 Querying Content Acceleration Traffic of Specified Site and Grouping by Site ID and Billing Region
This example shows you how to query specified zone-id content acceleration traffic billing volume, grouping by zone-id and billing region with daily granularity.
Input Example
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeBillingData
<Common request parameters>
{
"StartTime": "2025-07-01T00:00:00+08:00",
"EndTime": "2025-07-02T23:59:59+08:00",
"Interval": "day",
"MetricName": "acc_flux",
"ZoneIds": [
"zone-2m2gq4dnpmd2",
"zone-30hqppzribht"
],
"GroupBy": [
"zone-id",
"region-id"
]
}
Output Example
{
"Response": {
"RequestId": "d2174285-8aac-4cdc-bc06-d81f2f6520da",
"Data": [
{
"RegionId": "SA",
"Time": "2025-06-30T16:00:00Z",
"Value": 549591531,
"ZoneId": "zone-2m2gq4dnpmd2"
},
{
"RegionId": "SA",
"Time": "2025-07-01T16:00:00Z",
"Value": 549591531,
"ZoneId": "zone-2m2gq4dnpmd2"
},
{
"RegionId": "MidEast",
"Time": "2025-06-30T16:00:00Z",
"Value": 549591531,
"ZoneId": "zone-30hqppzribht"
},
{
"RegionId": "MidEast",
"Time": "2025-07-01T16:00:00Z",
"Value": 549591531,
"ZoneId": "zone-30hqppzribht"
}
]
}
}
5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
- Tencent Cloud SDK 3.0 for Python
- Tencent Cloud SDK 3.0 for Java
- Tencent Cloud SDK 3.0 for PHP
- Tencent Cloud SDK 3.0 for Go
- Tencent Cloud SDK 3.0 for Node.js
- Tencent Cloud SDK 3.0 for .NET
- Tencent Cloud SDK 3.0 for C++
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.GroupByLimitExceeded | GroupBy parameter exceeds the quantity limit. |
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. |
- 1. API Description
- 2. Input Parameters
- 3. Output Parameters
- 4. Example
- Example1 Querying Content Acceleration Traffic for Specified Site in Specified Billing Region
- Example2 Querying Content Acceleration Traffic of Specified Sites Grouped by Site ID
- Example3 Querying Content Acceleration Traffic for Specified Site by Domain Group
- Example4 Querying Content Acceleration Traffic of Specified Site and Grouping by Site ID and Billing Region
- 5. Developer Resources
- SDK
- Command Line Interface
- 6. Error Code