From b67aa892d219b9520f6a9739de86b37866aa2879 Mon Sep 17 00:00:00 2001 From: olivierapivideo Date: Mon, 4 Nov 2024 08:01:34 +0000 Subject: [PATCH] Analytics updates --- CHANGELOG.md | 3 + apivideo/__init__.py | 2 +- apivideo/api/analytics_api.py | 100 +++++++++++++++--- apivideo/api_client.py | 2 +- apivideo/configuration.py | 2 +- ...ics_aggregated_metrics_response_context.py | 13 ++- ...tics_metrics_breakdown_response_context.py | 15 ++- .../analytics_metrics_over_time_response.py | 2 +- ...tics_metrics_over_time_response_context.py | 16 ++- apivideo/model/filter_by.py | 3 + apivideo/model/filter_by1.py | 3 + apivideo/model/filter_by2.py | 3 + ...alyticsAggregatedMetricsResponseContext.md | 2 +- docs/AnalyticsApi.md | 57 ++++++---- ...nalyticsMetricsBreakdownResponseContext.md | 2 +- docs/AnalyticsMetricsOverTimeResponse.md | 2 +- ...AnalyticsMetricsOverTimeResponseContext.md | 2 +- docs/FilterBy.md | 1 + docs/FilterBy1.md | 1 + docs/FilterBy2.md | 1 + setup.py | 2 +- .../responses/400-2.json | 7 ++ .../responses/400-3.json | 7 ++ .../responses/400-2.json | 7 ++ .../responses/400-3.json | 7 ++ .../responses/400-2.json | 7 ++ .../responses/400-3.json | 7 ++ .../responses/400-4.json | 7 ++ .../responses/400-5.json | 7 ++ 29 files changed, 243 insertions(+), 47 deletions(-) create mode 100644 test/payloads/analytics/get_aggregated_metrics/responses/400-2.json create mode 100644 test/payloads/analytics/get_aggregated_metrics/responses/400-3.json create mode 100644 test/payloads/analytics/get_metrics_breakdown/responses/400-2.json create mode 100644 test/payloads/analytics/get_metrics_breakdown/responses/400-3.json create mode 100644 test/payloads/analytics/get_metrics_over_time/responses/400-2.json create mode 100644 test/payloads/analytics/get_metrics_over_time/responses/400-3.json create mode 100644 test/payloads/analytics/get_metrics_over_time/responses/400-4.json create mode 100644 test/payloads/analytics/get_metrics_over_time/responses/400-5.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f93468..6ef07c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All changes to this project will be documented in this file. +## [1.4.6] - 2024-11-04 +- Analytics updates (ccv, views, ...) + ## [1.4.5] - 2024-10-21 - Add summary feature diff --git a/apivideo/__init__.py b/apivideo/__init__.py index 7e70ea4..580774a 100644 --- a/apivideo/__init__.py +++ b/apivideo/__init__.py @@ -9,7 +9,7 @@ """ -__version__ = "1.4.5" +__version__ = "1.4.6" # import ApiVideoClient from apivideo.auth_api_client import AuthenticatedApiClient diff --git a/apivideo/api/analytics_api.py b/apivideo/api/analytics_api.py index 33e9cae..96c1707 100644 --- a/apivideo/api/analytics_api.py +++ b/apivideo/api/analytics_api.py @@ -52,13 +52,15 @@ def get_aggregated_metrics( >>> result = thread.get() Args: - metric (str): Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - aggregation (str): Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. + metric (str): Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `ccv`: is the number of concurrent viewers, or users watching at the same time. - `view`: the total number of viewers until this point in time. + aggregation (str): Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `peak` shows the highest value of the `ccv` metric in the timeframe of your request. You can use this aggregation only with the `ccv` metric. - `live` shows the highest value of the `ccv` metric from the last 20 seconds. You can use this aggregation only with the `ccv` metric. Keyword Args: _from (datetime): Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. . [optional] to (datetime): Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. . [optional] - filter_by (FilterBy2): Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). . [optional] + unique (bool): Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. . [optional] + view_duration (str): Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. . [optional] + filter_by (FilterBy2): Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. . [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -98,6 +100,8 @@ def get_aggregated_metrics( 'aggregation', '_from', 'to', + 'unique', + 'view_duration', 'filter_by', 'async_req', '_preload_content', @@ -114,6 +118,7 @@ def get_aggregated_metrics( 'enum': [ 'metric', 'aggregation', + 'view_duration', ], 'validation': [ ] @@ -128,7 +133,9 @@ def get_aggregated_metrics( "END": "end", "IMPRESSION": "impression", "IMPRESSION-TIME": "impression-time", - "WATCH-TIME": "watch-time" + "WATCH-TIME": "watch-time", + "CCV": "ccv", + "VIEW": "view" }, ('aggregation',): { @@ -136,7 +143,16 @@ def get_aggregated_metrics( "RATE": "rate", "TOTAL": "total", "AVERAGE": "average", - "SUM": "sum" + "SUM": "sum", + "PEAK": "peak", + "LIVE": "live" + }, + ('view_duration',): { + + "3S": "3s", + "5S": "5s", + "10S": "10s", + "30S": "30s" }, } openapi_types = { @@ -148,6 +164,10 @@ def get_aggregated_metrics( (datetime,), 'to': (datetime,), + 'unique': + (bool,), + 'view_duration': + (str,), 'filter_by': (FilterBy2,), 'async_req': (bool,), @@ -160,6 +180,8 @@ def get_aggregated_metrics( 'aggregation': 'aggregation', '_from': 'from', 'to': 'to', + 'unique': 'unique', + 'view_duration': 'viewDuration', 'filter_by': 'filterBy', } location_map = { @@ -167,6 +189,8 @@ def get_aggregated_metrics( 'aggregation': 'path', '_from': 'query', 'to': 'query', + 'unique': 'query', + 'view_duration': 'query', 'filter_by': 'query', } collection_format_map = { @@ -228,15 +252,17 @@ def get_metrics_breakdown( >>> result = thread.get() Args: - metric (str): Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - breakdown (str): Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. + metric (str): Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers until this point in time. + breakdown (str): Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `referrer`: Returns the URL where the view originates from, for example a website where the video is embedded. View events from Android and iOS return empty strings as referrer. Keyword Args: _from (datetime): Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` . [optional] to (datetime): Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. . [optional] sort_by (str): Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `dimensionValue`: Sorts the results based on the **dimension** you selected in your request. . [optional] sort_order (str): Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. . [optional] - filter_by (FilterBy2): Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). . [optional] + unique (bool): Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. . [optional] + view_duration (str): Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. . [optional] + filter_by (FilterBy2): Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. . [optional] current_page (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 (int): Results per page. Allowed values 1-100, default is 25.. [optional] if omitted the server will use the default value of 25 _return_http_data_only (bool): response data without head status @@ -280,6 +306,8 @@ def get_metrics_breakdown( 'to', 'sort_by', 'sort_order', + 'unique', + 'view_duration', 'filter_by', 'current_page', 'page_size', @@ -300,6 +328,7 @@ def get_metrics_breakdown( 'breakdown', 'sort_by', 'sort_order', + 'view_duration', ], 'validation': [ ] @@ -314,7 +343,10 @@ def get_metrics_breakdown( "PLAY-TOTAL": "play-total", "START": "start", "END": "end", - "IMPRESSION": "impression" + "IMPRESSION": "impression", + "CCV-PEAK": "ccv-peak", + "CCV-AVERAGE": "ccv-average", + "VIEW": "view" }, ('breakdown',): { @@ -324,7 +356,8 @@ def get_metrics_breakdown( "COUNTRY": "country", "DEVICE-TYPE": "device-type", "OPERATING-SYSTEM": "operating-system", - "BROWSER": "browser" + "BROWSER": "browser", + "REFERRER": "referrer" }, ('sort_by',): { @@ -336,6 +369,13 @@ def get_metrics_breakdown( "ASC": "asc", "DESC": "desc" }, + ('view_duration',): { + + "3S": "3s", + "5S": "5s", + "10S": "10s", + "30S": "30s" + }, } openapi_types = { 'metric': @@ -350,6 +390,10 @@ def get_metrics_breakdown( (str,), 'sort_order': (str,), + 'unique': + (bool,), + 'view_duration': + (str,), 'filter_by': (FilterBy2,), 'current_page': @@ -368,6 +412,8 @@ def get_metrics_breakdown( 'to': 'to', 'sort_by': 'sortBy', 'sort_order': 'sortOrder', + 'unique': 'unique', + 'view_duration': 'viewDuration', 'filter_by': 'filterBy', 'current_page': 'currentPage', 'page_size': 'pageSize', @@ -379,6 +425,8 @@ def get_metrics_breakdown( 'to': 'query', 'sort_by': 'query', 'sort_order': 'query', + 'unique': 'query', + 'view_duration': 'query', 'filter_by': 'query', 'current_page': 'query', 'page_size': 'query', @@ -441,15 +489,17 @@ def get_metrics_over_time( >>> result = thread.get() Args: - metric (str): Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. + metric (str): Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers. Keyword Args: _from (datetime): Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` . [optional] to (datetime): Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. . [optional] - interval (str): Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. . [optional] + interval (str): Use this query parameter to define the granularity of the data. Possible values: `minute`, `hour`, `day`. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. - When you set `minute` as interval, the timeframe you define with the `from` and `to` parameters should be less than 60 minutes. . [optional] sort_by (str): Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `emittedAt`: Sorts the results based on the **timestamp** of the event in ATOM date-time format. . [optional] sort_order (str): Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. . [optional] - filter_by (FilterBy2): Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). . [optional] + unique (bool): Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. . [optional] + view_duration (str): Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. . [optional] + filter_by (FilterBy2): Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. . [optional] current_page (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 (int): Results per page. Allowed values 1-100, default is 25.. [optional] if omitted the server will use the default value of 25 _return_http_data_only (bool): response data without head status @@ -491,6 +541,8 @@ def get_metrics_over_time( 'interval', 'sort_by', 'sort_order', + 'unique', + 'view_duration', 'filter_by', 'current_page', 'page_size', @@ -510,6 +562,7 @@ def get_metrics_over_time( 'interval', 'sort_by', 'sort_order', + 'view_duration', ], 'validation': [ ] @@ -523,10 +576,14 @@ def get_metrics_over_time( "PLAY-RATE": "play-rate", "START": "start", "END": "end", - "IMPRESSION": "impression" + "IMPRESSION": "impression", + "CCV-PEAK": "ccv-peak", + "CCV-AVERAGE": "ccv-average", + "VIEW": "view" }, ('interval',): { + "MINUTE": "minute", "HOUR": "hour", "DAY": "day" }, @@ -540,6 +597,13 @@ def get_metrics_over_time( "ASC": "asc", "DESC": "desc" }, + ('view_duration',): { + + "3S": "3s", + "5S": "5s", + "10S": "10s", + "30S": "30s" + }, } openapi_types = { 'metric': @@ -554,6 +618,10 @@ def get_metrics_over_time( (str,), 'sort_order': (str,), + 'unique': + (bool,), + 'view_duration': + (str,), 'filter_by': (FilterBy2,), 'current_page': @@ -572,6 +640,8 @@ def get_metrics_over_time( 'interval': 'interval', 'sort_by': 'sortBy', 'sort_order': 'sortOrder', + 'unique': 'unique', + 'view_duration': 'viewDuration', 'filter_by': 'filterBy', 'current_page': 'currentPage', 'page_size': 'pageSize', @@ -583,6 +653,8 @@ def get_metrics_over_time( 'interval': 'query', 'sort_by': 'query', 'sort_order': 'query', + 'unique': 'query', + 'view_duration': 'query', 'filter_by': 'query', 'current_page': 'query', 'page_size': 'query', diff --git a/apivideo/api_client.py b/apivideo/api_client.py index 7ad50cb..8b3d001 100644 --- a/apivideo/api_client.py +++ b/apivideo/api_client.py @@ -75,7 +75,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie - self.default_headers['AV-Origin-Client'] = "python:1.4.5" + self.default_headers['AV-Origin-Client'] = "python:1.4.6" def __enter__(self): return self diff --git a/apivideo/configuration.py b/apivideo/configuration.py index bd85c32..a1e0abe 100644 --- a/apivideo/configuration.py +++ b/apivideo/configuration.py @@ -391,7 +391,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1\n"\ - "SDK Package Version: 1.4.5".\ + "SDK Package Version: 1.4.6".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/apivideo/model/analytics_aggregated_metrics_response_context.py b/apivideo/model/analytics_aggregated_metrics_response_context.py index 38e41e8..ca83d35 100644 --- a/apivideo/model/analytics_aggregated_metrics_response_context.py +++ b/apivideo/model/analytics_aggregated_metrics_response_context.py @@ -62,6 +62,17 @@ class AnalyticsAggregatedMetricsResponseContext(ModelNormal): 'IMPRESSION': "impression", 'IMPRESSION-TIME': "impression-time", 'WATCH-TIME': "watch-time", + 'CCV': "ccv", + 'UNIQUE-CCV': "unique-ccv", + 'VIEW-3': "view-3", + 'VIEW-5': "view-5", + 'VIEW-10': "view-10", + 'VIEW-30': "view-30", + 'UNIQUE-VIEW': "unique-view", + 'UNIQUE-VIEW-3': "unique-view-3", + 'UNIQUE-VIEW-5': "unique-view-5", + 'UNIQUE-VIEW-10': "unique-view-10", + 'UNIQUE-VIEW-30': "unique-view-30", }, ('aggregation',): { 'COUNT': "count", @@ -153,7 +164,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - metric (str): Returns the metric you selected.. [optional] # noqa: E501 + metric (str): Returns the metric and relevant parameters you selected.. [optional] # noqa: E501 aggregation (str): Returns the aggregation you selected.. [optional] # noqa: E501 timeframe (AnalyticsAggregatedMetricsResponseContextTimeframe): [optional] # noqa: E501 """ diff --git a/apivideo/model/analytics_metrics_breakdown_response_context.py b/apivideo/model/analytics_metrics_breakdown_response_context.py index 9e0954f..f0ab95e 100644 --- a/apivideo/model/analytics_metrics_breakdown_response_context.py +++ b/apivideo/model/analytics_metrics_breakdown_response_context.py @@ -61,6 +61,19 @@ class AnalyticsMetricsBreakdownResponseContext(ModelNormal): 'START': "start", 'END': "end", 'IMPRESSION': "impression", + 'CCV-AVERAGE': "ccv-average", + 'CCV-PEAK': "ccv-peak", + 'UNIQUE-CCV-AVERAGE': "unique-ccv-average", + 'UNIQUE-CCV-PEAK': "unique-ccv-peak", + 'VIEW-3': "view-3", + 'VIEW-5': "view-5", + 'VIEW-10': "view-10", + 'VIEW-30': "view-30", + 'UNIQUE-VIEW': "unique-view", + 'UNIQUE-VIEW-3': "unique-view-3", + 'UNIQUE-VIEW-5': "unique-view-5", + 'UNIQUE-VIEW-10': "unique-view-10", + 'UNIQUE-VIEW-30': "unique-view-30", }, ('breakdown',): { 'MEDIA-ID': "media-id", @@ -154,7 +167,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - metric (str): Returns the metric you selected.. [optional] # noqa: E501 + metric (str): Returns the metric and relevant parameters you selected.. [optional] # noqa: E501 breakdown (str): Returns the dimension you selected.. [optional] # noqa: E501 timeframe (AnalyticsAggregatedMetricsResponseContextTimeframe): [optional] # noqa: E501 """ diff --git a/apivideo/model/analytics_metrics_over_time_response.py b/apivideo/model/analytics_metrics_over_time_response.py index a0c504f..2f434e2 100644 --- a/apivideo/model/analytics_metrics_over_time_response.py +++ b/apivideo/model/analytics_metrics_over_time_response.py @@ -113,7 +113,7 @@ def __init__(self, context, data, pagination, *args, **kwargs): # noqa: E501 Args: context (AnalyticsMetricsOverTimeResponseContext): - data ([AnalyticsMetricsOverTimeResponseData]): Returns an array of metrics and the timestamps . + data ([AnalyticsMetricsOverTimeResponseData]): Returns an array of metrics and the timestamps. pagination (Pagination): Keyword Args: diff --git a/apivideo/model/analytics_metrics_over_time_response_context.py b/apivideo/model/analytics_metrics_over_time_response_context.py index fcac832..bd87878 100644 --- a/apivideo/model/analytics_metrics_over_time_response_context.py +++ b/apivideo/model/analytics_metrics_over_time_response_context.py @@ -61,8 +61,22 @@ class AnalyticsMetricsOverTimeResponseContext(ModelNormal): 'START': "start", 'END': "end", 'IMPRESSION': "impression", + 'CCV-AVERAGE': "ccv-average", + 'CCV-PEAK': "ccv-peak", + 'UNIQUE-CCV-AVERAGE': "unique-ccv-average", + 'UNIQUE-CCV-PEAK': "unique-ccv-peak", + 'VIEW-3': "view-3", + 'VIEW-5': "view-5", + 'VIEW-10': "view-10", + 'VIEW-30': "view-30", + 'UNIQUE-VIEW': "unique-view", + 'UNIQUE-VIEW-3': "unique-view-3", + 'UNIQUE-VIEW-5': "unique-view-5", + 'UNIQUE-VIEW-10': "unique-view-10", + 'UNIQUE-VIEW-30': "unique-view-30", }, ('interval',): { + 'MINUTE': "minute", 'HOUR': "hour", 'DAY': "day", }, @@ -149,7 +163,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - metric (str): Returns the metric you selected.. [optional] # noqa: E501 + metric (str): Returns the metric and relevant parameters you selected.. [optional] # noqa: E501 interval (str): Returns the interval you selected.. [optional] # noqa: E501 timeframe (AnalyticsAggregatedMetricsResponseContextTimeframe): [optional] # noqa: E501 """ diff --git a/apivideo/model/filter_by.py b/apivideo/model/filter_by.py index 6bdad9f..50e754a 100644 --- a/apivideo/model/filter_by.py +++ b/apivideo/model/filter_by.py @@ -92,6 +92,7 @@ def openapi_types(): 'operating_system': ([str],), # noqa: E501 'browser': ([str],), # noqa: E501 'tag': (str,), # noqa: E501 + 'referrer': ([str],), # noqa: E501 } @cached_property @@ -108,6 +109,7 @@ def discriminator(): 'operating_system': 'operatingSystem', # noqa: E501 'browser': 'browser', # noqa: E501 'tag': 'tag', # noqa: E501 + 'referrer': 'referrer', # noqa: E501 } _composed_schemas = {} @@ -164,6 +166,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 operating_system ([str]): Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`.. [optional] # noqa: E501 browser ([str]): Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`.. [optional] # noqa: E501 tag (str): Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata).. [optional] # noqa: E501 + referrer ([str]): Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/apivideo/model/filter_by1.py b/apivideo/model/filter_by1.py index df4a068..1d3eaa6 100644 --- a/apivideo/model/filter_by1.py +++ b/apivideo/model/filter_by1.py @@ -92,6 +92,7 @@ def openapi_types(): 'operating_system': ([str],), # noqa: E501 'browser': ([str],), # noqa: E501 'tag': (str,), # noqa: E501 + 'referrer': ([str],), # noqa: E501 } @cached_property @@ -108,6 +109,7 @@ def discriminator(): 'operating_system': 'operatingSystem', # noqa: E501 'browser': 'browser', # noqa: E501 'tag': 'tag', # noqa: E501 + 'referrer': 'referrer', # noqa: E501 } _composed_schemas = {} @@ -164,6 +166,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 operating_system ([str]): Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`.. [optional] # noqa: E501 browser ([str]): Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`.. [optional] # noqa: E501 tag (str): Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata).. [optional] # noqa: E501 + referrer ([str]): Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/apivideo/model/filter_by2.py b/apivideo/model/filter_by2.py index be269dd..bde86f6 100644 --- a/apivideo/model/filter_by2.py +++ b/apivideo/model/filter_by2.py @@ -92,6 +92,7 @@ def openapi_types(): 'operating_system': ([str],), # noqa: E501 'browser': ([str],), # noqa: E501 'tag': (str,), # noqa: E501 + 'referrer': ([str],), # noqa: E501 } @cached_property @@ -108,6 +109,7 @@ def discriminator(): 'operating_system': 'operatingSystem', # noqa: E501 'browser': 'browser', # noqa: E501 'tag': 'tag', # noqa: E501 + 'referrer': 'referrer', # noqa: E501 } _composed_schemas = {} @@ -164,6 +166,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 operating_system ([str]): Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`.. [optional] # noqa: E501 browser ([str]): Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`.. [optional] # noqa: E501 tag (str): Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata).. [optional] # noqa: E501 + referrer ([str]): Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/docs/AnalyticsAggregatedMetricsResponseContext.md b/docs/AnalyticsAggregatedMetricsResponseContext.md index 98d5b54..6feb7e7 100644 --- a/docs/AnalyticsAggregatedMetricsResponseContext.md +++ b/docs/AnalyticsAggregatedMetricsResponseContext.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metric** | **str** | Returns the metric you selected. | [optional] +**metric** | **str** | Returns the metric and relevant parameters you selected. | [optional] **aggregation** | **str** | Returns the aggregation you selected. | [optional] **timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] diff --git a/docs/AnalyticsApi.md b/docs/AnalyticsApi.md index 99c91a7..2ef783e 100644 --- a/docs/AnalyticsApi.md +++ b/docs/AnalyticsApi.md @@ -32,10 +32,12 @@ from pprint import pprint with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: # Create an instance of the API class api_instance = analytics_api.AnalyticsApi(api_client) - metric = "play" # str | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - aggregation = "count" # str | Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. + metric = "play" # str | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `ccv`: is the number of concurrent viewers, or users watching at the same time. - `view`: the total number of viewers until this point in time. + aggregation = "count" # str | Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `peak` shows the highest value of the `ccv` metric in the timeframe of your request. You can use this aggregation only with the `ccv` metric. - `live` shows the highest value of the `ccv` metric from the last 20 seconds. You can use this aggregation only with the `ccv` metric. _from = dateutil_parser('2024-02-05T00:00:00+01:00') # datetime | Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. (optional) to = dateutil_parser('2024-02-06T00:00:00+01:00') # datetime | Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) + unique = True # bool | Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. (optional) + view_duration = "5s" # str | Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. (optional) filter_by = { media_id=["vi4blUQJFrYWbaG44NChkH27"], media_type="video", @@ -45,7 +47,8 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: operating_system=["windows"], browser=["firefox"], tag="Cool videos", - } # FilterBy2 | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). (optional) + referrer=["http://my.list/of-videos"], + } # FilterBy2 | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. (optional) # example passing only required values which don't have defaults set try: @@ -59,7 +62,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: # and optional values try: # Retrieve aggregated metrics - api_response = api_instance.get_aggregated_metrics(metric, aggregation, _from=_from, to=to, filter_by=filter_by) + api_response = api_instance.get_aggregated_metrics(metric, aggregation, _from=_from, to=to, unique=unique, view_duration=view_duration, filter_by=filter_by) pprint(api_response) except apivideo.ApiException as e: print("Exception when calling AnalyticsApi->get_aggregated_metrics: %s\n" % e) @@ -70,11 +73,13 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **metric** | **str**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. | - **aggregation** | **str**| Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. | + **metric** | **str**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. You can use the aggregations `count`, `rate`, and `total` with the `play` metric. - `start` is the number of times playback was started. You can use the aggregation `count` with this metric. - `end` is the number of times playback has ended with the content watch until the end. You can use the aggregation `count` with this metric. - `impression` is the number of times your content has been loaded and was ready for playback. You can use the aggregation `count` with this metric. - `impression-time` is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations `average` and `sum` with this metric. - `watch-time` is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations `average` and `sum` with this metric. - `ccv`: is the number of concurrent viewers, or users watching at the same time. - `view`: the total number of viewers until this point in time. | + **aggregation** | **str**| Use this path parameter to define a way of collecting data for the metric that you want analytics for. - `count` returns the overall number of events for the `play` metric. - `rate` returns the ratio that calculates the number of plays your content receives divided by its impressions. This aggregation can be used only with the `play` metric. - `total` calculates the total number of events for the `play` metric. - `average` calculates an average value for the selected metric. - `sum` adds up the total value of the select metric. - `peak` shows the highest value of the `ccv` metric in the timeframe of your request. You can use this aggregation only with the `ccv` metric. - `live` shows the highest value of the `ccv` metric from the last 20 seconds. You can use this aggregation only with the `ccv` metric. | **_from** | **datetime**| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` - The API ignores this parameter when you call `/data/metrics/play/total`. | [optional] **to** | **datetime**| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The API ignores this parameter when you call `/data/metrics/play/total`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] - **filter_by** | **FilterBy2**| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + **unique** | **bool**| Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. | [optional] + **view_duration** | **str**| Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. | [optional] + **filter_by** | **FilterBy2**| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. | [optional] ### Return type @@ -120,12 +125,14 @@ from pprint import pprint with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: # Create an instance of the API class api_instance = analytics_api.AnalyticsApi(api_client) - metric = "play" # str | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - breakdown = "media-id" # str | Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. + metric = "play" # str | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers until this point in time. + breakdown = "media-id" # str | Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `referrer`: Returns the URL where the view originates from, for example a website where the video is embedded. View events from Android and iOS return empty strings as referrer. _from = dateutil_parser('2024-02-05T00:00:00+01:00') # datetime | Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) to = dateutil_parser('2024-02-06T00:00:00+01:00') # datetime | Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) sort_by = "metricValue" # str | Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `dimensionValue`: Sorts the results based on the **dimension** you selected in your request. (optional) sort_order = "asc" # str | Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. (optional) + unique = True # bool | Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. (optional) + view_duration = "3s" # str | Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. (optional) filter_by = { media_id=["vi4blUQJFrYWbaG44NChkH27"], media_type="video", @@ -135,7 +142,8 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: operating_system=["windows"], browser=["firefox"], tag="Cool videos", - } # FilterBy2 | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). (optional) + referrer=["http://my.list/of-videos"], + } # FilterBy2 | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. (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 @@ -151,7 +159,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: # and optional values try: # Retrieve metrics in a breakdown of dimensions - api_response = api_instance.get_metrics_breakdown(metric, breakdown, _from=_from, to=to, sort_by=sort_by, sort_order=sort_order, filter_by=filter_by, current_page=current_page, page_size=page_size) + api_response = api_instance.get_metrics_breakdown(metric, breakdown, _from=_from, to=to, sort_by=sort_by, sort_order=sort_order, unique=unique, view_duration=view_duration, filter_by=filter_by, current_page=current_page, page_size=page_size) pprint(api_response) except apivideo.ApiException as e: print("Exception when calling AnalyticsApi->get_metrics_breakdown: %s\n" % e) @@ -162,13 +170,15 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **metric** | **str**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. | - **breakdown** | **str**| Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | + **metric** | **str**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `play-total` is the total number of times a specific content has been played. You can only use the `media-id` breakdown with this metric. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers until this point in time. | + **breakdown** | **str**| Use this path parameter to define a dimension for segmenting analytics data. You must use `kebab-case` for path parameters. These are the available dimensions: - `media-id`: Returns analytics based on the unique identifiers of a video or a live stream. - `media-type`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). - `device-type`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operating-system`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `referrer`: Returns the URL where the view originates from, for example a website where the video is embedded. View events from Android and iOS return empty strings as referrer. | **_from** | **datetime**| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | [optional] **to** | **datetime**| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] **sort_by** | **str**| Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `dimensionValue`: Sorts the results based on the **dimension** you selected in your request. | [optional] **sort_order** | **str**| Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. | [optional] - **filter_by** | **FilterBy2**| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + **unique** | **bool**| Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. | [optional] + **view_duration** | **str**| Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. | [optional] + **filter_by** | **FilterBy2**| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. | [optional] **current_page** | **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** | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] if omitted the server will use the default value of 25 @@ -216,12 +226,14 @@ from pprint import pprint with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: # Create an instance of the API class api_instance = analytics_api.AnalyticsApi(api_client) - metric = "play" # str | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. + metric = "play" # str | Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers. _from = dateutil_parser('2024-02-05T00:00:00+01:00') # datetime | Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` (optional) to = dateutil_parser('2024-02-06T00:00:00+01:00') # datetime | Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. (optional) - interval = "hour" # str | Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. (optional) + interval = "hour" # str | Use this query parameter to define the granularity of the data. Possible values: `minute`, `hour`, `day`. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. - When you set `minute` as interval, the timeframe you define with the `from` and `to` parameters should be less than 60 minutes. (optional) sort_by = "metricValue" # str | Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `emittedAt`: Sorts the results based on the **timestamp** of the event in ATOM date-time format. (optional) sort_order = "asc" # str | Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. (optional) + unique = True # bool | Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. (optional) + view_duration = "3s" # str | Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. (optional) filter_by = { media_id=["vi4blUQJFrYWbaG44NChkH27"], media_type="video", @@ -231,7 +243,8 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: operating_system=["windows"], browser=["firefox"], tag="Cool videos", - } # FilterBy2 | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). (optional) + referrer=["http://my.list/of-videos"], + } # FilterBy2 | Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. (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 @@ -247,7 +260,7 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: # and optional values try: # Retrieve metrics over time - api_response = api_instance.get_metrics_over_time(metric, _from=_from, to=to, interval=interval, sort_by=sort_by, sort_order=sort_order, filter_by=filter_by, current_page=current_page, page_size=page_size) + api_response = api_instance.get_metrics_over_time(metric, _from=_from, to=to, interval=interval, sort_by=sort_by, sort_order=sort_order, unique=unique, view_duration=view_duration, filter_by=filter_by, current_page=current_page, page_size=page_size) pprint(api_response) except apivideo.ApiException as e: print("Exception when calling AnalyticsApi->get_metrics_over_time: %s\n" % e) @@ -258,13 +271,15 @@ with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **metric** | **str**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. | + **metric** | **str**| Use this path parameter to select a metric that you want analytics for. - `play` is the number of times your content has been played. - `play-rate` is the ratio that calculates the number of plays your content receives divided by its impressions. - `start` is the number of times playback was started. - `end` is the number of times playback has ended with the content watch until the end. - `impression` is the number of times your content has been loaded and was ready for playback. - `ccv-peak` is the highest number of concurrent viewers in the timeframe of your request. - `ccv-average` is the average number of concurrent viewers in the timeframe of your request. - `view` is the total number of viewers. | **_from** | **datetime**| Use this query parameter to define the starting date-time of the period you want analytics for. - If you do not set a value for `from`, the default assigned value is 1 day ago, based on the `to` parameter. - The maximum value is 30 days ago. - The value you provide should follow the ATOM date-time format: `2024-02-05T00:00:00+01:00` | [optional] **to** | **datetime**| Use this query parameter to define the ending date-time of the period you want analytics for. - If you do not set a value for `to`, the default assigned value is `now`. - The value for `to` is a non-inclusive value: the API returns data **before** the date-time that you set. | [optional] - **interval** | **str**| Use this query parameter to define how granularity of the data. Possible values: `hour`, `day`. - Default: If no interval specified and the period (different between from and to) ≤ 2 days then hour, otherwise day. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. | [optional] + **interval** | **str**| Use this query parameter to define the granularity of the data. Possible values: `minute`, `hour`, `day`. - If you do not set a value for `interval`, and the period you set using the `from` and `to` parameters is less than or equals to 2 days, then the default assigned value is `hour`. Otherwise the API sets it to `day`. - When you set `minute` as interval, the timeframe you define with the `from` and `to` parameters should be less than 60 minutes. | [optional] **sort_by** | **str**| Use this parameter to choose which field the API will use to sort the analytics data. These are the available fields to sort by: - `metricValue`: Sorts the results based on the **metric** you selected in your request. - `emittedAt`: Sorts the results based on the **timestamp** of the event in ATOM date-time format. | [optional] **sort_order** | **str**| Use this parameter to define the sort order of results. These are the available sort orders: - `asc`: Sorts the results in ascending order: `A to Z` and `0 to 9`. - `desc`: Sorts the results in descending order: `Z to A` and `9 to 0`. | [optional] - **filter_by** | **FilterBy2**| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] + **unique** | **bool**| Use this query parameter to control how viewer data is counted: - `true` means that a single user watchig multiple times counts as 1 unique viewer - `false` means that all views count, even if from the same user. The API accepts this parameter only when you use the `ccv-peak`, `ccv-average`, or `view` metric. Viewers are unique for 1 day. The API determines uniqueness based on a viewer's `user-agent` and IP address. This means that the API can filter viewers using multiple tabs to watch the same video multiple times, but cannot filter for viewers who use multiple browsers to watch the same content multiple times. | [optional] + **view_duration** | **str**| Use this query parameter to define how many seconds a view has to last to be counted in analytics data. - You can only use this parameter together with the `view` metric. - The accepted values are `3s`, `5s`, `10s`, and `30s`. - If you do not set this parameter, the API defaults to `5s`. | [optional] + **filter_by** | **FilterBy2**| Use this parameter to filter the API's response based on different data dimensions. You can serialize filters in your query to receive more detailed breakdowns of your analytics. - If you do not set a value for `filterBy`, the API returns the full dataset for your project. - The API only accepts the `mediaId` and `mediaType` filters when you call `/data/metrics/play/total` or `/data/buckets/play-total/media-id`. These are the available breakdown dimensions: - `mediaId`: Returns analytics based on the unique identifiers of a video or a live stream. - `mediaType`: Returns analytics based on the type of content. Possible values: `video` and `live-stream`. - `continent`: Returns analytics based on the viewers' continent. The list of supported continents names are based on the [GeoNames public database](https://www.geonames.org/countries/). You must use the ISO-3166 alpha2 format, for example `EU`. Possible values are: `AS`, `AF`, `NA`, `SA`, `AN`, `EU`, `AZ`. - `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/). You must use the ISO-3166 alpha2 format, for example `FR`. - `deviceType`: Returns analytics based on the type of device used by the viewers. Response values can include: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. - `tag`: Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). - `referrer`: Filters data based on the URL where the view is originating from. Accepts an empty string as a value to filter view events where no referrer is available. | [optional] **current_page** | **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** | **int**| Results per page. Allowed values 1-100, default is 25. | [optional] if omitted the server will use the default value of 25 diff --git a/docs/AnalyticsMetricsBreakdownResponseContext.md b/docs/AnalyticsMetricsBreakdownResponseContext.md index 88856f0..f31fef7 100644 --- a/docs/AnalyticsMetricsBreakdownResponseContext.md +++ b/docs/AnalyticsMetricsBreakdownResponseContext.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metric** | **str** | Returns the metric you selected. | [optional] +**metric** | **str** | Returns the metric and relevant parameters you selected. | [optional] **breakdown** | **str** | Returns the dimension you selected. | [optional] **timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] diff --git a/docs/AnalyticsMetricsOverTimeResponse.md b/docs/AnalyticsMetricsOverTimeResponse.md index 7394403..311a678 100644 --- a/docs/AnalyticsMetricsOverTimeResponse.md +++ b/docs/AnalyticsMetricsOverTimeResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **context** | [**AnalyticsMetricsOverTimeResponseContext**](AnalyticsMetricsOverTimeResponseContext.md) | | -**data** | [**[AnalyticsMetricsOverTimeResponseData]**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps . | +**data** | [**[AnalyticsMetricsOverTimeResponseData]**](AnalyticsMetricsOverTimeResponseData.md) | Returns an array of metrics and the timestamps. | **pagination** | [**Pagination**](Pagination.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AnalyticsMetricsOverTimeResponseContext.md b/docs/AnalyticsMetricsOverTimeResponseContext.md index 22f3ad5..c3a0da0 100644 --- a/docs/AnalyticsMetricsOverTimeResponseContext.md +++ b/docs/AnalyticsMetricsOverTimeResponseContext.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metric** | **str** | Returns the metric you selected. | [optional] +**metric** | **str** | Returns the metric and relevant parameters you selected. | [optional] **interval** | **str** | Returns the interval you selected. | [optional] **timeframe** | [**AnalyticsAggregatedMetricsResponseContextTimeframe**](AnalyticsAggregatedMetricsResponseContextTimeframe.md) | | [optional] diff --git a/docs/FilterBy.md b/docs/FilterBy.md index 26f4aed..b1fbfd3 100644 --- a/docs/FilterBy.md +++ b/docs/FilterBy.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **operating_system** | **[str]** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **[str]** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **str** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] +**referrer** | **[str]** | Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FilterBy1.md b/docs/FilterBy1.md index dd2baa9..f82da2e 100644 --- a/docs/FilterBy1.md +++ b/docs/FilterBy1.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **operating_system** | **[str]** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **[str]** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **str** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] +**referrer** | **[str]** | Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FilterBy2.md b/docs/FilterBy2.md index f347595..319c968 100644 --- a/docs/FilterBy2.md +++ b/docs/FilterBy2.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **operating_system** | **[str]** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **[str]** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **str** | Returns analytics for videos using this tag. This filter only accepts a single value and is case sensitive. Read more about tagging your videos [here](https://docs.api.video/vod/tags-metadata). | [optional] +**referrer** | **[str]** | Filters data based on the URL where the view is originating from. This filter parameter accepts an empty string to filter view events where no referrer is available. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/setup.py b/setup.py index cd57e7f..ed2c26c 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "api.video" -VERSION = "1.4.5" +VERSION = "1.4.6" # To install the library, run the following # # python setup.py install diff --git a/test/payloads/analytics/get_aggregated_metrics/responses/400-2.json b/test/payloads/analytics/get_aggregated_metrics/responses/400-2.json new file mode 100644 index 0000000..d7d510f --- /dev/null +++ b/test/payloads/analytics/get_aggregated_metrics/responses/400-2.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This value should not contain more than 2048 characters.", + "name" : "filterBy[referrer]" +} \ No newline at end of file diff --git a/test/payloads/analytics/get_aggregated_metrics/responses/400-3.json b/test/payloads/analytics/get_aggregated_metrics/responses/400-3.json new file mode 100644 index 0000000..8199ab8 --- /dev/null +++ b/test/payloads/analytics/get_aggregated_metrics/responses/400-3.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This view duration is invalid. Use one of \"3s\", \"5s\", \"10s\", \"30s\".", + "name" : "viewDuration" +} \ No newline at end of file diff --git a/test/payloads/analytics/get_metrics_breakdown/responses/400-2.json b/test/payloads/analytics/get_metrics_breakdown/responses/400-2.json new file mode 100644 index 0000000..d7d510f --- /dev/null +++ b/test/payloads/analytics/get_metrics_breakdown/responses/400-2.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This value should not contain more than 2048 characters.", + "name" : "filterBy[referrer]" +} \ No newline at end of file diff --git a/test/payloads/analytics/get_metrics_breakdown/responses/400-3.json b/test/payloads/analytics/get_metrics_breakdown/responses/400-3.json new file mode 100644 index 0000000..8199ab8 --- /dev/null +++ b/test/payloads/analytics/get_metrics_breakdown/responses/400-3.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This view duration is invalid. Use one of \"3s\", \"5s\", \"10s\", \"30s\".", + "name" : "viewDuration" +} \ No newline at end of file diff --git a/test/payloads/analytics/get_metrics_over_time/responses/400-2.json b/test/payloads/analytics/get_metrics_over_time/responses/400-2.json new file mode 100644 index 0000000..f7c9d42 --- /dev/null +++ b/test/payloads/analytics/get_metrics_over_time/responses/400-2.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This interval is invalid. Use one of \"minute\", \"hour\", \"day\".", + "name" : "interval" +} \ No newline at end of file diff --git a/test/payloads/analytics/get_metrics_over_time/responses/400-3.json b/test/payloads/analytics/get_metrics_over_time/responses/400-3.json new file mode 100644 index 0000000..333be94 --- /dev/null +++ b/test/payloads/analytics/get_metrics_over_time/responses/400-3.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This interval cannot be used with a timeframe over 60 minutes.", + "name" : "interval" +} \ No newline at end of file diff --git a/test/payloads/analytics/get_metrics_over_time/responses/400-4.json b/test/payloads/analytics/get_metrics_over_time/responses/400-4.json new file mode 100644 index 0000000..d7d510f --- /dev/null +++ b/test/payloads/analytics/get_metrics_over_time/responses/400-4.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This value should not contain more than 2048 characters.", + "name" : "filterBy[referrer]" +} \ No newline at end of file diff --git a/test/payloads/analytics/get_metrics_over_time/responses/400-5.json b/test/payloads/analytics/get_metrics_over_time/responses/400-5.json new file mode 100644 index 0000000..8199ab8 --- /dev/null +++ b/test/payloads/analytics/get_metrics_over_time/responses/400-5.json @@ -0,0 +1,7 @@ +{ + "type" : "https://docs.api.video/reference/request-invalid-query-parameter", + "title" : "A query parameter is invalid.", + "status" : 400, + "detail" : "This view duration is invalid. Use one of \"3s\", \"5s\", \"10s\", \"30s\".", + "name" : "viewDuration" +} \ No newline at end of file