---
title: "Compute timeseries analytics"
method: POST
path: "/api/v2/product-analytics/analytics/timeseries"
tags: ["Product Analytics"]
---

# Compute timeseries analytics

`POST /api/v2/product-analytics/analytics/timeseries`

Compute timeseries analytics results for Product Analytics data.
Returns time-bucketed values for charts and trend analysis.
The `compute.interval` field (milliseconds) is required for time bucketing.

## Request body

- ProductAnalyticsAnalyticsRequest — Request for computing analytics results (scalar or timeseries).
  - `data` ProductAnalyticsAnalyticsRequestData, required — Data object for an analytics request.
    - `attributes` ProductAnalyticsAnalyticsRequestAttributes, required — Attributes for an analytics request.
      - `enforced_execution_type` 'simple' | 'background' | 'trino-multistep' | 'materialized-view' — Override the query execution strategy.
      - `from` integer, required — Start time in epoch milliseconds. Must be less than `to`.
      - `query` ProductAnalyticsAnalyticsQuery, required — The analytics query definition containing a base query, compute rule, and optional grouping.
        - `audience_filters` ProductAnalyticsAudienceFilters — Audience filter definitions for targeting specific user segments.
          - `accounts` ProductAnalyticsAudienceAccountSubquery[] — Account audience queries.
            - `name` string, required — Name of this query, referenced in the formula.
            - `query` string — Search query for filtering accounts.
          - `formula` string — Boolean formula combining audience queries by name.
          - `segments` ProductAnalyticsAudienceSegmentSubquery[] — Segment audience queries.
            - `name` string, required — Name of this query, referenced in the formula.
            - `segment_id` string, uuid, required — UUID of the segment to filter by.
          - `users` ProductAnalyticsAudienceUserSubquery[] — User audience queries.
            - `name` string, required — Name of this query, referenced in the formula.
            - `query` string — Search query for filtering users.
        - `compute` ProductAnalyticsCompute, required — A compute rule for aggregating data.
          - `aggregation` string, required — The aggregation function (count, cardinality, avg, sum, min, max, etc.).
          - `interval` integer — Time bucket size in milliseconds. Required for timeseries queries.
          - `metric` string — The metric to aggregate on. Required for non-count aggregations.
        - `group_by` ProductAnalyticsGroupBy[] — Group-by rules for segmenting results.
          - `facet` string, required — The facet to group by.
          - `limit` integer — Maximum number of groups to return.
          - `should_exclude_missing` boolean — Exclude results with missing facet values.
          - `sort` ProductAnalyticsGroupBySort — Sort configuration for group-by results.
            - `aggregation` string — The aggregation function to sort by.
            - `metric` string — The metric to sort by.
            - `order` 'asc' | 'desc' — Direction of sort.
          - `source` string — The source for audience-filter-based group-by.
        - `indexes` string[] — Restrict the query to specific indexes. Max 1 entry.
        - `query` union, required — A query definition discriminated by the `data_source` field. Use `product_analytics` for standard event queries, or `product_analytics_occurrence` for occurrence-filtered queries.
          - ProductAnalyticsEventQuery — A standard Product Analytics event query.
            - `data_source` 'product_analytics', required — The data source identifier.
            - `search` ProductAnalyticsEventSearch, required — Search parameters for an event query.
              - …
          - ProductAnalyticsOccurrenceQuery — A Product Analytics occurrence-filtered query.
            - `data_source` 'product_analytics_occurrence', required — The data source identifier for occurrence queries.
            - `search` ProductAnalyticsOccurrenceSearch, required — Search parameters for an occurrence query.
              - …
      - `request_id` string — Optional request ID for multi-step query continuation.
      - `to` integer, required — End time in epoch milliseconds.
    - `type` 'formula_analytics_extended_request', required — The resource type for analytics requests.

## Response `200`

OK

- ProductAnalyticsTimeseriesResponse — Response for a timeseries analytics query.
  - `data` ProductAnalyticsTimeseriesResponseData — Data object for a timeseries analytics response.
    - `attributes` ProductAnalyticsTimeseriesResponseAttributes — Attributes of a timeseries analytics response, containing series data, timestamps, and interval definitions.
      - `intervals` ProductAnalyticsInterval[] — Interval definitions describing the time buckets used in the response.
        - `milliseconds` integer — The duration of each time bucket in milliseconds.
        - `start_time` integer — The start of this interval as an epoch timestamp in milliseconds.
        - `times` integer[] — Epoch timestamps (in milliseconds) for each bucket in this interval.
        - `type` string — The interval type (e.g., fixed or auto-computed bucket size).
      - `series` ProductAnalyticsSerie[] — The list of series, each corresponding to a query or group-by combination.
        - `group_tags` string[] — The group-by tag values that identify this series.
        - `query_index` integer — The index of the query that produced this series.
        - `unit` ProductAnalyticsUnit[] — Unit definitions for the series values.
          - `family` string — The unit family (e.g., time, bytes).
          - `id` integer — Numeric identifier for the unit.
          - `name` string — The full name of the unit (e.g., nanosecond).
          - `plural` string — Plural form of the unit name (e.g., nanoseconds).
          - `scale_factor` number, double — Conversion factor relative to the base unit of the family.
          - `short_name` string — Abbreviated unit name (e.g., ns).
      - `times` integer[] — Timestamps for each data point (epoch milliseconds).
      - `values` array[] — Values for each series at each time point.
        - number[] — Array of numeric values for a single series across all time points.
    - `id` string — Unique identifier for this response data object.
    - `type` 'timeseries_response' — The resource type identifier for a timeseries analytics response.
  - `meta` ProductAnalyticsResponseMeta — Metadata for a Product Analytics query response.
    - `request_id` string — Unique identifier for the request, used for multi-step query continuation.
    - `status` 'done' | 'running' | 'timeout' — The execution status of a Product Analytics query.

## Other responses

- `400` — Bad Request
- `403` — Not Authorized
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/revisions/da68bf029e4c/schema)
