---
title: "Query Chart Series Data"
method: POST
path: "/api/v2/charts/series"
tags: ["Charts"]
---

# Query Chart Series Data

`POST /api/v2/charts/series`

Retrieves time series data based on configured series parameters

## Request body

- SeriesQueryRequest
  - `series` ChartSeries[], required — Array of series configurations
    - `sourceId` string, required — ID of the data source for this series
    - `aggFn` 'avg' | 'count' | 'count_distinct' | 'last_value' | 'max' | 'min' | 'quantile' | 'sum', required — Aggregation function to use on the data
    - `field` string — Field to aggregate
    - `where` string, required — Filter condition in Lucene query syntax
    - `whereLanguage` 'lucene' | 'sql' — Query language used in the where clause
    - `groupBy` string[], required — Fields to group the results by
    - `metricName` string — Name of the metric (for metric data sources)
    - `metricDataType` 'sum' | 'gauge' | 'histogram' — Type of metric data
  - `startTime` number, required — Start timestamp in milliseconds
  - `endTime` number, required — End timestamp in milliseconds
  - `granularity` '30s' | '1m' | '5m' | '10m' | '15m' | '30m' | '1h' | '2h' | '6h' | '12h' | '1d' | '2d' | '7d' | '30d' | 'auto' — Time bucket size for aggregations
  - `seriesReturnType` 'ratio' | 'column' — Format of the returned data

## Response `200`

Successfully retrieved time series data

- SeriesResponse
  - `data` SeriesDataPoint[] — Array of data points for the series
    - `ts_bucket` number — Timestamp of the data point (bucket start time)
    - `series_0.data` number — Value for the first series
    - `series_1.data` number — Value for the second series
    - `group` string[] — Group by values if groupBy was specified

## Other responses

- `400` — Invalid request parameters
- `403` — Unauthorized
- `404` — Source not found
- `500` — Server error

---

[API](https://skmtc.dev/hyperdxio/apis/hyperdx-external-api.md) · [All operations](https://skmtc.dev/hyperdxio/apis/hyperdx-external-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hyperdxio/hyperdx-external-api/revisions/3399efdca551/schema)
