
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2026-03-18 14:12:49
Field | Value |
|---|---|
API Name | GetMetricStatistics |
Request Method | GET |
Endpoint |
|
VPC Internal Endpoint |
|
Rate Limit Notice:
Per-user API call limit: up to 3,600 requests per minute (except for special data centers).
Maximum records returned per single request: 60,000.
If you need to query real-time data from within the last 15 minutes with high concurrency, please use the Batch Get Data API instead.
It is recommended to use API Explorer.
API Explorer provides online invocation, signature verification, SDK code generation, and quick API search. You can view the full request content and response for each call, and auto-generate SDK usage examples.
The table below lists the API-specific request parameters and a subset of common parameters. For the full list of common parameters, see Common Request Parameters.
Parameter | Required | Type | Description |
|---|---|---|---|
| Yes | String | Common parameter. Fixed value for this API: |
| Yes | String | Common parameter. Fixed value for this API: |
| Yes | String | Identifies a category of cloud product. Specifies the namespace. |
| Yes | String | The ID of the monitored instance. Special notes for certain product lines: KS3 — The instance ID is the |
| Yes | String | The name of the monitoring metric. |
| Yes | String | The start time of the query range. Format: |
| Yes | String | The end time of the query range. Format: |
| Yes | String | The aggregation method for the data. Supported values: |
| No | String | The statistical granularity, in seconds. Note: This value must be an integer multiple of 60. An incorrect value may cause data to differ from the console display. When left empty (default), no downsampling is applied — data is returned at the product's native push frequency. |
Field | Type | Description |
|---|---|---|
| Object | Query result object. |
| Object | Data points container. |
| Array of MetricDataPoint | The monitoring data points. |
| String | The monitoring metric name. Example: |
| Object | Response metadata container. |
| String | Unique request ID. |
Replace
${region}with the appropriate region. See: Region Reference. Replace${CommonParams}with the appropriate common parameters. See: Common Parameters.
bash
curl -X GET 'https://monitor.${region}.api.ksyun.com/?Action=GetMetricStatistics&Version=2010-05-25&Namespace=KEC&StartTime=2021-12-13T17:52:00Z&EndTime=2021-12-13T17:56:00Z&InstanceID=6e98888-4bbe-4da5-baef-91306bce03e9&MetricName=cpu.utilizition.total&Period=60&Aggregate=average,max,min,sum,count' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'host: monitor.api.ksyun.com' \
-H 'cache-control: no-cache' \
-H ${CommonParams}Both XML and JSON formats are supported.
JSON Format
json
{
"getMetricStatisticsResult": {
"datapoints": {
"member": [
{
"timestamp": "2021-12-13T17:52:00Z",
"unixTimestamp": 1639389120000,
"average": "0.136",
"max": "0.136",
"min": "0.136",
"sampleCount": "1",
"sum": "0"
},
{
"timestamp": "2021-12-13T17:53:00Z",
"unixTimestamp": 1639389180000,
"average": "0.136",
"max": "0.136",
"min": "0.136",
"sampleCount": "1",
"sum": "0"
},
{
"timestamp": "2021-12-13T17:54:00Z",
"unixTimestamp": 1639389240000,
"average": "0.136",
"max": "0.136",
"min": "0.136",
"sampleCount": "1",
"sum": "0"
},
{
"timestamp": "2021-12-13T17:55:00Z",
"unixTimestamp": 1639389300000,
"average": "0.136",
"max": "0.136",
"min": "0.136",
"sampleCount": "1",
"sum": "0"
},
{
"timestamp": "2021-12-13T17:56:00Z",
"unixTimestamp": 1639389360000,
"average": "0.136",
"max": "0.136",
"min": "0.136",
"sampleCount": "1",
"sum": "0"
}
]
},
"label": "cpu.utilizition.total"
},
"responseMetadata": {
"requestId": "3a037487-33c6-4c01-b68a-1545f7312fed"
}
}XML Format
xml
<GetMetricStatisticsResponse xmlns="https://ksyun.kingeyes.com/">
<GetMetricStatisticsResult>
<Datapoints>
<member>
<Average>0.136</Average>
<Max>0.136</Max>
<Min>0.136</Min>
<SampleCount>1</SampleCount>
<Sum>0</Sum>
<Timestamp>2021-12-13T17:52:00Z</Timestamp>
<UnixTimestamp>1639389120000</UnixTimestamp>
</member>
<member>
<Average>0.136</Average>
<Max>0.136</Max>
<Min>0.136</Min>
<SampleCount>1</SampleCount>
<Sum>0</Sum>
<Timestamp>2021-12-13T17:53:00Z</Timestamp>
<UnixTimestamp>1639389180000</UnixTimestamp>
</member>
<member>
<Average>0.136</Average>
<Max>0.136</Max>
<Min>0.136</Min>
<SampleCount>1</SampleCount>
<Sum>0</Sum>
<Timestamp>2021-12-13T17:54:00Z</Timestamp>
<UnixTimestamp>1639389240000</UnixTimestamp>
</member>
<member>
<Average>0.136</Average>
<Max>0.136</Max>
<Min>0.136</Min>
<SampleCount>1</SampleCount>
<Sum>0</Sum>
<Timestamp>2021-12-13T17:55:00Z</Timestamp>
<UnixTimestamp>1639389300000</UnixTimestamp>
</member>
<member>
<Average>0.136</Average>
<Max>0.136</Max>
<Min>0.136</Min>
<SampleCount>1</SampleCount>
<Sum>0</Sum>
<Timestamp>2021-12-13T17:56:00Z</Timestamp>
<UnixTimestamp>1639389360000</UnixTimestamp>
</member>
</Datapoints>
<Label>cpu.utilizition.total</Label>
</GetMetricStatisticsResult>
<ResponseMetadata>
<RequestId>3a037487-33c6-4c01-b68a-1545f7312fed</RequestId>
</ResponseMetadata>
</GetMetricStatisticsResponse>Both XML and JSON formats are supported.
JSON Format
json
{
"requestid": "7106664e-bce9-4871-b5df-9cf6e25ce142",
"error": {
"type": "sender",
"code": "InvalidParameterValue",
"message": "Invalid `StartTime` parameter value, time type should be 'yyyy-MM-ddTHH:mm:ssZ', like '2016-05-11T15:00:00Z'."
}
}The table below lists only the error codes specific to this API's business logic. For all other error codes, refer to Common Error Codes.
Pure Mode