Get Service Bandwidth
This API is used to retrieve the data of bandwidth, aggregated in 5-minute or 1-day intervals.
Request
Request-Line
POST /cdn/v1.0/analytics/getBandwidthByServiceName HTTP/1.1
Request Parameters
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceNames | String[] | Mandatory | Array of service names, the max array size is 50. |
| startTime | String | Mandatory | Start time. If the interval is minute,use the format yyyy-MM-ddTHH:mm:ssZ.If the interval is day,use the format yyyy-MM-ddT00:00:00Z. |
| endTime | String | Mandatory | End time. If the interval is minute,use the format yyyy-MM-ddTHH:mm:ssZ.If the interval is day,use the format yyyy-MM-ddT00:00:00Z. |
| interval | String | Optional | Interval of data spot, could be "minute", "day". For "minute", data spot is for 5 minutes, and for "day", data spot is one day. Default is "minute". Note: If interval = minute, the time range between start and end cannot exceed 24 hours. If interval = day, the time range cannot exceed 90 days. |
Response
Response Body
| Property name | Type | Description |
|---|---|---|
| Array | Array of Service Bandwidth. |
Object: Service Bandwidth
| Parameter | Type | Description |
|---|---|---|
| serviceName | String | Name of service. |
| bandwidths | Object | List of bandwidth data with 5 minutes interval. Array of Bandwidth. |
Object: Bandwidth
| Parameter | Type | Description |
|---|---|---|
| timestamp | String | Specify in UTC using the format yyyy-MM-ddTHH:mm:ssZ. E.g., 2025-09-09T17:35:00Z will return data from 2025-09-09T17:35:00Z to 2025-09-09T17:39:59Z. |
| value | Float | Displays the bandwidth value in bps. Example format: 94.33. |
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | Request.BadRequest | Bad request. |
| 400 | ServiceNames.Invalid | ServiceNames is empty or invalid. |
| 400 | Time.Invalid | StartTime or EndTime is required. |
| 400 | IntervalType.Invalid | Interval type must be minute or day. |
| 400 | IntervalType.Invalid | Interval type must be minute or day. |
| 400 | Time.Invalid | StartTime or EndTime format in 'yyyy-MM-dd'T'HH:mm:ss'Z'. |
| 400 | TimeRange.Exceeded | The difference between EndTime and StartTime cannot exceed 90 days. |
| 400 | TimeRange.Exceeded | The difference between EndTime and StartTime cannot exceed 24 hours. |
| 400 | TimeRange.EndBeforeStart | End time must be later than start time. |
| 400 | GetBandwidth.OperationFailed | Get Bandwidth failed. |
Examples
Get Service Bandwidth
Request
POST /cdn/v1.0/analytics/getBandwidthByServiceName HTTP/1.1
{
"serviceNames": [
"api53-1121-auto-test.activity04.com",
"api53-core-c-alisg.tiktokv.com"
],
"startTime": "2025-09-09T00:00:00Z",
"endTime": "2025-09-15T00:00:00Z",
"interval": "day"
}
Successful Response Body
[
{
"serviceName": "api53-1121-auto-test.activity04.com",
"bandwidths": [
{
"timestamp": "2025-09-09T00:00:00Z",
"value": 59.09
},
{
"timestamp": "2025-09-10T00:00:00Z",
"value": 1898.51
},
{
"timestamp": "2025-09-11T00:00:00Z",
"value": 9.17
},
{
"timestamp": "2025-09-12T00:00:00Z",
"value": 27.65
},
{
"timestamp": "2025-09-13T00:00:00Z",
"value": 2297.39
},
{
"timestamp": "2025-09-14T00:00:00Z",
"value": 9.17
}
]
},
{
"serviceName": "api53-core-c-alisg.tiktokv.com",
"bandwidths": [
{
"timestamp": "2025-09-09T00:00:00Z",
"value": 253517.25
},
{
"timestamp": "2025-09-10T00:00:00Z",
"value": 307859.47
},
{
"timestamp": "2025-09-11T00:00:00Z",
"value": 198267.04
},
{
"timestamp": "2025-09-12T00:00:00Z",
"value": 241347.79
},
{
"timestamp": "2025-09-13T00:00:00Z",
"value": 418538.92
},
{
"timestamp": "2025-09-14T00:00:00Z",
"value": 353247.18
}
]
}
]