# Subview Metrics

> Data API reference, generated from the OpenAPI spec.

A single video view is made up of one or more subviews — for example, a `rendition` subview tracks a continuous period spent at a specific video quality level, and a `playback_mode` subview tracks a continuous period in a specific playback mode (such as fullscreen or picture-in-picture).

Subview metrics let you measure and filter on this subview-level data directly, rather than relying only on view-level metrics. For example, you can find out how much playing time was spent at 1080p vs. 720p, or broken down further by country.

HTML version: https://www.mux.com/docs/api-reference/data/subview-metrics. Full OpenAPI spec: https://www.mux.com/api-spec.json

Operations on this page:

- Get Subview Overall Values: `GET /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/overall`
- List Subview Breakdown Values: `GET /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/breakdown`
- List Subview Comparison Values: `GET /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/comparison`
- Get Subview Breakdown Timeseries: `GET /data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/breakdown-timeseries`
- List Subview Dimensions: `GET /data/v1/subview-metrics/{SUBVIEW_TYPE}/dimensions`
- List Subview Dimension Values: `GET /data/v1/subview-metrics/{SUBVIEW_TYPE}/dimensions/{DIMENSION_NAME}`

## Get Subview Overall Values

`GET https://api.mux.com/data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/overall`

Returns the total subview metric value across all views matching the given filters and timeframe.

Operation ID: `get-subview-overall-values`. HTML version: https://www.mux.com/docs/api-reference/data/subview-metrics/get-subview-overall-values

### Path parameters

- `METRIC_ID` (string, required): ID of the metric to compute over subviews. Additional metrics may be added over time. Possible values: `"playing_time"`.
- `SUBVIEW_TYPE` (string, required): The subview type to query. Possible values: `"rendition"`, `"playback_mode"`.

### Query parameters

- `timeframe[]` (array of string): Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days`
- `filters[]` (array of string): Filter results using key:value pairs. Must be provided as an array query string parameter. The set of filterable dimensions is distinct from the main Data API's dimensions, and depends on the subview type — see the List Subview Dimensions endpoint for the valid names. * `filters[]=dimension:value` - Include rows where dimension equals value * `filters[]=!dimension:value` - Exclude rows where dimension equals value * `filters[]=dimension:__empty__` - Include rows where the dimension has no value Example: `filters[]=country:US`

### Response `200`

OK

- `data` (object, required)
  - `metric_value` (number, required, format: double)
- `meta` (object, required)
  - `subview_type` (string, required)
  - `metric` (string, required)
  - `unit` (string, required)
- `total_row_count` (integer, required, nullable, format: int64): Always `null` for this endpoint — a single aggregate value has no row count.
- `timeframe` (array of integer, required) Each item: format: int64.

## List Subview Breakdown Values

`GET https://api.mux.com/data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/breakdown`

Returns the metric value broken down by subview attributes, with each row's percentage of the total. By default, groups by all of the subview type's attributes (for example, every rendition attribute for `rendition` subviews) — use `group_by[]` to select a subset.

Operation ID: `list-subview-breakdown-values`. HTML version: https://www.mux.com/docs/api-reference/data/subview-metrics/list-subview-breakdown-values

### Path parameters

- `METRIC_ID` (string, required): ID of the metric to compute over subviews. Additional metrics may be added over time. Possible values: `"playing_time"`.
- `SUBVIEW_TYPE` (string, required): The subview type to query. Possible values: `"rendition"`, `"playback_mode"`.

### Query parameters

- `timeframe[]` (array of string): Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days`
- `filters[]` (array of string): Filter results using key:value pairs. Must be provided as an array query string parameter. The set of filterable dimensions is distinct from the main Data API's dimensions, and depends on the subview type — see the List Subview Dimensions endpoint for the valid names. * `filters[]=dimension:value` - Include rows where dimension equals value * `filters[]=!dimension:value` - Exclude rows where dimension equals value * `filters[]=dimension:__empty__` - Include rows where the dimension has no value Example: `filters[]=country:US`
- `group_by[]` (array of string): Subview attributes to group the results by. Must be provided as an array query string parameter. Currently only supported for the `rendition` subview type, as any combination of the 6 enum values below. If omitted, defaults to grouping by every attribute available for the subview type. Possible values: `"video_source_bitrate"`, `"video_source_width"`, `"video_source_height"`, `"video_source_fps"`, `"video_source_codec"`, `"video_source_rendition_name"`.
- `limit` (integer, format: int32, default: 25, maximum: 100): Number of breakdown rows to include in the response.
- `page` (integer, format: int32, default: 1): Offset by this many pages, of the size of `limit`

### Response `200`

OK

- `data` (array of object, required)
  - `breakdown_value` (string, required)
  - `metric_value` (number, required, format: double)
- `meta` (object, required)
  - `subview_type` (string, required)
  - `metric` (string, required)
  - `unit` (string, required)
  - `group_by` (array of string, required)
- `total_row_count` (integer, required, format: int64)
- `timeframe` (array of integer, required) Each item: format: int64.

## List Subview Comparison Values

`GET https://api.mux.com/data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/comparison`

Returns the metric value broken down by subview attributes, for each of up to 4 selected values of a given dimension. Powers side-by-side comparisons across dimension values (for example, comparing the rendition breakdown for the US vs. India).

Operation ID: `list-subview-comparison-values`. HTML version: https://www.mux.com/docs/api-reference/data/subview-metrics/list-subview-comparison-values

### Path parameters

- `METRIC_ID` (string, required): ID of the metric to compute over subviews. Additional metrics may be added over time. Possible values: `"playing_time"`.
- `SUBVIEW_TYPE` (string, required): The subview type to query. Possible values: `"rendition"`, `"playback_mode"`.

### Query parameters

- `dimension` (string, required): Name of the dimension to compare across. See the List Subview Dimensions endpoint for the valid values for a given subview type.
- `timeframe[]` (array of string): Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days`
- `filters[]` (array of string): Filter results using key:value pairs. Must be provided as an array query string parameter. The set of filterable dimensions is distinct from the main Data API's dimensions, and depends on the subview type — see the List Subview Dimensions endpoint for the valid names. * `filters[]=dimension:value` - Include rows where dimension equals value * `filters[]=!dimension:value` - Exclude rows where dimension equals value * `filters[]=dimension:__empty__` - Include rows where the dimension has no value Example: `filters[]=country:US`
- `values[]` (array of string, required, maxItems: 4): The dimension values to compare, up to 4. Must be provided as an array query string parameter. Use `__empty__` to select subviews where the dimension has no value. Example: `values[]=US&values[]=FR`
- `group_by[]` (array of string): Subview attributes to group the results by. Must be provided as an array query string parameter. Currently only supported for the `rendition` subview type, as any combination of the 6 enum values below. If omitted, defaults to grouping by every attribute available for the subview type. Possible values: `"video_source_bitrate"`, `"video_source_width"`, `"video_source_height"`, `"video_source_fps"`, `"video_source_codec"`, `"video_source_rendition_name"`.
- `breakdown_value_limit` (integer, format: int32, default: 10, maximum: 100): Number of breakdown rows to include per selected dimension value.

### Response `200`

OK

- `data` (array of object, required)
  - `dimension_value` (string, required)
  - `values` (array of object, required)
    - `breakdown_value` (string, required)
    - `metric_value` (number, required, format: double)
- `meta` (object, required)
  - `subview_type` (string, required)
  - `metric` (string, required)
  - `unit` (string, required)
  - `dimension` (string, required)
  - `group_by` (array of string, required)
- `total_row_count` (integer, required, format: int64): Number of dimension-value groups in `data`.
- `timeframe` (array of integer, required) Each item: format: int64.

## Get Subview Breakdown Timeseries

`GET https://api.mux.com/data/v1/subview-metrics/{METRIC_ID}/{SUBVIEW_TYPE}/breakdown-timeseries`

Returns the metric value broken down by subview attributes over time, bucketed by the requested time granularity. Powers stacked bar chart visualizations.

Buckets the data pipeline has not yet finalized are omitted from `data` entirely, rather than zero-filled. Check each entry's `status` and the response's `meta.complete_through` to tell a genuinely-empty bucket apart from one that's still incomplete.

Operation ID: `get-subview-breakdown-timeseries`. HTML version: https://www.mux.com/docs/api-reference/data/subview-metrics/get-subview-breakdown-timeseries

### Path parameters

- `METRIC_ID` (string, required): ID of the metric to compute over subviews. Additional metrics may be added over time. Possible values: `"playing_time"`.
- `SUBVIEW_TYPE` (string, required): The subview type to query. Possible values: `"rendition"`, `"playback_mode"`.

### Query parameters

- `timeframe[]` (array of string): Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days`
- `filters[]` (array of string): Filter results using key:value pairs. Must be provided as an array query string parameter. The set of filterable dimensions is distinct from the main Data API's dimensions, and depends on the subview type — see the List Subview Dimensions endpoint for the valid names. * `filters[]=dimension:value` - Include rows where dimension equals value * `filters[]=!dimension:value` - Exclude rows where dimension equals value * `filters[]=dimension:__empty__` - Include rows where the dimension has no value Example: `filters[]=country:US`
- `group_by[]` (array of string): Subview attributes to group the results by. Must be provided as an array query string parameter. Currently only supported for the `rendition` subview type, as any combination of the 6 enum values below. If omitted, defaults to grouping by every attribute available for the subview type. Possible values: `"video_source_bitrate"`, `"video_source_width"`, `"video_source_height"`, `"video_source_fps"`, `"video_source_codec"`, `"video_source_rendition_name"`.
- `time_granularity` (string, default: "hour"): Time bucket size for the timeseries. Possible values: `"hour"`, `"day"`.
- `breakdown_value_limit` (integer, format: int32, default: 10, maximum: 100): Number of breakdown rows to include per selected dimension value.

### Response `200`

OK

- `data` (array of object, required)
  - `date` (string, required, format: date-time)
  - `status` (string, required) Possible values: `"complete"`, `"partial"`.
  - `values` (array of object, required)
    - `breakdown_value` (string, required)
    - `metric_value` (number, required, format: double)
- `meta` (object, required)
  - `subview_type` (string, required)
  - `metric` (string, required)
  - `unit` (string, required)
  - `group_by` (array of string, required)
  - `time_granularity` (string, required) Possible values: `"hour"`, `"day"`.
  - `complete_through` (string, required, format: date-time)
- `total_row_count` (integer, required, format: int64): Number of time buckets in `data`.
- `timeframe` (array of integer, required) Each item: format: int64.

## List Subview Dimensions

`GET https://api.mux.com/data/v1/subview-metrics/{SUBVIEW_TYPE}/dimensions`

Lists the dimensions available for filtering and breaking down subview metrics for the given subview type. `view` dimensions describe the parent video view; `subview` dimensions are specific to the subview type itself (for example, rendition attributes for `rendition` subviews).

Operation ID: `list-subview-dimensions`. HTML version: https://www.mux.com/docs/api-reference/data/subview-metrics/list-subview-dimensions

### Path parameters

- `SUBVIEW_TYPE` (string, required): The subview type to query. Possible values: `"rendition"`, `"playback_mode"`.

### Response `200`

OK

- `data` (object, required)
  - `view` (array of string, required)
  - `subview` (array of string, required)
- `total_row_count` (integer, required, nullable, format: int64): Always `null` for this endpoint, matching `GET /data/v1/dimensions`, which also never computes a row count.

## List Subview Dimension Values

`GET https://api.mux.com/data/v1/subview-metrics/{SUBVIEW_TYPE}/dimensions/{DIMENSION_NAME}`

Returns the distinct values for a dimension, each annotated with the total playing time across all matching values. Sorted by playing time descending by default.

Operation ID: `list-subview-dimension-values`. HTML version: https://www.mux.com/docs/api-reference/data/subview-metrics/list-subview-dimension-values

### Path parameters

- `SUBVIEW_TYPE` (string, required): The subview type to query. Possible values: `"rendition"`, `"playback_mode"`.
- `DIMENSION_NAME` (string, required): Name of the dimension. See the List Subview Dimensions endpoint for the valid values for a given subview type.

### Query parameters

- `timeframe[]` (array of string): Timeframe window to limit results by. Must be provided as an array query string parameter (e.g. timeframe[]=). Accepted formats are... * array of epoch timestamps e.g. `timeframe[]=1498867200&timeframe[]=1498953600` * duration string e.g. `timeframe[]=24:hours or timeframe[]=7:days`
- `filters[]` (array of string): Filter results using key:value pairs. Must be provided as an array query string parameter. The set of filterable dimensions is distinct from the main Data API's dimensions, and depends on the subview type — see the List Subview Dimensions endpoint for the valid names. * `filters[]=dimension:value` - Include rows where dimension equals value * `filters[]=!dimension:value` - Exclude rows where dimension equals value * `filters[]=dimension:__empty__` - Include rows where the dimension has no value Example: `filters[]=country:US`
- `limit` (integer, format: int32, default: 25, maximum: 250): Number of items to include in the response.
- `page` (integer, format: int32, default: 1): Offset by this many pages, of the size of `limit`
- `order_by` (string, default: "playing_time"): Value to order the results by. Possible values: `"playing_time"`, `"value"`.
- `order_direction` (string): Sort order. Possible values: `"asc"`, `"desc"`.
- `query` (string): Only return dimension values containing this substring.

### Response `200`

OK

- `data` (array of object, required)
  - `value` (string, required)
  - `playing_time` (number, required, format: double)
- `meta` (object, required)
  - `subview_type` (string, required)
  - `metric` (string, required)
  - `unit` (string, required)
  - `dimension_name` (string, required)
- `total_row_count` (integer, required, format: int64)
- `timeframe` (array of integer, required) Each item: format: int64.
