Query Data API

BCM

  • Function Release Records
  • Product Announcement
    • Site Monitor Billing Announcement
  • Product Description
    • Product Introduction
    • Core concepts
    • Product advantages
    • Product features
  • Product pricing
    • Product pricing
    • Site Monitor Pricing
  • Quick Start
  • Operation guide
    • Enter Cloud Monitor
    • Dashboard
      • Overview
      • Management Dashboard Charts
      • Management Dashboard
    • Alarm Service
      • Overview
      • Alarm strategy
      • Alarm history
      • Alarm Template
      • Alarm Notification Template
      • Alarm callback
    • Cloud product monitor
      • Instance monitor
      • Instance Group
      • View Metrics
    • Site Monitor
      • Timed Detection (Formerly Site Monitor)
        • Overview
        • Manage Timed Probe Tasks
        • Purchase Guide
        • View timed probe tasks
      • IP advanced fault diagnosis
        • Manage IP Advanced Fault Diagnosis Tasks
        • View IP Advanced Fault Diagnosis Tasks
      • Instant probe
        • Overview
        • Manage instant probe tasks
    • Event Monitor
    • Event Bus
      • Event Delivery History
      • Overview
      • Event summary
      • Event Set
      • Event Rules
        • Event Rules
        • Event content conversion
        • Event pattern
  • API Reference
    • Overview
    • Service domain
    • Error response
    • Query Monitoring Data for Partial Dimensions
    • Dashboard API
    • Common Request and Response Headers
    • Alarm Management API
    • Alarm Management Interface V2
    • Alarm history
    • Push Data API
    • Event Bus Push
    • Application Monitor
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Instance Group Interface
    • Site Monitor
    • Query Latest Metric Data for Partial Dimensions
    • General Description
    • Query Data API
    • Event Monitor
    • Instant Probe
    • Event Alarm History
    • Notification Template
  • Java-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Batch Query Data Interface
    • Alarm History-related APIs
  • Python-SDK
    • Overview
    • Initialization
    • Install SDK
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy List API
    • Batch Data Query Interface
  • Go-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Alarm History-related APIs
    • Batch Data Query Interface
  • BCM-Agent
    • Functions
    • Monitoring Trend Chart
    • BCM-Agent-Frequently Asked Questions
    • Appendix
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
    • Performance-related questions
  • Cloud Product Monitor List
    • Cloud Product Metric List (Legacy Version Hidden)
    • Cloud Product Monitor Object Type List
    • Cloud Product Event List
    • Cloud Product Metric List
      • Database
        • Cloud Database TableStorage
        • Cloud Database DocDB for MongoDB
        • Data transmission service (DTS)
        • Cloud native database GaiaDB
        • Vector Database (VectorDB)
        • Dedicated Database Cluster (DDC)
        • Cloud Database Redis
        • Cloud database RDS
        • Cloud Database HBase
      • Enterprise Application
        • Message Service for RabbitMQ
      • Network
        • Service Network Interface Card (SNIC)
        • Peering Connections
        • IPv6 gateway
        • NAT Gateway
        • Load Balancer Dedicated Cluster LBDC
        • Baidu Load Balance (BLB)
        • Network probe NP
        • Dedicated channel
        • Elastic IP EIP
        • Elastic Network Interface Card (ENIC)
        • Cloud Smart Network (CSN)
        • Dedicated gateway
        • Virtual Private Network (VPN) Gateway
        • Layer 2 Gateway LTGW
        • Physical dedicated line
      • Intelligent Big Data
        • MapReduce BMR
        • Message service for Kafka-dedicated
        • Message Service for RocketMQ
        • Baidu Stream Computing (BSC)
        • Baidu Elasticsearch
        • Log Service BLS
        • Data warehouse DORIS
      • Cloud native
        • Cloud Function Computing
        • Baidu container instance (BCI)
      • Compute
        • Baidu Cloud Compute (BCC)
        • Elastic Baremetal Compute BBC
      • Storage and CDN
        • Parallel Filesystem Service (PFS)
        • Cloud File System (CFS)
        • Content delivery network (CDN)
        • Baidu object storage (BOS)
        • Cloud Disk Server (CDS)
        • Baidu edge computing (BEC)
      • Website service
        • Baidu Cloud Virtual Host (BCH)
      • Large Model Platform
        • Qianfan Large Model Platform ModelBuilder
  • Typical Practices
    • Scenarios for Batch Creation of Alarm Strategies
    • Usage Scenarios for Different Notification Channels
  • Service Level Agreement (SLA)
    • Site Monitor Service Level Agreement SLA
  • BCM-Tool
    • Uninstallation Method
    • Installation method
    • BCM-Tool-Frequently Asked Questions
    • Functions
    • Multi-Region Service
    • Application method
All documents
menu
No results found, please re-enter

BCM

  • Function Release Records
  • Product Announcement
    • Site Monitor Billing Announcement
  • Product Description
    • Product Introduction
    • Core concepts
    • Product advantages
    • Product features
  • Product pricing
    • Product pricing
    • Site Monitor Pricing
  • Quick Start
  • Operation guide
    • Enter Cloud Monitor
    • Dashboard
      • Overview
      • Management Dashboard Charts
      • Management Dashboard
    • Alarm Service
      • Overview
      • Alarm strategy
      • Alarm history
      • Alarm Template
      • Alarm Notification Template
      • Alarm callback
    • Cloud product monitor
      • Instance monitor
      • Instance Group
      • View Metrics
    • Site Monitor
      • Timed Detection (Formerly Site Monitor)
        • Overview
        • Manage Timed Probe Tasks
        • Purchase Guide
        • View timed probe tasks
      • IP advanced fault diagnosis
        • Manage IP Advanced Fault Diagnosis Tasks
        • View IP Advanced Fault Diagnosis Tasks
      • Instant probe
        • Overview
        • Manage instant probe tasks
    • Event Monitor
    • Event Bus
      • Event Delivery History
      • Overview
      • Event summary
      • Event Set
      • Event Rules
        • Event Rules
        • Event content conversion
        • Event pattern
  • API Reference
    • Overview
    • Service domain
    • Error response
    • Query Monitoring Data for Partial Dimensions
    • Dashboard API
    • Common Request and Response Headers
    • Alarm Management API
    • Alarm Management Interface V2
    • Alarm history
    • Push Data API
    • Event Bus Push
    • Application Monitor
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Instance Group Interface
    • Site Monitor
    • Query Latest Metric Data for Partial Dimensions
    • General Description
    • Query Data API
    • Event Monitor
    • Instant Probe
    • Event Alarm History
    • Notification Template
  • Java-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Batch Query Data Interface
    • Alarm History-related APIs
  • Python-SDK
    • Overview
    • Initialization
    • Install SDK
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy List API
    • Batch Data Query Interface
  • Go-SDK
    • Overview
    • Initialization
    • Install the SDK Package
    • BcmClient
    • Query Monitoring Data for Partial Dimensions
    • Dimension Value TopN and Monitoring Data Query Interface
    • Batch Query Monitoring Data Interface V2
    • Dimension Value TopN Query Interface
    • Query Latest Metric Data for Partial Dimensions
    • Query Data API
    • Alarm Strategy-related APIs
    • Alarm History-related APIs
    • Batch Data Query Interface
  • BCM-Agent
    • Functions
    • Monitoring Trend Chart
    • BCM-Agent-Frequently Asked Questions
    • Appendix
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
    • Performance-related questions
  • Cloud Product Monitor List
    • Cloud Product Metric List (Legacy Version Hidden)
    • Cloud Product Monitor Object Type List
    • Cloud Product Event List
    • Cloud Product Metric List
      • Database
        • Cloud Database TableStorage
        • Cloud Database DocDB for MongoDB
        • Data transmission service (DTS)
        • Cloud native database GaiaDB
        • Vector Database (VectorDB)
        • Dedicated Database Cluster (DDC)
        • Cloud Database Redis
        • Cloud database RDS
        • Cloud Database HBase
      • Enterprise Application
        • Message Service for RabbitMQ
      • Network
        • Service Network Interface Card (SNIC)
        • Peering Connections
        • IPv6 gateway
        • NAT Gateway
        • Load Balancer Dedicated Cluster LBDC
        • Baidu Load Balance (BLB)
        • Network probe NP
        • Dedicated channel
        • Elastic IP EIP
        • Elastic Network Interface Card (ENIC)
        • Cloud Smart Network (CSN)
        • Dedicated gateway
        • Virtual Private Network (VPN) Gateway
        • Layer 2 Gateway LTGW
        • Physical dedicated line
      • Intelligent Big Data
        • MapReduce BMR
        • Message service for Kafka-dedicated
        • Message Service for RocketMQ
        • Baidu Stream Computing (BSC)
        • Baidu Elasticsearch
        • Log Service BLS
        • Data warehouse DORIS
      • Cloud native
        • Cloud Function Computing
        • Baidu container instance (BCI)
      • Compute
        • Baidu Cloud Compute (BCC)
        • Elastic Baremetal Compute BBC
      • Storage and CDN
        • Parallel Filesystem Service (PFS)
        • Cloud File System (CFS)
        • Content delivery network (CDN)
        • Baidu object storage (BOS)
        • Cloud Disk Server (CDS)
        • Baidu edge computing (BEC)
      • Website service
        • Baidu Cloud Virtual Host (BCH)
      • Large Model Platform
        • Qianfan Large Model Platform ModelBuilder
  • Typical Practices
    • Scenarios for Batch Creation of Alarm Strategies
    • Usage Scenarios for Different Notification Channels
  • Service Level Agreement (SLA)
    • Site Monitor Service Level Agreement SLA
  • BCM-Tool
    • Uninstallation Method
    • Installation method
    • BCM-Tool-Frequently Asked Questions
    • Functions
    • Multi-Region Service
    • Application method
  • Document center
  • arrow
  • BCM
  • arrow
  • API Reference
  • arrow
  • Query Data API
Table of contents on this page
  • API description
  • API restriction
  • Request structure
  • Request parameters
  • Response parameters
  • Request example
  • Response example

Query Data API

Updated at:2025-11-03

API description

Retrieve Time Series data for one or more statistics based on specified Metrics, including Cloud Product Monitor data, Site Monitor data, or Custom Monitor data that you have uploaded.

API restriction

The number of DataPoints returned in a single response cannot exceed 1,440.

Request structure

  • Method: GET
  • URL: /json-api/v1/metricdata/{userid}/{scope}/{metricName}?{Query}
  • Query: dimensions={dimensions}&statistics[]={statistics1,statistics2,statistics3...}&periodInSecond={periodInSecond}&startTime={startTime}&endTime={endTime}

Request parameters

Name Types Description Required or not Parameter location
userId String Tenant ID Yes URL parameter
scope String, limited to the following character set: 0~9, A~Z, a~z, _ Scope Yes URL parameter
metricName String, limited to the following character set: 0~9, A~Z, a~z, _ Monitor Metric name Yes URL parameter
statistics[] Statistics, in statistics1, statistics2, statistics3 format, options: average, maximum, minimum, sum, sampleCount Statistic Method Type Yes Query
dimensions A string formatted as dimensionName:dimensionValue. For Metrics with multiple Dimensions, connect them using semicolons, e.g., dimensionName:dimensionValue;dimensionName:dimensionValue. Each dimension can have only one specified value. Dimension list Yes Query
startTime DateTime, refer to Date and Time, expressed in UTC date Query start time Yes Query
endTime DateTime, refer to Date and Time, expressed in UTC date Query end time Yes Query
periodInSecond Integer, multiple of 60, unit: second (s) Statistical Period Yes Query

Parameter explanation

  • For concepts like Scope, Metric, Statistic, and Dimension, refer to [Core Concepts](BCM/Product Description/Core concepts.md).

Response parameters

Name Types Description
requestId String Request identifier
code String Return code
message String Error message
dataPoints List(DataPoint) Monitor Metric

DataPoint

Name Types Description
average double Average of Metrics within the statistical period
sum double Sum of Metrics within the statistical period
minimum double Minimum value of Metrics within the statistical period
maximum double Maximum value of Metrics within the counting cycle
sampleCount Integer Number of DataPoints for the Metric within the statistical period
timestamp DateTime, refer to [Date and Time](BCM/API Reference/General Description.md#Date and time regulations), expressed in UTC date Time corresponding to the statistical period of Metric

Request example

For clarity, the request example has been line-wrapped. In actual request construction, the URL path and query parameters should be written on a single line.

Plain Text
1GET  /json-api/v1/metricdata/fakeuser1ba678asdf8as7df6a5sdf67/BCE_BCC/CpuIdlePercent?
2dimensions=InstanceId:fakeid-2222-8888-1111-13a8469b1fb2
3&statistics[]=average,maximum,minimum
4&periodInSecond=60
5&startTime=2019-04-16T13:55:01Z
6&endTime=2019-04-16T14:00:01Z
7HTTP/1.1
8Host:bcm.bj.baidubce.com:80  

Response example

Successful response example

When querying data, include the statistics\[] parameter, which determines the attributes for each dataPoint in the response.

When statistics[]=average, the response result example is as follows:

Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: dwegvad4-dwea-4d3dsa-8ew2-4b7263fs1ecd
3Content-Type: application/json;charset=UTF-8
4{
5    "requestId": "17f101a7-67a8-4c2e-93d7-60c0d4a21f0c",
6    "code": "OK",
7    "message": "OK",
8    "dataPoints": [
9        {
10            "average": 2.24,
11            "timestamp": "2019-04-16T13:55:01Z"
12        },
13        {
14            "average": 0.22,
15            "timestamp": "2019-04-16T13:56:01Z"
16        },
17        {
18            "average": 0.19,
19            "timestamp": "2019-04-16T13:57:01Z"
20        },
21        {
22            "average": 0.18,
23            "timestamp": "2019-04-16T13:58:01Z"
24        },
25        {
26            "timestamp": "2019-04-16T13:59:01Z"
27        }
28    ]
29}

When statistics[]=average, sum, minimum, the response result example is as follows:

Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: dd00bad4-d22a-4d1c-8f12-4b513f0b91ec
3Content-Type: application/json;charset=UTF-8
4{
5    "requestId": "dd00bad4-d22a-4d1c-8f12-4b513f0b91ec",
6    "code": "OK",
7    "message": "OK",
8    "successList": [
9        {
10            "dataPoints": [
11                {
12                    "average": 40359.0,
13                    "sum": 80718.0,
14                    ""minimum":39900.0,
15                    "timestamp": "2019-04-23T00: 00: 00Z"
16                }
17            ]
18        }
19    ]
20}

Unsuccessful response example

If your request is correctly structured but no corresponding monitoring data is found, or the input parameters are incorrect, BCM will return a 200 OK response code and provide details about the error in the response body.

Case 1: No data found. No monitoring data exists under the specified user, Scope, Metric, and Dimension for the given time period.

When this occurs, the corresponding time point will be returned, but without monitor data

Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: dd00bad4-d22a-4d1c-8f12-4b513f0b91ec
3Content-Type: application/json;charset=UTF-8
4{
5    "requestId": "dd00bad4-d22a-4d1c-8f12-4b513f0b91ec",
6    "code": "OK",
7    "message": "OK",
8    "successList": [
9        {
10            "dataPoints": [
11                {
12                    "timestamp": "2019-04-23T00: 00: 00Z"
13                }
14            ]
15        }
16    ]
17}

Case 2: Incorrect parameters. The following example is missing the endTime parameter.

Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: dd00bad4-d22a-4d1c-8f12-4b513f0b91ec
3Content-Type: application/json;charset=UTF-8
4{
5    "requestId": "dd00bad4-d22a-4d1c-8f12-4b513f0b91ec",
6    "code": "INVALID_PARAMETER",
7    "message": "Required endTime parameter String is not present"
8}

The example below demonstrates an incorrect format for Dimension parameter values.

Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: dd00bad4-d22a-4d1c-8f12-4b513f0b91ec
3Content-Type: application/json;charset=UTF-8
4{
5    "requestId": "dd00bad4-d22a-4d1c-8f12-4b513f0b91ec",
6    "code": "INVALID_PARAMETER_VALUE",
7    "message": "Wrong dimensions format, example: name:value;name:value"
8}

Previous
General Description
Next
Event Monitor