Queries the usage data of a domain name in a specific billing region.
Operation description
-
This operation supports batch domain name queries. Separate multiple domain names with commas (,). You can query up to 100 domain names at a time. If the DomainName parameter is empty, data for all domain names under the account is returned.
-
Usage data includes three types: traffic, bandwidth, and requests, measured in bytes, bit/s, and count respectively.
-
If you do not specify the Interval parameter, you can query data for up to the last year, and the maximum time span per query is 31 days. For a query period of 1 to 3 days, data is returned at hourly granularity. For a query period longer than 3 days, data is returned at daily granularity.
-
When you specify the Interval parameter, the supported maximum time span per query, the historical data range, and the data delay are as follows:
| Time granularity | Maximum time span per query | Historical data range | Data delay |
| 5 minutes | 3 days | 93 days | 15 minutes |
| 1 hour | 31 days | 186 days | 4 hours |
| 1 day | 90 days | 366 days | 4:00 AM the next day |
QPS limit
The QPS limit for a single user on this operation is 10 calls per second. If the limit is exceeded, the API call is throttled, which may affect your business. Call this operation appropriately.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:DescribeDomainUsageData |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-shanghai |
| DomainName |
string |
No |
The streaming domain.
|
example.com |
| StartTime |
string |
Yes |
The start time. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format (UTC). |
2015-12-10T20:00:00Z |
| EndTime |
string |
Yes |
The end time. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format (UTC). The end time must be later than the start time, and the difference between the end time and the start time cannot exceed 31 days. |
2015-12-10T21:00:00Z |
| Type |
string |
No |
The type of usage data to retrieve. When Field is set to bps or traf, valid values:
When Field is set to req_traf or req_bps, valid values:
Valid values:
|
all |
| Field |
string |
Yes |
The data type of the usage data to query. Valid values:
|
traf |
| Area |
string |
No |
The region code. Valid values:
Note
If this parameter is not specified, the default value is the Chinese mainland. Regions outside the Chinese mainland: - Asia-Pacific 1: Hong Kong (China), Macao (China), Taiwan (China), Japan, and Southeast Asian countries except Vietnam and Indonesia. - Asia-Pacific 2: Indonesia, South Korea, and Vietnam. - Asia-Pacific 3: Australia and New Zealand. North America: the United States and Canada. - South America: Brazil. - Europe: Ukraine, the United Kingdom, France, the Netherlands, Spain, Italy, Sweden, and Germany. - Middle East and Africa: South Africa, Oman, the United Arab Emirates, and Kuwait. |
CN |
| DataProtocol |
string |
No |
The protocol of the data to retrieve. Valid values:
|
all |
| Interval |
string |
No |
Forces retrieval of data at the specified time granularity, in seconds. Valid values: 300 (5 minutes), 3600 (1 hour), and 86400 (1 day). |
300 |
When querying data at time T, stable data is available at time T+N, where N is 2 hours.
Example: If you query data for 1:00 PM on December 21, you can obtain stable data for 1:00 PM and earlier at 3:00 PM on December 21.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| EndTime |
string |
The end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC). |
2015-12-10T21:00Z |
| Type |
string |
The usage type. |
all |
| StartTime |
string |
The start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC). |
2015-12-10T20:00Z |
| RequestId |
string |
The request ID. |
B955107D-E658-4E77-B913-E0AC3D31693E |
| Area |
string |
The usage region. |
CN |
| DomainName |
string |
The streaming domain. |
example.com |
| DataInterval |
string |
The time interval of each record. Unit: seconds. |
300 |
| UsageDataPerInterval |
object |
||
| DataModule |
array<object> |
The traffic data of each record. |
|
|
object |
|||
| Value |
string |
The usage value.
|
423304182 |
| TimeStamp |
string |
The start time of the time slice. The time is in UTC and the format is yyyy-MM-ddTHH:mm:ssZ. |
2015-12-10T20:00:00Z |
Examples
Success response
JSON format
{
"EndTime": "2015-12-10T21:00Z",
"Type": "all",
"StartTime": "2015-12-10T20:00Z",
"RequestId": "B955107D-E658-4E77-B913-E0AC3D31693E",
"Area": "CN",
"DomainName": "example.com",
"DataInterval": "300",
"UsageDataPerInterval": {
"DataModule": [
{
"Value": "423304182",
"TimeStamp": "2015-12-10T20:00:00Z"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvaildParameter | Invalid Parameter | Invalid request parameter. |
| 400 | InvalidStartTime.Malformed | Specified StartTime is malformed. | |
| 400 | InvalidEndTime.Malformed | Specified EndTime is malformed. | |
| 400 | InvalidStartTime.ValueNotSupported | The specified value of parameter StartTime is not supported. | The value specified for the StartTime parameter is invalid. |
| 400 | InvalidTime.Malformed | Specified Time is malformed. | Invalid time. Check whether the time that you specified is correct. |
| 400 | InvalidParameterField | The specified Field is invalid. | The Field parameter is set to an invalid value. |
| 400 | InvalidParameterType | The specified Type is invalid. | The Type parameter is set to an invalid value. |
| 400 | InvalidEndTime.Mismatch | Specified end time does not math the specified start time. | The end time does not match the start time. Make sure that the start and end times match. |
| 400 | InvalidTimeSpan | The time span exceeds the limit. | The time span exceeds the limit. Please refer to the API documentation to specify a reasonable time span. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.