Analytics

Retrieve aggregated metrics

Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time.

get/data/metrics/{metric}/{aggregation}

Path parameters

metric'play' | 'start' | 'end' | 'impression' | 'impression-time' | 'watch-time' | 'ccv' | 'view' required

Use this path parameter to select a metric that you want analytics for.

  • play is the number of times your content has been played. You can use the aggregations count, rate, and total with the play metric.
  • start is the number of times playback was started. You can use the aggregation count with this metric.
  • end is the number of times playback has ended with the content watch until the end. You can use the aggregation count with this metric.
  • impression is the number of times your content has been loaded and was ready for playback. You can use the aggregation count with this metric.
  • impression-time is the time in milliseconds that your content was loading for until the first video frame is displayed. You can use the aggregations average and sum with this metric.
  • watch-time is the cumulative time in seconds that the user has spent watching your content. You can use the aggregations average and sum with this metric.
  • ccv: is the number of concurrent viewers, or users watching at the same time.
  • view: the total number of viewers until this point in time.
aggregation'count' | 'rate' | 'total' | 'average' | 'sum' | 'peak' | 'live' required

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.

Query parameters

fromstring date-time

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.
tostring date-time

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.
uniqueboolean

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'

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.

Parameters

#/components/parameters/filterBy_2 — unresolved $ref

Response

Success

datanumber float required

Example response

{
  "data": 356.2,
  "context": {
    "timeframe": {
      "from": "2024-05-28T11:15:07Z",
      "to": "2024-05-29T11:15:07Z"
    },
    "metric": "impression",
    "aggregation": "count"
  }
}

Changes

Changed in 3 of the 50 revisions of this API.1117

  • abe73c19f120116See the full diff
    • added the new ccv enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new unique-ccv enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new unique-view enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new unique-view-10 enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new unique-view-3 enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new unique-view-30 enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new unique-view-5 enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new view-10 enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new view-3 enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new view-30 enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new view-5 enum value to the context/metric response property for the response status 200

      response-property-enum-value-added

    • added the new optional query request parameter unique

      new-optional-request-parameter

    • added the new optional query request parameter viewDuration

      new-optional-request-parameter

    • added the new enum value ccv to the path request parameter metric

      request-parameter-enum-value-added

    • added the new enum value live to the path request parameter aggregation

      request-parameter-enum-value-added

    • added the new enum value peak to the path request parameter aggregation

      request-parameter-enum-value-added

    • added the new enum value view to the path request parameter metric

      request-parameter-enum-value-added

    • endpoint added

      endpoint-added

    This revision also has 13 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • api path removed without deprecation

      api-path-removed-without-deprecation

    This revision also has 32 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

Of the 50 revisions, 1 has no diff computed.