# Fetch popularity analytics data for a live stream or real-time stream (Available from version 1.11) This operation returns the popularity data for a specific live stream or real-time stream. Popularity data provides insight into how many times your stream is displayed to a possible viewer and how many times it's played. If you don't send from and to query parameters, the last hour's worth of data is returned. Use the include query parameter to specify whether you want to return trend data. See the trend field in the response for information about sample intervals. If the time range between from and to query parameters is: Less than 60 minutes, the cache time between responses is 10 seconds. More than 60 minutes, the cache time between responses is 60 seconds. Endpoint: GET /analytics/popularity/live_streams/{id} Version: v2.0 ## Path parameters: - `id` (string, required) The unique alphanumeric string that identifies the live stream or real-time stream. ## Query parameters: - `from` (string) Use this parameter, along with to, to return historic viewer data. The start of the range of time you want to view. Specify YYYY-DD-MMT HH:MM:SSZ where HH is a 24-hour clock in UTC. The range queried is rounded to the nearest second. If you set the from query parameter without setting the to query parameter, the data returned will reflect 30 days starting at the from date, or data up to to the current day, whichever is shorter. Example: 2023-01-14T10:31:54.486Z - `to` (string) Use this parameter, along with from, to return historic viewer data. The end of the range of time you want to view. Specify YYYY-DD-MMT HH:MM:SSZ where HH is a 24-hour clock in UTC. The range queried is rounded to the nearest second. If you set the to query parameter without setting the from query parameter, the data returned will be from the past 30 days. Example: 2023-02-14T10:31:54.486Z - `include` (string) Specify the data you want returned in the response. he only valid value for this endpoint is trend. Valid value is: trend. Example: trend ## Response 200 fields (application/json): - `live_stream` (object) Example: {"id":"tvctq36g","plays":2,"displays":2,"trend":[{"plays":1,"displays":1,"sampled_at":"2024-03-14T11:31:54.000Z"},{"plays":1,"displays":1,"sampled_at":"2024-03-14T12:31:54.000Z"}]} - `live_stream.id` (string) The unique alphanumeric string that identifies the live stream or real-time stream. Example: "tvctq36g" - `live_stream.plays` (integer) The total number of plays for a live stream or real-time stream. A play is registered when the stream begins to play. Example: 2 - `live_stream.displays` (integer) The total number of displays for a live stream or real-time stream. A display is registered when the player is completely loaded and ready to play the stream. Example: 2 - `live_stream.trend` (object) An array of popularity trend data. The granularity of sampled data changes based on the from and to query values you use: 1. Requests made for data _within_ the most recent 3 days returns sample intervals by the hour. You can return sample intervals by the minute by specifying a specific hour range. 2. Requests made for data _beyond_ the most recent 3 days can only return sample intervals by the hour or day. The minute data is not retained beyond the 3rd day. Note: Data from the most recent hour data might not be included in the result of a time range that extends beyond the most recent 3 days. Default: Last hour Example: [{"plays":1,"displays":1,"sampled_at":"2024-03-14T11:31:54.000Z"},{"plays":1,"displays":1,"sampled_at":"2024-03-14T12:31:54.000Z"}] - `live_stream.trend.plays` (integer) The total number of plays for a stream at the time the trend data was sampled. A play is registered when the stream begins to play. - `live_stream.trend.displays` (integer) The total number of displays for a stream at the time the trend data was sampled. A display is registered when the player is completely loaded and ready to play the stream. - `live_stream.trend.sampled_at` (string) The date and time the trend data was sampled. - `live_stream.limits` (object) The time frame represented in the response. - `live_stream.limits.from` (string) The start of the range of time represented in the response. - `live_stream.limits.to` (string) The end of the range of time represented in the response. ## Response 401 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 403 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 404 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 410 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 422 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array)