> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Mux

> Video hosting and streaming (assets, live streams) and Mux Data playback analytics: views, viewers, startup time, rebuffering and quality metrics.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/mux.svg?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=9f50a11117eacea286ca9467955f481e)

[Web Catalog · Media](https://docs.webrouter.net/data-apis.md?category=media)

Needs&#x20;

`MUX_TOKEN_ID`

,&#x20;

`MUX_TOKEN_SECRET`

Endpoints

7

Auth

HTTP Basic

[Vendor docs](https://www.mux.com/docs/api-reference/)

&#x20;·&#x20;

[Pricing](https://www.mux.com/pricing)

## Setup

| Variable | | What it is |
| - | - | - |
| `MUX_TOKEN_ID` | required | A Mux access token id (Settings > Access Tokens), the Basic auth username. Tokens are per environment. |
| `MUX_TOKEN_SECRET` | required | The access token's secret, the Basic auth password. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* A token is scoped to one Mux environment (development and production differ); a read-only token is enough for every call here.
* Paging is page/limit (limit max 100); only list assets also takes a cursor (next\_cursor, null at the end).
* Rate limits: Video GETs refill 5/s (high-priority token) or 1/s (low); the Data API allows about 5 requests per second. 429 when exceeded; see x-ratelimit-remaining.
* Data API timeframes are epoch seconds or durations like 24:hours; array parameters are sent as repeated name\[] query keys.

## Endpoints

GET

List video assets

Assets with status, duration, playback ids, tracks and creation time.

[Open](#mux-assets-list)

GET

Get a video asset

One asset's status, duration, resolution, playback ids, tracks and errors.

[Open](#mux-assets-get)

GET

List live streams

Live streams with status, stream key and playback ids.

[Open](#mux-live-streams-list)

GET

Get a playback metric's overall value

One metric's value over a timeframe, with total views and watch time.

[Open](#mux-metrics-overall)

GET

Break a playback metric down by dimension

A metric's value per value of a dimension (country, browser, asset\_id, video\_title, cdn, ...).

[Open](#mux-metrics-breakdown)

GET

List video views

Individual playback views with viewer, video, player and error details.

[Open](#mux-views-list)

GET

List data dimensions

The dimensions available for filtering and breakdowns.

[Open](#mux-dimensions-list)

### List video assets

GET

`/video/v1/assets`

`mux.assets.list`

Assets with status, duration, playback ids, tracks and creation time.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Items per page, default 25.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, default 1.
      </td>
    </tr>

    <tr>
      <td>
        `cursor`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        next\_cursor from the previous page.
      </td>
    </tr>

    <tr>
      <td>
        `live_stream_id`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only assets recorded from this live stream.
      </td>
    </tr>

    <tr>
      <td>
        `upload_id`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only the asset from this direct upload.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://www.mux.com/docs/api-reference/video/assets/list-assets)

```python Python theme={null}
router.call_data_api("mux.assets.list")
```

```text MCP theme={null}
call_data_api(endpoint="mux.assets.list")
```

### Get a video asset

GET

`/video/v1/assets/{asset_id}`

`mux.assets.get`

One asset's status, duration, resolution, playback ids, tracks and errors.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `asset_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Asset id.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://www.mux.com/docs/api-reference/video/assets/get-asset)

### List live streams

GET

`/video/v1/live-streams`

`mux.live_streams.list`

Live streams with status, stream key and playback ids.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Items per page, default 25.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, default 1.
      </td>
    </tr>

    <tr>
      <td>
        `stream_key`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only the stream with this key.
      </td>
    </tr>

    <tr><td>`status`</td><td>string</td><td>query</td><td>Status filter. One of `active`, `idle`, `disabled`</td></tr>
  </tbody>
</table>

[Vendor docs](https://www.mux.com/docs/api-reference/video/live-streams/list-live-streams)

```python Python theme={null}
router.call_data_api("mux.live_streams.list")
```

```text MCP theme={null}
call_data_api(endpoint="mux.live_streams.list")
```

### Get a playback metric's overall value

GET

`/data/v1/metrics/{metric_id}/overall`

`mux.metrics.overall`

One metric's value over a timeframe, with total views and watch time.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`metric_id` required</td><td>string</td><td>path</td><td>Metric id, e.g. views, unique\_viewers, playing\_time, video\_startup\_time, rebuffer\_percentage, playback\_failure\_percentage, viewer\_experience\_score. Example `views`</td></tr>
    <tr><td>`timeframe`</td><td>array</td><td>query</td><td>Two epoch-second timestamps, or one duration such as 24:hours or 7:days. Example `["7:days"]`</td></tr>

    <tr>
      <td>
        `filters`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        dimension:value pairs, e.g. country:US; prefix ! to exclude.
      </td>
    </tr>

    <tr>
      <td>
        `metric_filters`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Metric conditions, e.g. aggregate\_startup\_time>=1000.
      </td>
    </tr>

    <tr><td>`measurement`</td><td>string</td><td>query</td><td>Aggregation; each metric has its own default. One of `95th`, `median`, `avg`, `count`, `sum`</td></tr>
  </tbody>
</table>

[Vendor docs](https://www.mux.com/docs/api-reference/data/metrics/get-overall-values) · Same job: [Datadog](https://docs.webrouter.net/data-apis/datadog.md#datadog-metrics-query), [Klaviyo](https://docs.webrouter.net/data-apis/klaviyo.md#klaviyo-metrics-aggregate), [Oh Dear](https://docs.webrouter.net/data-apis/ohdear.md#ohdear-uptime-http-metrics)

```python Python theme={null}
router.call_data_api("mux.metrics.overall", {'metric_id': 'views', 'timeframe': ['7:days']})
```

```text MCP theme={null}
call_data_api(endpoint="mux.metrics.overall", params={"metric_id": "views", "timeframe": ["7:days"]})
```

### Break a playback metric down by dimension

GET

`/data/v1/metrics/{metric_id}/breakdown`

`mux.metrics.breakdown`

A metric's value per value of a dimension (country, browser, asset\_id, video\_title, cdn, ...).

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`metric_id` required</td><td>string</td><td>path</td><td>Metric id, e.g. views, unique\_viewers, playing\_time, video\_startup\_time, rebuffer\_percentage, playback\_failure\_percentage, viewer\_experience\_score. Example `views`</td></tr>
    <tr><td>`group_by`</td><td>string</td><td>query</td><td>Dimension to group by, e.g. country, browser, asset\_id, video\_title, cdn, viewer\_device\_category. Example `country`</td></tr>
    <tr><td>`timeframe`</td><td>array</td><td>query</td><td>Two epoch-second timestamps, or one duration such as 24:hours or 7:days. Example `["7:days"]`</td></tr>

    <tr>
      <td>
        `filters`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        dimension:value pairs, e.g. country:US; prefix ! to exclude.
      </td>
    </tr>

    <tr>
      <td>
        `metric_filters`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Metric conditions, e.g. aggregate\_startup\_time>=1000.
      </td>
    </tr>

    <tr><td>`measurement`</td><td>string</td><td>query</td><td>Aggregation; each metric has its own default. One of `95th`, `median`, `avg`, `count`, `sum`</td></tr>
    <tr><td>`order_by`</td><td>string</td><td>query</td><td>Sort key. One of `negative_impact`, `value`, `views`, `field`</td></tr>

    <tr>
      <td>
        `order_direction`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        &#x20;One of&#x20;

        `asc`

        ,&#x20;

        `desc`
      </td>
    </tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Items per page, default 25.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, default 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://www.mux.com/docs/api-reference/data/metrics/list-breakdown-values) · Same job: [Datadog](https://docs.webrouter.net/data-apis/datadog.md#datadog-metrics-query), [Klaviyo](https://docs.webrouter.net/data-apis/klaviyo.md#klaviyo-metrics-aggregate), [Oh Dear](https://docs.webrouter.net/data-apis/ohdear.md#ohdear-uptime-http-metrics)

```python Python theme={null}
router.call_data_api("mux.metrics.breakdown", {'metric_id': 'views', 'group_by': 'country', 'timeframe': ['7:days']})
```

```text MCP theme={null}
call_data_api(endpoint="mux.metrics.breakdown", params={"metric_id": "views", "group_by": "country", "timeframe": ["7:days"]})
```

### List video views

GET

`/data/v1/video-views`

`mux.views.list`

Individual playback views with viewer, video, player and error details.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `viewer_id`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only this viewer's views.
      </td>
    </tr>

    <tr>
      <td>
        `error_id`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Only views with this error.
      </td>
    </tr>

    <tr>
      <td>
        `order_direction`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        &#x20;One of&#x20;

        `asc`

        ,&#x20;

        `desc`
      </td>
    </tr>

    <tr>
      <td>
        `filters`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        dimension:value pairs, e.g. country:US; prefix ! to exclude.
      </td>
    </tr>

    <tr>
      <td>
        `metric_filters`
      </td>

      <td>
        array
      </td>

      <td>
        query
      </td>

      <td>
        Metric conditions, e.g. aggregate\_startup\_time>=1000.
      </td>
    </tr>

    <tr><td>`timeframe`</td><td>array</td><td>query</td><td>Two epoch-second timestamps, or one duration such as 24:hours or 7:days. Example `["7:days"]`</td></tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Items per page, default 25.
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number, default 1.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://www.mux.com/docs/api-reference/data/video-views/list-video-views) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-events-segmentation), [Mixpanel](https://docs.webrouter.net/data-apis/mixpanel.md#mixpanel-events-counts)

```python Python theme={null}
router.call_data_api("mux.views.list", {'timeframe': ['7:days']})
```

```text MCP theme={null}
call_data_api(endpoint="mux.views.list", params={"timeframe": ["7:days"]})
```

### List data dimensions

GET

`/data/v1/dimensions`

`mux.dimensions.list`

The dimensions available for filtering and breakdowns.

Input

No inputs.

[Vendor docs](https://www.mux.com/docs/api-reference/data/dimensions/list-dimensions) · Same job: [Datadog](https://docs.webrouter.net/data-apis/datadog.md#datadog-metrics-list-active), [Klaviyo](https://docs.webrouter.net/data-apis/klaviyo.md#klaviyo-metrics-list)

```python Python theme={null}
router.call_data_api("mux.dimensions.list")
```

```text MCP theme={null}
call_data_api(endpoint="mux.dimensions.list")
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.