- [HTTP request](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#body.QueryTimeSeriesResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#body.aspect)
- [TimeSeriesDescriptor](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#TimeSeriesDescriptor)
  - [JSON representation](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#TimeSeriesDescriptor.SCHEMA_REPRESENTATION)
- [ValueDescriptor](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#ValueDescriptor)
  - [JSON representation](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#ValueDescriptor.SCHEMA_REPRESENTATION)
- [TimeSeriesData](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#TimeSeriesData)
  - [JSON representation](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#TimeSeriesData.SCHEMA_REPRESENTATION)
- [LabelValue](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#LabelValue)
  - [JSON representation](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#LabelValue.SCHEMA_REPRESENTATION)
- [PointData](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#PointData)
  - [JSON representation](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#PointData.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#try-it)

> [!WARNING]
> This item is deprecated!

Queries time series by using Monitoring Query Language (MQL). We recommend using PromQL instead of MQL. For more information about the status of MQL, see the [MQL deprecation notice](https://cloud.google.com/stackdriver/docs/deprecations/mql).

### HTTP request

`POST https://monitoring.googleapis.com/v3/{name}/timeSeries:query`

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: projects/[PROJECT_ID_OR_NUMBER] |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "query": string, "pageSize": integer, "pageToken": string } ``` |

| Fields ||
|---|---|
| `query` | `string` Required. The query in the [Monitoring Query Language](https://cloud.google.com/monitoring/mql/reference) format. The default time zone is in UTC. |
| `pageSize` | `integer` A positive number that is the maximum number of timeSeriesData to return. |
| `pageToken` | `string` If this field is not empty then it must contain the `nextPageToken` value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. |

### Response body

> [!WARNING]
> This item is deprecated!

The `timeSeries.query` response. For information about the status of Monitoring Query Language (MQL), see the [MQL deprecation notice](https://cloud.google.com/stackdriver/docs/deprecations/mql).

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "timeSeriesDescriptor": { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#TimeSeriesDescriptor`) }, "timeSeriesData": [ { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#TimeSeriesData`) } ], "nextPageToken": string, "partialErrors": [ { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/Shared.Types/Status`) } ] } ``` |

| Fields ||
|---|---|
| `timeSeriesDescriptor` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#TimeSeriesDescriptor`)`` The descriptor for the time series data. |
| `timeSeriesData[]` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#TimeSeriesData`)`` The time series data. |
| `nextPageToken` | `string` If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as `pageToken` in the next call to this method. |
| `partialErrors[]` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/Shared.Types/Status`)`` Query execution errors that may have caused the time series data returned to be incomplete. The available data will be available in the response. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/monitoring`
- `
  https://www.googleapis.com/auth/monitoring.read`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

## TimeSeriesDescriptor

A descriptor for the labels and points in a time series.

| JSON representation |
|---|
| ``` { "labelDescriptors": [ { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/LabelDescriptor`) } ], "pointDescriptors": [ { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#ValueDescriptor`) } ] } ``` |

| Fields ||
|---|---|
| `labelDescriptors[]` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/LabelDescriptor`)`` Descriptors for the labels. |
| `pointDescriptors[]` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#ValueDescriptor`)`` Descriptors for the point data value columns. |

## ValueDescriptor

A descriptor for the value columns in a data point.

| JSON representation |
|---|
| ``` { "key": string, "valueType": enum (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#ValueType`), "metricKind": enum (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind`), "unit": string } ``` |

| Fields ||
|---|---|
| `key` | `string` The value key. |
| `valueType` | ``enum (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#ValueType`)`` The value type. |
| `metricKind` | ``enum (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind`)`` The value stream kind. |
| `unit` | `string` The unit in which `timeSeries` point values are reported. `unit` follows the UCUM format for units as seen in <https://unitsofmeasure.org/ucum.html>. `unit` is only valid if `valueType` is INTEGER, DOUBLE, DISTRIBUTION. |

## TimeSeriesData

Represents the values of a time series associated with a TimeSeriesDescriptor.

| JSON representation |
|---|
| ``` { "labelValues": [ { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#LabelValue`) } ], "pointData": [ { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#PointData`) } ] } ``` |

| Fields ||
|---|---|
| `labelValues[]` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#LabelValue`)`` The values of the labels in the time series identifier, given in the same order as the `labelDescriptors` field of the TimeSeriesDescriptor associated with this object. Each value must have a value of the type given in the corresponding entry of `labelDescriptors`. |
| `pointData[]` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/query#PointData`)`` The points in the time series. |

## LabelValue

A label value.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "boolValue": boolean, "int64Value": string, "stringValue": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| The label value can be a bool, int64, or string. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `boolValue` | `boolean` A bool label value. |
| `int64Value` | `string (https://developers.google.com/discovery/v1/type-format format)` An int64 label value. |
| `stringValue` | `string` A string label value. |
| End of mutually exclusive fields. ||

## PointData

A point's value columns and time interval. Each point has one or more point values corresponding to the entries in `pointDescriptors` field in the TimeSeriesDescriptor associated with this object.

| JSON representation |
|---|
| ``` { "values": [ { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/TypedValue`) } ], "timeInterval": { object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.snoozes#TimeInterval`) } } ``` |

| Fields ||
|---|---|
| `values[]` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/TypedValue`)`` The values that make up the point. |
| `timeInterval` | ``object (`https://docs.cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.snoozes#TimeInterval`)`` The time interval associated with the point. |