From d461187547b0df7999b3e086e59a00b723a347da Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Mon, 4 Nov 2024 14:40:41 +0000 Subject: [PATCH] Analytics updates --- docs/api/AnalyticsApi.md | 12 ++++++------ docs/model/FilterBy.md | 2 +- docs/model/FilterBy1.md | 2 +- docs/model/FilterBy2.md | 2 +- src/api/AnalyticsApi.ts | 24 ++++++++++++------------ src/model/FilterBy.ts | 2 +- src/model/FilterBy1.ts | 2 +- src/model/FilterBy2.ts | 2 +- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/api/AnalyticsApi.md b/docs/api/AnalyticsApi.md index f3bd618..68ccd13 100644 --- a/docs/api/AnalyticsApi.md +++ b/docs/api/AnalyticsApi.md @@ -23,8 +23,8 @@ Retrieve time-based and countable metrics like average watch time or the number | **aggregation** | **'count' \| 'rate' \| 'total' \| 'average' \| 'sum' \| 'peak' \| 'live'**| **yes**| 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** | **Date**| no| 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`. | | **to** | **Date**| no| 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. | - | **unique** | **boolean**| no| 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. | - | **viewDuration** | **'3s' \| '5s' \| '10s' \| '30s'**| no| 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`. | + | **unique** | **boolean**| no| Use this query parameter to control how viewer data is counted: - `true` means that a single user watching 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` 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. | + | **viewDuration** | **'3s' \| '5s' \| '10s' \| '30s'**| no| 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 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`. | | **filterBy** | [**FilterBy2**](../model/.md)| no| 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. | @@ -48,12 +48,12 @@ Retrieve detailed analytics play-rate and number of impressions segmented by dim | Name | Type | Required | Description | | ------------- | ------------- | ------------- | ------------- | | **metric** | **'play' \| 'play-rate' \| 'play-total' \| 'start' \| 'end' \| 'impression' \| 'ccv-peak' \| 'ccv-average' \| 'view'**| **yes**| 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' \| 'media-type' \| 'continent' \| 'country' \| 'device-type' \| 'operating-system' \| 'browser' \| 'referrer'**| **yes**| 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. | + | **breakdown** | **'media-id' \| 'media-type' \| 'continent' \| 'country' \| 'device-type' \| 'operating-system' \| 'browser' \| 'referrer'**| **yes**| 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 the value for `referrer`. | | **from** | **Date**| no| 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` | | **to** | **Date**| no| 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. | | **sortBy** | **'metricValue' \| 'dimensionValue'**| no| 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. | | **sortOrder** | **'asc' \| 'desc'**| no| 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`. | - | **unique** | **boolean**| no| 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. | + | **unique** | **boolean**| no| Use this query parameter to control how viewer data is counted: - `true` means that a single user watching 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. | | **viewDuration** | **'3s' \| '5s' \| '10s' \| '30s'**| no| 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`. | | **filterBy** | [**FilterBy2**](../model/.md)| no| 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. | | **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 | @@ -82,10 +82,10 @@ Retrieve countable metrics like the number of plays or impressions, grouped by t | **metric** | **'play' \| 'play-rate' \| 'start' \| 'end' \| 'impression' \| 'ccv-peak' \| 'ccv-average' \| 'view'**| **yes**| 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** | **Date**| no| 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` | | **to** | **Date**| no| 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. | - | **interval** | **'minute' \| 'hour' \| 'day'**| no| 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. | + | **interval** | **'minute' \| 'hour' \| 'day'**| no| 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 must be less than 60 minutes. | | **sortBy** | **'metricValue' \| 'emittedAt'**| no| 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. | | **sortOrder** | **'asc' \| 'desc'**| no| 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`. | - | **unique** | **boolean**| no| 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. | + | **unique** | **boolean**| no| Use this query parameter to control how viewer data is counted: - `true` means that a single user watching 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. | | **viewDuration** | **'3s' \| '5s' \| '10s' \| '30s'**| no| 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`. | | **filterBy** | [**FilterBy2**](../model/.md)| no| 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. | | **currentPage** | **number**| no| Choose the number of search results to return per page. Minimum value: 1 | diff --git a/docs/model/FilterBy.md b/docs/model/FilterBy.md index 55017dd..767cf7c 100644 --- a/docs/model/FilterBy.md +++ b/docs/model/FilterBy.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **operatingSystem** | **Array<string>** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **Array<string>** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **string** | 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** | **Array<string>** | 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] +**referrer** | **Array<string>** | 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. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded. | [optional] diff --git a/docs/model/FilterBy1.md b/docs/model/FilterBy1.md index 0688254..0bf83e0 100644 --- a/docs/model/FilterBy1.md +++ b/docs/model/FilterBy1.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **operatingSystem** | **Array<string>** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **Array<string>** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **string** | 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** | **Array<string>** | 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] +**referrer** | **Array<string>** | 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. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded. | [optional] diff --git a/docs/model/FilterBy2.md b/docs/model/FilterBy2.md index ed9e0af..073445a 100644 --- a/docs/model/FilterBy2.md +++ b/docs/model/FilterBy2.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **operatingSystem** | **Array<string>** | Returns analytics based on the operating system used by the viewers. Response values can include `windows`, `mac osx`, `android`, `ios`, `linux`. | [optional] **browser** | **Array<string>** | Returns analytics based on the browser used by the viewers. Response values can include `chrome`, `firefox`, `edge`, `opera`. | [optional] **tag** | **string** | 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** | **Array<string>** | 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] +**referrer** | **Array<string>** | 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. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded. | [optional] diff --git a/src/api/AnalyticsApi.ts b/src/api/AnalyticsApi.ts index fad1b69..67c3ded 100644 --- a/src/api/AnalyticsApi.ts +++ b/src/api/AnalyticsApi.ts @@ -35,8 +35,8 @@ export default class AnalyticsApi { * @param { 'count' | 'rate' | 'total' | 'average' | 'sum' | 'peak' | 'live' } searchParams.aggregation 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. * @param { Date } searchParams.from 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`. * @param { Date } searchParams.to 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. - * @param { boolean } searchParams.unique 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. - * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration 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`. + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watching 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` 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. + * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration 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 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`. * @param { FilterBy2 } searchParams.filterBy 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. */ public async getAggregatedMetrics(args: { @@ -76,8 +76,8 @@ export default class AnalyticsApi { * @param { 'count' | 'rate' | 'total' | 'average' | 'sum' | 'peak' | 'live' } searchParams.aggregation 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. * @param { Date } searchParams.from 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`. * @param { Date } searchParams.to 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. - * @param { boolean } searchParams.unique 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. - * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration 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`. + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watching 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` 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. + * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration 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 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`. * @param { FilterBy2 } searchParams.filterBy 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. */ public async getAggregatedMetricsWithResponseHeaders({ @@ -216,12 +216,12 @@ export default class AnalyticsApi { * Retrieve metrics in a breakdown of dimensions * @param {Object} searchParams * @param { 'play' | 'play-rate' | 'play-total' | 'start' | 'end' | 'impression' | 'ccv-peak' | 'ccv-average' | 'view' } searchParams.metric 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. - * @param { 'media-id' | 'media-type' | 'continent' | 'country' | 'device-type' | 'operating-system' | 'browser' | 'referrer' } searchParams.breakdown 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. + * @param { 'media-id' | 'media-type' | 'continent' | 'country' | 'device-type' | 'operating-system' | 'browser' | 'referrer' } searchParams.breakdown 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 the value for `referrer`. * @param { Date } searchParams.from 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` * @param { Date } searchParams.to 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. * @param { 'metricValue' | 'dimensionValue' } searchParams.sortBy 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. * @param { 'asc' | 'desc' } searchParams.sortOrder 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`. - * @param { boolean } searchParams.unique 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. + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watching 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. * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration 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`. * @param { FilterBy2 } searchParams.filterBy 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. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 @@ -267,12 +267,12 @@ export default class AnalyticsApi { * Retrieve metrics in a breakdown of dimensions * @param {Object} searchParams * @param { 'play' | 'play-rate' | 'play-total' | 'start' | 'end' | 'impression' | 'ccv-peak' | 'ccv-average' | 'view' } searchParams.metric 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. - * @param { 'media-id' | 'media-type' | 'continent' | 'country' | 'device-type' | 'operating-system' | 'browser' | 'referrer' } searchParams.breakdown 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. + * @param { 'media-id' | 'media-type' | 'continent' | 'country' | 'device-type' | 'operating-system' | 'browser' | 'referrer' } searchParams.breakdown 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 the value for `referrer`. * @param { Date } searchParams.from 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` * @param { Date } searchParams.to 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. * @param { 'metricValue' | 'dimensionValue' } searchParams.sortBy 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. * @param { 'asc' | 'desc' } searchParams.sortOrder 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`. - * @param { boolean } searchParams.unique 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. + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watching 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. * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration 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`. * @param { FilterBy2 } searchParams.filterBy 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. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 @@ -451,10 +451,10 @@ export default class AnalyticsApi { * @param { 'play' | 'play-rate' | 'start' | 'end' | 'impression' | 'ccv-peak' | 'ccv-average' | 'view' } searchParams.metric 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. * @param { Date } searchParams.from 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` * @param { Date } searchParams.to 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. - * @param { 'minute' | 'hour' | 'day' } searchParams.interval 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. + * @param { 'minute' | 'hour' | 'day' } searchParams.interval 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 must be less than 60 minutes. * @param { 'metricValue' | 'emittedAt' } searchParams.sortBy 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. * @param { 'asc' | 'desc' } searchParams.sortOrder 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`. - * @param { boolean } searchParams.unique 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. + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watching 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. * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration 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`. * @param { FilterBy2 } searchParams.filterBy 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. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 @@ -493,10 +493,10 @@ export default class AnalyticsApi { * @param { 'play' | 'play-rate' | 'start' | 'end' | 'impression' | 'ccv-peak' | 'ccv-average' | 'view' } searchParams.metric 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. * @param { Date } searchParams.from 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` * @param { Date } searchParams.to 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. - * @param { 'minute' | 'hour' | 'day' } searchParams.interval 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. + * @param { 'minute' | 'hour' | 'day' } searchParams.interval 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 must be less than 60 minutes. * @param { 'metricValue' | 'emittedAt' } searchParams.sortBy 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. * @param { 'asc' | 'desc' } searchParams.sortOrder 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`. - * @param { boolean } searchParams.unique 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. + * @param { boolean } searchParams.unique Use this query parameter to control how viewer data is counted: - `true` means that a single user watching 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. * @param { '3s' | '5s' | '10s' | '30s' } searchParams.viewDuration 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`. * @param { FilterBy2 } searchParams.filterBy 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. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 diff --git a/src/model/FilterBy.ts b/src/model/FilterBy.ts index a15cc44..68a80c8 100644 --- a/src/model/FilterBy.ts +++ b/src/model/FilterBy.ts @@ -42,7 +42,7 @@ export default class FilterBy { */ 'tag'?: string; /** - * 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. + * 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. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded. */ 'referrer'?: Array; diff --git a/src/model/FilterBy1.ts b/src/model/FilterBy1.ts index 128b3de..3996cb3 100644 --- a/src/model/FilterBy1.ts +++ b/src/model/FilterBy1.ts @@ -42,7 +42,7 @@ export default class FilterBy1 { */ 'tag'?: string; /** - * 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. + * 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. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded. */ 'referrer'?: Array; diff --git a/src/model/FilterBy2.ts b/src/model/FilterBy2.ts index ace0a3a..3041991 100644 --- a/src/model/FilterBy2.ts +++ b/src/model/FilterBy2.ts @@ -42,7 +42,7 @@ export default class FilterBy2 { */ 'tag'?: string; /** - * 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. + * 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. - The API filters for exact matches. Include the trailing `/` characters if needed. - The URLs you add must be URL encoded. */ 'referrer'?: Array;