Method: projects.locations.datasets.query

Stay organized with collections Save and categorize content based on your preferences.

Execute a Timeseries Insights query over a loaded DataSet.

HTTP request


The URL uses gRPC Transcoding syntax.

Path parameters



Required. Loaded DataSet to be queried in the format of "projects/{project}/datasets/{dataset}"

Request body

The request body contains data with the following structure:

JSON representation
  "detectionTime": string,
  "slicingParams": {
    object (SlicingParams)
  "timeseriesParams": {
    object (TimeseriesParams)
  "forecastParams": {
    object (ForecastParams)
  "returnTimeseries": boolean,
  "numReturnedSlices": integer

string (Timestamp format)

Required. This is the point in time that we want to probe for anomalies.

The corresponding TimeseriesPoint is referred to as the detection point.

NOTE: As with any other time series point, the value is given by aggregating all events in the slice that are in the [detectionTime, detectionTime + granularity) time interval, where the granularity is specified in the timeseriesParams.granularity field.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".


object (SlicingParams)

Parameters controlling how we will split the dataset into the slices that we will analyze.


object (TimeseriesParams)

Parameters controlling how we will build the time series used to predict the detectionTime value for each slice.


object (ForecastParams)

Parameters that control the time series forecasting models, such as the sensitivity of the anomaly detection.



If specified, we will return the actual and forecasted time for all returned slices.

The time series are returned in the EvaluatedSlice.history and EvaluatedSlice.forecast fields.



How many slices are returned in QueryDataSetResponse.slices.

The returned slices are tentatively the ones with the highest anomaly scores in the dataset that match the query, but it is not guaranteed.

Reducing this number will improve query performance, both in terms of latency and resource usage.

Defaults to 50.

Response body

If successful, the response body contains an instance of QueryDataSetResponse.

Authorization Scopes

Requires the following OAuth scope:


For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the name resource:

  • timeseriesinsights.datasets.query

For more information, see the IAM documentation.