CDN
traffic - Per-Domain Request Count
API Endpoint
Request URL: stat/traffic/request/eachDomain (GET)
API Request Domain:
cdn.api.edgenext.com
API Version:v2
API Description
This API is used to query request count statistics for each accelerated domain separately.
Request Parameters
Common Parameters
The user's authentication token is required. Please contact the on-call support team to obtain a valid token.
GET Request Parameters
Request parameters should be added to the query string of the URL.
Example:
?key1=value1&key2=value2
| Parameter Name | Data Type | Required | Description |
|---|---|---|---|
| domains | string | Yes | Specifies the accelerated domains to query. A maximum of 10 accelerated domains can be queried in a single request. When multiple accelerated domains are specified, the API returns request count statistics for each accelerated domain separately. |
| start_time | string | Yes | Specifies the start time of the query range. Examples: 2020-06-01 10:00, 2020-06-01 If only a date is provided (2020-06-01), it represents 2020-06-01 00:00:00 as the start time. The returned data includes records greater than or equal to the specified time. Based on the selected aggregation interval, the time will be rounded down to the nearest interval. Example: When querying 2020-06-01 10:03 with a 5-minute interval, the first returned data point corresponds to 2020-06-01 10:00. The interval between start_time and end_time must not exceed 31 days. |
| end_time | string | Yes | Specifies the end time of the query range. Examples: 2020-06-02 10:00, 2020-06-02 If only a date is provided (2020-06-02), it represents 2020-06-02 23:59:59 as the end time. The returned data includes records less than or equal to the specified time. Based on the selected aggregation interval, the time will be rounded down to the nearest interval. Example: When querying 2020-06-02 10:17 with a 5-minute interval, the first returned data point corresponds to 2020-06-02 10:15:00. The interval between start_time and end_time must not exceed 31 days. |
| grad | string | No | Specifies the data aggregation interval. minute: 1-minute interval. Query time range: up to 1 day. minute5: 5-minute interval. Query time range: up to 31 days. hour: Hourly interval. Query time range: up to 31 days. day: Daily interval. Query time range: up to 93 days. If omitted, the default value is minute5. |
| ip_protocol | string | No | Specifies the IP protocol type. ipv4: Query IPv4 statistics. ipv6: Query IPv6 statistics. If omitted, aggregated statistics for both IPv4 and IPv6 are returned. |
| protocol_type | string | No | Specifies the HTTP protocol type. http: Query HTTP statistics. https: Query HTTPS statistics. If omitted, aggregated statistics for both HTTP and HTTPS are returned. |
| query_area | string | No | Specifies the query scope. all: Query both domestic and overseas regions. cn: Query domestic regions. abroad: Query overseas regions. If omitted, the default value is all. |
Request Example
curl -X GET "https://cdn.api.edgenext.com/v2/stat/traffic/request/eachDomain?domains=example1.com,example2.com&start_time=2024-01-25+15%3A00&end_time=2024-01-25+15%3A05&grad=minute&query_area=all&ip_protocol=ipv4&token=xxx"
Response Example
JSON format
{
"code": 0,
"data": {
"example1.com": {
"domain": "example1.com",
"data": []
},
"example2.com": {
"domain": "example2.com",
"data": [
[
1706166000000,
2
],
[
1706166060000,
1
],
[
1706166120000,
1
],
[
1706166180000,
0
],
[
1706166240000,
7
],
[
1706166300000,
2
]
]
}
}
}
Response Headers
Example:
HTTP/1.0 200 OK
Api-Id: 0
Content-Type: application/json; charset=utf-8
X-Ratelimit-Grad: minute // Rate limit granularity (minute/hour/day).
X-Ratelimit-Limit: 300 // Maximum number of requests allowed within the current rate limit period.
X-Ratelimit-Remaining: 297 // Remaining number of requests available within the current rate limit period.
X-Retry-After: 35 // Number of seconds until the current rate limit period is reset.
HTTP Status Code Description
| HTTP Status Code | Description |
|---|---|
| 404 | The requested URL is invalid. |
| 401 | Authentication failed. The token is invalid or the API permission has not been enabled. |
| 400 | Invalid request parameters. |
| 200 | Request completed successfully and the requested data is returned. |
| 5xx | Server-side error. Please contact the on-call support team. |
Need help? Contact our support team at support@edgenext.com.
Back to documentation home