Analytics

Download Spec

Get play events for video

get /analytics/videos/plays

Retrieve filtered analytics about the number of plays for your videos in a project.

HTTP basic apiKey

from

string

date

required

Use this query parameter to set the start date for the time period that you want analytics for.

  • The API returns analytics data including the day you set in from.
  • The date you set must be within the last 30 days.
  • The value you provide must follow the YYYY-MM-DD format.
Example
"2023-06-01"

to

string

date

Use this optional query parameter to set the end date for the time period that you want analytics for.

  • If you do not specify a to date, the API returns analytics data starting from the from date up until today, and excluding today.
  • The date you set must be within the last 30 days.
  • The value you provide must follow the YYYY-MM-DD format.
Example
"2023-06-10"

dimension

string

required

Use this query parameter to define the dimension that you want analytics for.

  • videoId: Returns analytics based on the public video identifiers.
  • emittedAt: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in from and to is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals.
  • country: Returns analytics based on the viewers' country. The list of supported country names are based on the GeoNames public database.
  • deviceType: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: computer, phone, tablet, tv, console, wearable, unknown.
  • operatingSystem: Returns analytics based on the operating system used by the viewers during the play event. Response values include windows, mac osx, android, ios, linux.
  • browser: Returns analytics based on the browser used by the viewers during the play event. Response values include chrome, firefox, edge, opera.
Enum
  • videoId
  • emittedAt
  • country
  • deviceType
  • operatingSystem
  • browser
Example
"browser"

filter

string

Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the videoId: prefix when specifying a video ID.

Example
"videoId:vi3q7HxhApxRF1c8F8r6VeaI"

currentPage

int

Choose the number of search results to return per page. Minimum value: 1

Default
1
Example
2

pageSize

int

Results per page. Allowed values 1-100, default is 25.

Default
25
Example
30

Request

package main

import (
    "context"
    "fmt"
    "os"
    "time"
    apivideosdk "github.com/apivideo/api.video-go-client"
)

func main() {
    client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
    // if you rather like to use the sandbox environment:
    // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_KEY").Build()
    req := apivideosdk.AnalyticsApiGetVideosPlaysRequest{}

    req.From(time.Now()) // string | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    req.Dimension("browser") // string | Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
    req.To(time.Now()) // string | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    req.Filter("videoId:vi3q7HxhApxRF1c8F8r6VeaI") // string | Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID.
    req.CurrentPage(int32(2)) // int32 | Choose the number of search results to return per page. Minimum value: 1 (default to 1)
    req.PageSize(int32(30)) // int32 | Results per page. Allowed values 1-100, default is 25. (default to 25)

    res, err := client.Analytics.GetVideosPlays(req)


    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `Analytics.GetVideosPlays``: %v\n", err)
    }
    // response from `GetVideosPlays`: AnalyticsPlaysResponse
    fmt.Fprintf(os.Stdout, "Response from `Analytics.GetVideosPlays`: %v\n", res)
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/AnalyticsApi.md#getVideosPlays

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const from = "2023-06-01"; // Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
const dimension = "videoId"; // Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
const to = "2023-06-10"; // Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
const filter = "videoId:vi3q7HxhApxRF1c8F8r6VeaI"; // Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID.
const currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1
const pageSize = 25; // Results per page. Allowed values 1-100, default is 25.

const videoPlays = await client.analytics.getVideosPlays({
  from, dimension, to, filter, currentPage, pageSize
});
import apivideo
from apivideo.api import analytics_api
from apivideo.model.analytics_plays_response import AnalyticsPlaysResponse
from apivideo.model.not_found import NotFound
from apivideo.model.analytics_plays400_error import AnalyticsPlays400Error
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
    # Create an instance of the API class
    api_instance = analytics_api.AnalyticsApi(api_client)
    _from = dateutil_parser('2023-06-01').date() # date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    dimension = "browser" # str | Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
    to = dateutil_parser('2023-06-10').date() # date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.  (optional)
    filter = "videoId:vi3q7HxhApxRF1c8F8r6VeaI" # str | Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional)
    current_page = 2 # int | Choose the number of search results to return per page. Minimum value: 1 (optional) if omitted the server will use the default value of 1
    page_size = 30 # int | Results per page. Allowed values 1-100, default is 25. (optional) if omitted the server will use the default value of 25

    # example passing only required values which don't have defaults set
    try:
        # Get play events for video
        api_response = api_instance.get_videos_plays(_from, dimension)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling AnalyticsApi->get_videos_plays: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get play events for video
        api_response = api_instance.get_videos_plays(_from, dimension, to=to, filter=filter, current_page=current_page, page_size=page_size)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling AnalyticsApi->get_videos_plays: %s\n" % e)
// Import classes:
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.AnalyticsApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX);

    AnalyticsApi apiInstance = client.analytics();

    LocalDate from = LocalDate.parse("2023-06-01"); // Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    String dimension = "videoId"; // Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
    LocalDate to = LocalDate.parse("2023-06-10"); // Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    String filter = "videoId:vi3q7HxhApxRF1c8F8r6VeaI"; // Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID.
    Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1
    Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25.

    try {
      Page<AnalyticsData> result = apiInstance.getVideosPlays(from, dimension)
            .to(to)
            .filter(filter)
            .currentPage(currentPage)
            .pageSize(pageSize)
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AnalyticsApi#getVideosPlays");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class getVideosPlaysExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var from = 2023-06-01;  // DateTime | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
            var dimension = browser;  // string | Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
            var to = 2023-06-10;  // DateTime? | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.  (optional) 
            var filter = videoId:vi3q7HxhApxRF1c8F8r6VeaI;  // string | Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional) 
            var currentPage = 2;  // int? | Choose the number of search results to return per page. Minimum value: 1 (optional)  (default to 1)
            var pageSize = 30;  // int? | Results per page. Allowed values 1-100, default is 25. (optional)  (default to 25)
            var apiAnalyticsInstance = apiInstance.Analytics();
            try
            {
                // Get play events for video
                AnalyticsPlaysResponse result = apiAnalyticsInstance.getVideosPlays(from, dimension, to, filter, currentPage, pageSize);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AnalyticsApi.getVideosPlays: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/AnalyticsApi.md#getVideosPlays

require __DIR__ . '/vendor/autoload.php';

$from = new \DateTime("2023-06-01"); // Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
$dimension = "videoId"; // Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.

$plays = $client->analytics()->getVideosPlays($from, $dimension, array(
    'to' => new \DateTime('2023-06-10'), // Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    'filter' => "videoId:vi3q7HxhApxRF1c8F8r6VeaI", // Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID.
    'currentPage' => 2, // Choose the number of search results to return per page. Minimum ->setvalue(1)
    'pageSize' => 30 // Results per page. Allowed values 1-100, default is 25.
)); 
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ApiVideoClient

let from = Date() // Date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
let dimension = "dimension_example" // String | Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
let to = Date() // Date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.  (optional)
let filter = "filter_example" // String | Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional)
let currentPage = 987 // Int | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
let pageSize = 987 // Int | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)

// Get play events for video
AnalyticsAPI.getVideosPlays(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Response

Examples Schema

Success

{
  "data": [
    {
      "value": "vi3q7HxhApxRF1c8F8r6VeaI",
      "plays": 100
    },
    {
      "value": "vi3q7HxhApxRF1c8F8r6VeaF",
      "plays": 10
    },
    {
      "value": "vi3q7HxhApxRF1c8F8r6VeaH",
      "plays": 1
    }
  ],
  "pagination": {
    "currentPage": 1,
    "currentPageItems": 3,
    "pageSize": 25,
    "pagesTotal": 1,
    "itemsTotal": 3,
    "links": [
      {
        "rel": "self",
        "uri": "/analytics/videos/plays?dimension=videoId&currentPage=1&pageSize=25"
      },
      {
        "rel": "first",
        "uri": "/analytics/videos/plays?dimension=videoId&currentPage=1&pageSize=25"
      },
      {
        "rel": "last",
        "uri": "/analytics/videos/plays?dimension=videoId&currentPage=1&pageSize=25"
      }
    ]
  }
}

Breakdown video-plays by videoId for a project.

{
  "data": [
    {
      "value": "france",
      "plays": 100
    },
    {
      "value": "united states",
      "plays": 10
    },
    {
      "value": "spain",
      "plays": 1
    }
  ],
  "pagination": {
    "currentPage": 1,
    "currentPageItems": 2,
    "pageSize": 2,
    "pagesTotal": 2,
    "itemsTotal": 3,
    "links": [
      {
        "rel": "self",
        "uri": "/analytics/videos/plays?dimension=country&currentPage=1&pageSize=2"
      },
      {
        "rel": "first",
        "uri": "/analytics/videos/plays?dimension=country&currentPage=1&pageSize=2"
      },
      {
        "rel": "next",
        "uri": "/analytics/videos/plays?dimension=country&currentPage=2&pageSize=1"
      },
      {
        "rel": "last",
        "uri": "/analytics/videos/plays?dimension=country&currentPage=2&pageSize=1"
      }
    ]
  }
}

Breakdown video-plays by country for a project, with pagination set.

{
  "data": [
    {
      "value": "2023-06-10T10:00:00.000Z",
      "plays": 100
    },
    {
      "value": "2023-06-10T11:00:00.000Z",
      "plays": 10
    },
    {
      "value": "2023-06-10T12:00:00.000Z",
      "plays": 1
    }
  ],
  "pagination": {
    "currentPage": 1,
    "currentPageItems": 3,
    "pageSize": 25,
    "pagesTotal": 1,
    "itemsTotal": 3,
    "links": [
      {
        "rel": "self",
        "uri": "/analytics/videos/plays?dimension=videoId&filter=videoId:vi3VooPMbQLWdPF26qfmNVX6&currentPage=1&pageSize=25"
      },
      {
        "rel": "first",
        "uri": "/analytics/videos/plays?dimension=videoId&filter=videoId:vi3VooPMbQLWdPF26qfmNVX6&currentPage=1&pageSize=25"
      },
      {
        "rel": "last",
        "uri": "/analytics/videos/plays?dimension=videoId&filter=videoId:vi3VooPMbQLWdPF26qfmNVX6&currentPage=1&pageSize=25"
      }
    ]
  }
}

Breakdown video-plays by the time of play events, for a specific video.

Bad request error

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "This value must be of type string.",
  "name": "dimension"
}

This error occurs when a required query-parameter is missing.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must be of the following structure(s): videoId:{videoId}",
  "name": "filter"
}

This error occurs when a required query-parameter format is invalid.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must be part of the following values: emittedAt,videoId,country,deviceType,operatingSystem,browser",
  "name": "dimension"
}

This error occurs when the dimension you requested is not allowed for the endpoint. For example, the dimension videoId is not allowed for the /live-streams endpoint.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must be part of the following values: emittedAt,videoId,country,deviceType,operatingSystem,browser",
  "name": "dimension"
}

This error occurs when the dimension you requested is unknown.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must be of the following structure(s): videoId:{videoId}",
  "name": "filter"
}

This error occurs when the format of the filter you requested is invalid.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must refer to an existing video",
  "name": "filter"
}

This error occurs when the videoId you requested does not refer to an existing video.

Forbidden - Disabled Analytics

{
  "type": "https://docs.api.video/reference/authorization-disabled-analytics",
  "title": "You cannot get analytics from this project.",
  "status": 403
}

Not Found

{
  "type": null,
  "title": null,
  "name": null,
  "status": 404
}

data

array[object (Play event analytics data)]

required

Play event analytics data

object (Play event analytics data)

value

string

required

Shows a value for the property you have specified for dimension in your request. For example, if you requested dimension=videoId, each value field in the response returns a different videoId.

Example
"vi3q7HxhApxRF1c8F8r6VeaI"

plays

int

required

Shows the number of play events for one specific value.

Example
"100"

pagination

object (pagination)

required

Example
{ "itemsTotal": 123, "pagesTotal": 7, "pageSize": 20, "currentPage": 3, "currentPageItems": 20, "links": { "first": { "rel": "first", "uri": "/videos/search?currentPage=1&pageSize=20" }, "previous": { "rel": "previous", "uri": "/videos/search?currentPage=2&pageSize=20" }, "next": { "rel": "next", "uri": "/videos/search?currentPage=4&pageSize=20" }, "last": { "rel": "last", "uri": "/videos/search?currentPage=6&pageSize=20" } } }

itemsTotal

int

Total number of items that exist.

pagesTotal

int

Number of items listed in the current page.

pageSize

int

Maximum number of item per page.

currentPage

int

The current page index.

currentPageItems

int

The number of items on the current page.

links

array[object (PaginationLink)]

required

PaginationLink

object (PaginationLink)

rel

string

uri

string

uri

type

string

A link to the error documentation.

title

string

A description of the error that occurred.

status

int

The HTTP status code.

detail

string

A solution for the error.

name

string

The name of the parameter that caused the error.

type

string

A link to the error documentation.

title

string

A description of the error that occurred.

name

string or null

The name of the parameter that caused the error.

status

int

The HTTP status code.

type

string

title

string

name

string

status

int

Get play events for live stream

get /analytics/live-streams/plays

Retrieve filtered analytics about the number of plays for your live streams in a project.

HTTP basic apiKey

from

string

date

required

Use this query parameter to set the start date for the time period that you want analytics for.

  • The API returns analytics data including the day you set in from.
  • The date you set must be within the last 30 days.
  • The value you provide must follow the YYYY-MM-DD format.
Example
"2023-06-01"

to

string

date

Use this optional query parameter to set the end date for the time period that you want analytics for.

  • If you do not specify a to date, the API returns analytics data starting from the from date up until today, and excluding today.
  • The date you set must be within the last 30 days.
  • The value you provide must follow the YYYY-MM-DD format.
Example
"2023-06-10"

dimension

string

required

Use this query parameter to define the dimension that you want analytics for.

  • liveStreamId: Returns analytics based on the public live stream identifiers.
  • emittedAt: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in from and to is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals.
  • country: Returns analytics based on the viewers' country. The list of supported country names are based on the GeoNames public database.
  • deviceType: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: computer, phone, tablet, tv, console, wearable, unknown.
  • operatingSystem: Returns analytics based on the operating system used by the viewers during the play event. Response values include windows, mac osx, android, ios, linux.
  • browser: Returns analytics based on the browser used by the viewers during the play event. Response values include chrome, firefox, edge, opera.
Enum
  • liveStreamId
  • emittedAt
  • country
  • deviceType
  • operatingSystem
  • browser
Example
"browser"

filter

string

Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the liveStreamId: prefix when specifying a live stream ID.

Example
"liveStreamId:li3q7HxhApxRF1c8F8r6VeaI"

currentPage

int

Choose the number of search results to return per page. Minimum value: 1

Default
1
Example
2

pageSize

int

Results per page. Allowed values 1-100, default is 25.

Default
25
Example
30

Request

package main

import (
    "context"
    "fmt"
    "os"
    "time"
    apivideosdk "github.com/apivideo/api.video-go-client"
)

func main() {
    client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
    // if you rather like to use the sandbox environment:
    // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_KEY").Build()
    req := apivideosdk.AnalyticsApiGetLiveStreamsPlaysRequest{}

    req.From(time.Now()) // string | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    req.Dimension("browser") // string | Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
    req.To(time.Now()) // string | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    req.Filter("liveStreamId:li3q7HxhApxRF1c8F8r6VeaI") // string | Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID.
    req.CurrentPage(int32(2)) // int32 | Choose the number of search results to return per page. Minimum value: 1 (default to 1)
    req.PageSize(int32(30)) // int32 | Results per page. Allowed values 1-100, default is 25. (default to 25)

    res, err := client.Analytics.GetLiveStreamsPlays(req)


    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `Analytics.GetLiveStreamsPlays``: %v\n", err)
    }
    // response from `GetLiveStreamsPlays`: AnalyticsPlaysResponse
    fmt.Fprintf(os.Stdout, "Response from `Analytics.GetLiveStreamsPlays`: %v\n", res)
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/AnalyticsApi.md#getLiveStreamsPlays

const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const from = "2023-06-01"; // Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
const dimension = "liveStreamId"; // Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
const to = "2023-06-10"; // Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
const filter = "liveStreamId:li3q7HxhApxRF1c8F8r6VeaI"; // Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID.
const currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1
const pageSize = 25; // Results per page. Allowed values 1-100, default is 25.

const liveStreamsPlays = await client.analytics.getLiveStreamsPlays({
  from, dimension, to, filter, currentPage, pageSize
});
import apivideo
from apivideo.api import analytics_api
from apivideo.model.analytics_plays_response import AnalyticsPlaysResponse
from apivideo.model.not_found import NotFound
from apivideo.model.analytics_plays400_error import AnalyticsPlays400Error
from pprint import pprint

# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
    # Create an instance of the API class
    api_instance = analytics_api.AnalyticsApi(api_client)
    _from = dateutil_parser('2023-06-01').date() # date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    dimension = "browser" # str | Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
    to = dateutil_parser('2023-06-10').date() # date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.  (optional)
    filter = "liveStreamId:li3q7HxhApxRF1c8F8r6VeaI" # str | Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional)
    current_page = 2 # int | Choose the number of search results to return per page. Minimum value: 1 (optional) if omitted the server will use the default value of 1
    page_size = 30 # int | Results per page. Allowed values 1-100, default is 25. (optional) if omitted the server will use the default value of 25

    # example passing only required values which don't have defaults set
    try:
        # Get play events for live stream
        api_response = api_instance.get_live_streams_plays(_from, dimension)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling AnalyticsApi->get_live_streams_plays: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get play events for live stream
        api_response = api_instance.get_live_streams_plays(_from, dimension, to=to, filter=filter, current_page=current_page, page_size=page_size)
        pprint(api_response)
    except apivideo.ApiException as e:
        print("Exception when calling AnalyticsApi->get_live_streams_plays: %s\n" % e)
// Import classes:
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.AnalyticsApi;
import java.util.*;

public class Example {
  public static void main(String[] args) {
    ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
    // if you rather like to use the sandbox environment:
    // ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", Environment.SANDBOX);

    AnalyticsApi apiInstance = client.analytics();

    LocalDate from = LocalDate.parse("2023-06-01"); // Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    String dimension = "liveStreamId"; // Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
    LocalDate to = LocalDate.parse("2023-06-10"); // Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    String filter = "liveStreamId:li3q7HxhApxRF1c8F8r6VeaI"; // Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID.
    Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1
    Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25.

    try {
      Page<AnalyticsData> result = apiInstance.getLiveStreamsPlays(from, dimension)
            .to(to)
            .filter(filter)
            .currentPage(currentPage)
            .pageSize(pageSize)
            .execute();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling AnalyticsApi#getLiveStreamsPlays");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getMessage());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class getLiveStreamsPlaysExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var from = 2023-06-01;  // DateTime | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
            var dimension = browser;  // string | Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
            var to = 2023-06-10;  // DateTime? | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.  (optional) 
            var filter = liveStreamId:li3q7HxhApxRF1c8F8r6VeaI;  // string | Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional) 
            var currentPage = 2;  // int? | Choose the number of search results to return per page. Minimum value: 1 (optional)  (default to 1)
            var pageSize = 30;  // int? | Results per page. Allowed values 1-100, default is 25. (optional)  (default to 25)
            var apiAnalyticsInstance = apiInstance.Analytics();
            try
            {
                // Get play events for live stream
                AnalyticsPlaysResponse result = apiAnalyticsInstance.getLiveStreamsPlays(from, dimension, to, filter, currentPage, pageSize);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AnalyticsApi.getLiveStreamsPlays: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/AnalyticsApi.md#getLiveStreamsPlays

require __DIR__ . '/vendor/autoload.php';

$from = new \DateTime("2023-06-01"); // Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
$dimension = "liveStreamId"; // Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.

$plays = $client->analytics()->getLiveStreamsPlays($from, $dimension, array(
    'to' => new \DateTime('2023-06-10'), // Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
    'filter' => "liveStreamId:li3q7HxhApxRF1c8F8r6VeaI", // Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID.
    'currentPage' => 2, // Choose the number of search results to return per page. Minimum value: 1
    'pageSize' => 30 // Results per page. Allowed values 1-100, default is 25.
));
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ApiVideoClient

let from = Date() // Date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. 
let dimension = "dimension_example" // String | Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. - `browser`: Returns analytics based on the browser used by the viewers during the play event.
let to = Date() // Date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.  (optional)
let filter = "filter_example" // String | Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional)
let currentPage = 987 // Int | Choose the number of search results to return per page. Minimum value: 1 (optional) (default to 1)
let pageSize = 987 // Int | Results per page. Allowed values 1-100, default is 25. (optional) (default to 25)

// Get play events for live stream
AnalyticsAPI.getLiveStreamsPlays(from: from, dimension: dimension, to: to, filter: filter, currentPage: currentPage, pageSize: pageSize) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Response

Examples Schema

Success

{
  "data": [
    {
      "value": "li3q7HxhApxRF1c8F8r6VeaI",
      "plays": 100
    },
    {
      "value": "li3q7HxhApxRF1c8F8r6VeaB",
      "plays": 10
    },
    {
      "value": "li3q7HxhApxRF1c8F8r6VeaD",
      "plays": 1
    }
  ],
  "pagination": {
    "currentPage": 1,
    "currentPageItems": 2,
    "pageSize": 2,
    "pagesTotal": 2,
    "itemsTotal": 3,
    "links": [
      {
        "rel": "self",
        "uri": "/analytics/live-streams/plays?dimension=liveStreamId&currentPage=1&pageSize=2"
      },
      {
        "rel": "first",
        "uri": "/analytics/live-streams/plays?dimension=liveStreamId&currentPage=2&pageSize=1"
      },
      {
        "rel": "last",
        "uri": "/analytics/live-streams/plays?dimension=liveStreamId&currentPage=2&pageSize=1"
      }
    ]
  }
}

Breakdown video-plays by liveStreamId for a project.

{
  "data": [
    {
      "value": "france",
      "plays": 100
    },
    {
      "value": "united states",
      "plays": 10
    },
    {
      "value": "spain",
      "plays": 1
    }
  ],
  "pagination": {
    "currentPage": 1,
    "currentPageItems": 2,
    "pageSize": 2,
    "pagesTotal": 2,
    "itemsTotal": 3,
    "links": [
      {
        "rel": "self",
        "uri": "/analytics/live-streams/plays?dimension=country&currentPage=1&pageSize=2"
      },
      {
        "rel": "first",
        "uri": "/analytics/live-streams/plays?dimension=country&currentPage=1&pageSize=2"
      },
      {
        "rel": "last",
        "uri": "/analytics/live-streams/plays?dimension=country&currentPage=2&pageSize=1"
      }
    ]
  }
}

Breakdown video-plays by country for a project, with pagination.

{
  "data": [
    {
      "value": "2023-06-10T10:00:00.000Z",
      "plays": 100
    },
    {
      "value": "2023-06-10T11:00:00.000Z",
      "plays": 10
    },
    {
      "value": "2023-06-10T12:00:00.000Z",
      "plays": 1
    }
  ],
  "pagination": {
    "currentPage": 1,
    "currentPageItems": 3,
    "pageSize": 25,
    "pagesTotal": 1,
    "itemsTotal": 3,
    "links": [
      {
        "rel": "self",
        "uri": "/analytics/live-streams/plays?dimension=videoId&filter=liveStreamId:li3VooPMbQLWdPF26qfmNVX6&currentPage=1&pageSize=25"
      },
      {
        "rel": "first",
        "uri": "/analytics/live-streams/plays?dimension=videoId&filter=liveStreamId:li3VooPMbQLWdPF26qfmNVX6&currentPage=1&pageSize=25"
      },
      {
        "rel": "last",
        "uri": "/analytics/live-streams/plays?dimension=videoId&filter=liveStreamId:li3VooPMbQLWdPF26qfmNVX6&currentPage=1&pageSize=25"
      }
    ]
  }
}

Breakdown video-plays by the time of play events, for a specific live stream.

Bad request error

{
  "type": "https://docs.api.video/reference/invalid-attribute",
  "title": "An attribute is invalid.",
  "status": 400,
  "detail": "This value must be of type string.",
  "name": "dimension"
}

This error occurs when a required query-parameter is missing.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must be of the following structure(s): liveStreamId:{liveStreamId}",
  "name": "filter"
}

This error occurs when a required query-parameter format is invalid.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must be part of the following values: emittedAt,liveStreamId,country,deviceType,operatingSystem,browser",
  "name": "dimension"
}

This error occurs when the dimension you requested is not allowed for the endpoint. For example, the dimension videoId is not allowed for the /live-streams endpoint.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must be part of the following values: emittedAt,liveStreamId,country,deviceType,operatingSystem,browser",
  "name": "dimension"
}

This error occurs when the dimension you requested is unknown.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must be of the following structure(s): liveStreamId:{liveStreamId}",
  "name": "filter"
}

This error occurs when the format of the filter you requested is invalid.

{
  "type": "https://docs.api.video/reference/request-invalid-query-parameter",
  "title": "A query parameter is invalid.",
  "status": 400,
  "detail": "This value must refer to an existing live stream",
  "name": "filter"
}

This error occurs when the liveStreamId you requested does not refer to an existing live stream.

Forbidden - Disabled Analytics

{
  "type": "https://docs.api.video/reference/authorization-disabled-analytics",
  "title": "You cannot get analytics from this project.",
  "status": 403
}

Not Found

{
  "type": null,
  "title": null,
  "name": null,
  "status": 404
}

data

array[object (Play event analytics data)]

required

Play event analytics data

object (Play event analytics data)

value

string

required

Shows a value for the property you have specified for dimension in your request. For example, if you requested dimension=videoId, each value field in the response returns a different videoId.

Example
"vi3q7HxhApxRF1c8F8r6VeaI"

plays

int

required

Shows the number of play events for one specific value.

Example
"100"

pagination

object (pagination)

required

Example
{ "itemsTotal": 123, "pagesTotal": 7, "pageSize": 20, "currentPage": 3, "currentPageItems": 20, "links": { "first": { "rel": "first", "uri": "/videos/search?currentPage=1&pageSize=20" }, "previous": { "rel": "previous", "uri": "/videos/search?currentPage=2&pageSize=20" }, "next": { "rel": "next", "uri": "/videos/search?currentPage=4&pageSize=20" }, "last": { "rel": "last", "uri": "/videos/search?currentPage=6&pageSize=20" } } }

itemsTotal

int

Total number of items that exist.

pagesTotal

int

Number of items listed in the current page.

pageSize

int

Maximum number of item per page.

currentPage

int

The current page index.

currentPageItems

int

The number of items on the current page.

links

array[object (PaginationLink)]

required

PaginationLink

object (PaginationLink)

rel

string

uri

string

uri

type

string

A link to the error documentation.

title

string

A description of the error that occurred.

status

int

The HTTP status code.

detail

string

A solution for the error.

name

string

The name of the parameter that caused the error.

type

string

A link to the error documentation.

title

string

A description of the error that occurred.

name

string or null

The name of the parameter that caused the error.

status

int

The HTTP status code.

type

string

title

string

name

string

status

int

Was this page helpful?