You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apivideo/api/analytics_api.py
+48Lines changed: 48 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -234,6 +234,8 @@ def get_metrics_breakdown(
234
234
Keyword Args:
235
235
_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]
236
236
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]
237
+
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]
238
+
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]
237
239
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]
238
240
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
239
241
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
@@ -276,6 +278,8 @@ def get_metrics_breakdown(
276
278
'breakdown',
277
279
'_from',
278
280
'to',
281
+
'sort_by',
282
+
'sort_order',
279
283
'filter_by',
280
284
'current_page',
281
285
'page_size',
@@ -294,6 +298,8 @@ def get_metrics_breakdown(
294
298
'enum': [
295
299
'metric',
296
300
'breakdown',
301
+
'sort_by',
302
+
'sort_order',
297
303
],
298
304
'validation': [
299
305
]
@@ -320,6 +326,16 @@ def get_metrics_breakdown(
320
326
"OPERATING-SYSTEM": "operating-system",
321
327
"BROWSER": "browser"
322
328
},
329
+
('sort_by',): {
330
+
331
+
"METRICVALUE": "metricValue",
332
+
"DIMENSIONVALUE": "dimensionValue"
333
+
},
334
+
('sort_order',): {
335
+
336
+
"ASC": "asc",
337
+
"DESC": "desc"
338
+
},
323
339
}
324
340
openapi_types= {
325
341
'metric':
@@ -330,6 +346,10 @@ def get_metrics_breakdown(
330
346
(datetime,),
331
347
'to':
332
348
(datetime,),
349
+
'sort_by':
350
+
(str,),
351
+
'sort_order':
352
+
(str,),
333
353
'filter_by':
334
354
(FilterBy2,),
335
355
'current_page':
@@ -346,6 +366,8 @@ def get_metrics_breakdown(
346
366
'breakdown': 'breakdown',
347
367
'_from': 'from',
348
368
'to': 'to',
369
+
'sort_by': 'sortBy',
370
+
'sort_order': 'sortOrder',
349
371
'filter_by': 'filterBy',
350
372
'current_page': 'currentPage',
351
373
'page_size': 'pageSize',
@@ -355,6 +377,8 @@ def get_metrics_breakdown(
355
377
'breakdown': 'path',
356
378
'_from': 'query',
357
379
'to': 'query',
380
+
'sort_by': 'query',
381
+
'sort_order': 'query',
358
382
'filter_by': 'query',
359
383
'current_page': 'query',
360
384
'page_size': 'query',
@@ -423,6 +447,8 @@ def get_metrics_over_time(
423
447
_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]
424
448
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]
425
449
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]
450
+
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]
451
+
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]
426
452
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]
427
453
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
428
454
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
0 commit comments