---
title: "Fetch viewer analytics data for a live stream"
method: GET
path: "/analytics/viewers/live_streams/{id}"
tags: ["analytics_viewers"]
---

# Fetch viewer analytics data for a live stream

`GET /analytics/viewers/live_streams/{id}`

(Available from version 1.11) This operation returns the live and historic viewer data for a specific live stream. You'll use the query parameters to return live vs historic data, as well as specific types of viewer data.

**Querying live data**

1. To get data for currently live streams, do not send **from** and **to** values.

2. Use the **include** query parameter to specify what data you want to return, including: countries, renditions, devices, and trend data. 

If you don't send any query parameters (to, from, or include), the total number of viewers is returned.

**Querying historic data**

1. To get data for streams that ran previously, send **from** and **to** values.

2. Use the **include** query parameter to specify what data you want to return, including: countries, renditions, devices, and trend data. 


If you don't send **include** values, the total number of viewers is returned.


If the time range between **from** and **to** query parameters is:
    
<ul><li>Less than 60 minutes, the cache time between responses is 10 seconds.</li> <li>More than 60 minutes, the cache time between responses is 60 seconds.</li>

## Path parameters

- `id` string, required

## Query parameters

- `from` string, date-time
- `to` string, date-time
- `include` string
- `time_zone` string

## Response `200`

Success

- AnalyticsViewersLiveStream
  - `live_stream` object
    - `id` string, int32 — The unique alphanumeric string that identifies the live stream.
    - `viewers` integer — The total number of unique viewers to download at least one chunk of the stream. A unique viewer is a single IP address; multiple users that share the same IP address are counted once.
    - `countries` object — An array of viewer countries.
      - `code` string — A country code where the stream was requested.
      - `viewers` integer — The total number of unique viewers to download at least one chunk of the stream. A unique viewer is a single IP address; multiple users that share the same IP address are counted once.
    - `renditions` object — An array of viewer renditions.
      - `name` integer — The rendition of the stream played. A rendition name is the smaller number of the resolution. The resolution is [width]x[height] in which the stream was played. Renditions names have to be unique. If you've created two renditions that have the same height and width, Wowza Video increments the value of the height and uses that as the rendition name. Example: Two renditions of 1280x720 will result in rendition names of 720 and 721.
      - `viewers` integer — The total number of unique viewers to download at least one chunk of the stream. A unique viewer is a single IP address; multiple users that share the same IP address are counted once.
    - `devices` object — An array of viewer devices.
      - `name` string — A device where the stream was played.
      - `viewers` integer — The total number of unique viewers to download at least one chunk of the stream. A unique viewer is a single IP address; multiple users that share the same IP address are counted once.
    - `trend` object — An array of viewer trend data. The granularity of sampled data changes based on the from and to query values you use: <ul><li>0 minutes to 8 hours - Samples returned per minute</li> <li>8 hours, 1 second to 24 hours - Samples returned per hour</li> <li>24 hours, 1 second to 175 days - Samples returned per day</li> <li>175 days to 14 years - Samples returned per month</li> <li>14 years or greater - Samples returned per year</li></ul> <strong>Defaults</strong>: from = last billing date, to = end of current day
      - `sampled_at` string, date-time — The date and time the trend data was sampled.
      - `viewers` integer — The total number of unique viewers to download at least one chunk of the stream. A unique viewer is a single IP address; multiple users that share the same IP address are counted once.
    - `time_zone` string — The time zone in which the data is returned. The default time zone in which the data is returned is **Etc/UTC**.
    - `limits` object — The time frame represented in the response.
      - `from` string, date-time — The start of the range of time represented in the response.
      - `to` string, date-time — The end of the range of time represented in the response.

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `410` — Gone
- `422` — Unprocessable Entity

---

[API](https://skmtc.net/wowza/apis/wowza-video-rest-api-reference-documentation.md) · [All operations](https://skmtc.net/wowza/apis/wowza-video-rest-api-reference-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wowza/wowza-video-rest-api-reference-documentation/versions/157b6f741f2a/schema)
