All URIs are relative to https://ws.api.video
Method | HTTP request | Description |
---|---|---|
get_live_streams_plays | GET /analytics/live-streams/plays | Get play events for live stream |
get_videos_plays | GET /analytics/videos/plays | Get play events for video |
AnalyticsPlaysResponse get_live_streams_plays(_from, dimension)
Get play events for live stream
Retrieve filtered analytics about the number of plays for your live streams in a project.
import apivideo
from apivideo.api import analytics_api
from apivideo.model.model403_error_schema import Model403ErrorSchema
from apivideo.model.too_many_requests import TooManyRequests
from apivideo.model.analytics_plays_response import AnalyticsPlaysResponse
from apivideo.model.not_found import NotFound
from apivideo.model.analytics_plays400_error import AnalyticsPlays400Error
from pprint import pprint
# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = analytics_api.AnalyticsApi(api_client)
_from = dateutil_parser('2023-06-01').date() # date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.
dimension = "browser" # str | Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`.
to = dateutil_parser('2023-06-10').date() # date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional)
filter = "liveStreamId:li3q7HxhApxRF1c8F8r6VeaI" # str | Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. (optional)
current_page = 2 # int | Choose the number of search results to return per page. Minimum value: 1 (optional) if omitted the server will use the default value of 1
page_size = 30 # int | Results per page. Allowed values 1-100, default is 25. (optional) if omitted the server will use the default value of 25
# example passing only required values which don't have defaults set
try:
# Get play events for live stream
api_response = api_instance.get_live_streams_plays(_from, dimension)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling AnalyticsApi->get_live_streams_plays: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get play events for live stream
api_response = api_instance.get_live_streams_plays(_from, dimension, to=to, filter=filter, current_page=current_page, page_size=page_size)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling AnalyticsApi->get_live_streams_plays: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
_from | date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be within the last 30 days. - The value you provide must follow the `YYYY-MM-DD` format. | |
dimension | str | Use this query parameter to define the dimension that you want analytics for. - `liveStreamId`: Returns analytics based on the public live stream identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the GeoNames public database. - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. | |
to | date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be within the last 30 days. - The value you provide must follow the `YYYY-MM-DD` format. | [optional] |
filter | str | Use this query parameter to filter your results to a specific live stream in a project that you want analytics for. You must use the `liveStreamId:` prefix when specifying a live stream ID. | [optional] |
current_page | 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 |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
400 | Bad request error | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
403 | Forbidden - Disabled Analytics | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
404 | Not Found | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
429 | Too Many Requests | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AnalyticsPlaysResponse get_videos_plays(_from, dimension)
Get play events for video
Retrieve filtered analytics about the number of plays for your videos in a project.
import apivideo
from apivideo.api import analytics_api
from apivideo.model.model403_error_schema import Model403ErrorSchema
from apivideo.model.too_many_requests import TooManyRequests
from apivideo.model.analytics_plays_response import AnalyticsPlaysResponse
from apivideo.model.not_found import NotFound
from apivideo.model.analytics_plays400_error import AnalyticsPlays400Error
from pprint import pprint
# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = analytics_api.AnalyticsApi(api_client)
_from = dateutil_parser('2023-06-01').date() # date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format.
dimension = "browser" # str | Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the [GeoNames public database](https://www.geonames.org/countries/). - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`.
to = dateutil_parser('2023-06-10').date() # date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be **within the last 30 days**. - The value you provide must follow the `YYYY-MM-DD` format. (optional)
filter = "videoId:vi3q7HxhApxRF1c8F8r6VeaI" # str | Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. (optional)
current_page = 2 # int | Choose the number of search results to return per page. Minimum value: 1 (optional) if omitted the server will use the default value of 1
page_size = 30 # int | Results per page. Allowed values 1-100, default is 25. (optional) if omitted the server will use the default value of 25
# example passing only required values which don't have defaults set
try:
# Get play events for video
api_response = api_instance.get_videos_plays(_from, dimension)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling AnalyticsApi->get_videos_plays: %s\n" % e)
# example passing only required values which don't have defaults set
# and optional values
try:
# Get play events for video
api_response = api_instance.get_videos_plays(_from, dimension, to=to, filter=filter, current_page=current_page, page_size=page_size)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling AnalyticsApi->get_videos_plays: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
_from | date | Use this query parameter to set the start date for the time period that you want analytics for. - The API returns analytics data including the day you set in `from`. - The date you set must be within the last 30 days. - The value you provide must follow the `YYYY-MM-DD` format. | |
dimension | str | Use this query parameter to define the dimension that you want analytics for. - `videoId`: Returns analytics based on the public video identifiers. - `emittedAt`: Returns analytics based on the times of the play events. The API returns data in specific interval groups. When the date period you set in `from` and `to` is less than or equals to 2 days, the response for this dimension is grouped in hourly intervals. Otherwise, it is grouped in daily intervals. - `country`: Returns analytics based on the viewers' country. The list of supported country names are based on the GeoNames public database. - `deviceType`: Returns analytics based on the type of device used by the viewers during the play event. Possible response values are: `computer`, `phone`, `tablet`, `tv`, `console`, `wearable`, `unknown`. - `operatingSystem`: Returns analytics based on the operating system used by the viewers during the play event. Response values include `windows`, `mac osx`, `android`, `ios`, `linux`. - `browser`: Returns analytics based on the browser used by the viewers during the play event. Response values include `chrome`, `firefox`, `edge`, `opera`. | |
to | date | Use this optional query parameter to set the end date for the time period that you want analytics for. - If you do not specify a `to` date, the API returns analytics data starting from the `from` date up until today, and excluding today. - The date you set must be within the last 30 days. - The value you provide must follow the `YYYY-MM-DD` format. | [optional] |
filter | str | Use this query parameter to filter your results to a specific video in a project that you want analytics for. You must use the `videoId:` prefix when specifying a video ID. | [optional] |
current_page | 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 |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Success | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
400 | Bad request error | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
403 | Forbidden - Disabled Analytics | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
404 | Not Found | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
429 | Too Many Requests | * X-RateLimit-Limit - The request limit per minute. * X-RateLimit-Remaining - The number of available requests left for the current time window. * X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]