Retrieve time-based and countable metrics like average watch time or the number of impressions over a certain period of time.
/data/metrics/{metric}/{aggregation}
from
string
Use this query parameter to define the starting date-time of the period you want analytics for.
from
, the default assigned value is 1 day ago, based on the to
parameter.2024-02-05T00:00:00+01:00
/data/metrics/play/total
. to
string
Use this query parameter to define the ending date-time of the period you want analytics for.
to
, the default assigned value is now
./data/metrics/play/total
.to
is a non-inclusive value: the API returns data before the date-time that you set. filterBy
string
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.
filterBy
, the API returns the full dataset for your project.mediaId
and mediaType
filters when you call /data/metrics/play/total
.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. 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.deviceType
: Returns analytics based on the type of device used by the viewers. Possible response values are: computer
, phone
, tablet
, tv
, console
, wearable
, unknown
.operatingSystem
: Returns analytics based on the operating system used by the viewers. Response values include windows
, mac osx
, android
, ios
, linux
.browser
: Returns analytics based on the browser used by the viewers. Response values include chrome
, firefox
, edge
, opera
.apiKey
metric
string
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. aggregation
string
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.Success
{
"context": {
"metric": "impression",
"aggregation": "count",
"timeframe": {
"from": "2024-05-28T11:15:07+00:00",
"to": "2024-05-29T11:15:07+00:00"
}
},
"data": 346.5
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Unrecognized request URL
{
"type": "https://docs.api.video/reference/unrecognized-request-url",
"title": "Unrecognized request URL.",
"status": 404
}
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Bad request error
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "An attribute is invalid.",
"status": 400,
"detail": "This value must be of type string.",
"name": "metric"
}
This error occurs when a parameter you provided does not exist, or isn't correct for this endpoint, has an invalid value.
{
"type": "https://docs.api.video/reference/request-invalid-query-parameter",
"title": "A query parameter is invalid.",
"status": 400,
"detail": "This field was not expected.",
"name": "from:2024-05-20T09:15:05+02:00"
}
This error occurs when a query parameter you provided does not exist, isn't correct for this endpoint, or has an invalid value.
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
detail
string
A solution for the error.
name
string
The name of the parameter that caused the error.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
context
object (context)
required
metric
string
Returns the metric you selected.
aggregation
string
Returns the aggregation you selected.
timeframe
object (timeframe)
Returns the starting and ending date-times of the period you want analytics for.
from
string
Returns the starting date-time of the period you want analytics for in ATOM date-time format.
to
string
Returns the starting date-time of the period you want analytics for in ATOM date-time format.
data
number
required
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Retrieve detailed analytics play-rate and number of impressions segmented by dimensions like country or device type.
/data/buckets/{metric}/{breakdown}
from
string
Use this query parameter to define the starting date-time of the period you want analytics for.
from
, the default assigned value is 1 day ago, based on the to
parameter.2024-02-05T00:00:00+01:00
to
string
Use this query parameter to define the ending date-time of the period you want analytics for.
to
, the default assigned value is now
.to
is a non-inclusive value: the API returns data before the date-time that you set. filterBy
string
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. You must use camelCase
for query parameters.
filterBy
, the API returns the full dataset for your project.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. 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.deviceType
: Returns analytics based on the type of device used by the viewers. Possible response values are: computer
, phone
, tablet
, tv
, console
, wearable
, unknown
.operatingSystem
: Returns analytics based on the operating system used by the viewers. Response values include windows
, mac osx
, android
, ios
, linux
.browser
: Returns analytics based on the browser used by the viewers. Response values include chrome
, firefox
, edge
, opera
.apiKey
metric
string
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.play-rate
is the ratio that calculates the number of plays your content receives divided by its impressions.play-total
is the total number of times a specific content has been played. You can only use the media-id
breakdown with this metric.start
is the number of times playback was started.end
is the number of times playback has ended with the content watch until the end.impression
is the number of times your content has been loaded and was ready for playback. breakdown
string
required
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. 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.device-type
: Returns analytics based on the type of device used by the viewers. Possible response values are: computer
, phone
, tablet
, tv
, console
, wearable
, unknown
.operating-system
: Returns analytics based on the operating system used by the viewers. Response values include windows
, mac osx
, android
, ios
, linux
.browser
: Returns analytics based on the browser used by the viewers. Response values include chrome
, firefox
, edge
, opera
.Success
{
"context": {
"metric": "play",
"breakdown": "country",
"timeframe": {
"from": "2024-04-28T07:15:05+00:00",
"to": "2024-05-29T11:25:37+00:00"
}
},
"data": [
{
"metricValue": 7,
"dimensionValue": "FR"
}
],
"pagination": {
"currentPage": 1,
"currentPageItems": 1,
"pageSize": 25,
"pagesTotal": 1,
"itemsTotal": 1,
"links": [
{
"rel": "self",
"uri": "/data/buckets/play/country?from=2024-04-28T09%3A15%3A05%2B02%3A00¤tPage=1&pageSize=25"
},
{
"rel": "first",
"uri": "/data/buckets/play/country?from=2024-04-28T09%3A15%3A05%2B02%3A00¤tPage=1&pageSize=25"
},
{
"rel": "last",
"uri": "/data/buckets/play/country?from=2024-04-28T09%3A15%3A05%2B02%3A00¤tPage=1&pageSize=25"
}
]
}
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Unrecognized request URL
{
"type": "https://docs.api.video/reference/unrecognized-request-url",
"title": "Unrecognized request URL.",
"status": 404
}
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Bad request error
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "An attribute is invalid.",
"status": 400,
"detail": "This value must be of type string.",
"name": "metric"
}
This error occurs when a parameter you provided does not exist, or isn't correct for this endpoint, has an invalid value.
{
"type": "https://docs.api.video/reference/request-invalid-query-parameter",
"title": "A query parameter is invalid.",
"status": 400,
"detail": "This field was not expected.",
"name": "from:2024-05-20T09:15:05+02:00"
}
This error occurs when a query parameter you provided does not exist, isn't correct for this endpoint, or has an invalid value.
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
detail
string
A solution for the error.
name
string
The name of the parameter that caused the error.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
context
object (context)
required
metric
string
Returns the metric you selected.
breakdown
string
Returns the dimension you selected.
timeframe
object (timeframe)
Returns the starting and ending date-times of the period you want analytics for.
from
string
Returns the starting date-time of the period you want analytics for in ATOM date-time format.
to
string
Returns the starting date-time of the period you want analytics for in ATOM date-time format.
data
array[object]
required
Returns an array of dimensions and their respective metrics.
object
dimensionValue
string
Returns a specific value for the dimension you selected, based on the data. For example if you select continent
as a dimension, then dimensionValue
returns values like EU
or "AZ".
metricValue
number
Returns the data for a specific dimension value.
pagination
object (pagination)
required
itemsTotal
int
Total number of items that exist.
pagesTotal
int
Number of items listed in the current page.
pageSize
int
Maximum number of item per page.
currentPage
int
The current page index.
currentPageItems
int
The number of items on the current page.
links
array[object (PaginationLink)]
required
PaginationLink
object (PaginationLink)
rel
string
uri
string
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Retrieve countable metrics like the number of plays or impressions, grouped by the time at which they occurred
/data/timeseries/{metric}
from
string
Use this query parameter to define the starting date-time of the period you want analytics for.
from
, the default assigned value is 1 day ago, based on the to
parameter.2024-02-05T00:00:00+01:00
to
string
Use this query parameter to define the ending date-time of the period you want analytics for.
to
, the default assigned value is now
.to
is a non-inclusive value: the API returns data before the date-time that you set. interval
string
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
.
filterBy
string
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. You must use camelCase
for query parameters.
filterBy
, the API returns the full dataset for your project.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. 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.deviceType
: Returns analytics based on the type of device used by the viewers. Possible response values are: computer
, phone
, tablet
, tv
, console
, wearable
, unknown
.operatingSystem
: Returns analytics based on the operating system used by the viewers. Response values include windows
, mac osx
, android
, ios
, linux
.browser
: Returns analytics based on the browser used by the viewers. Response values include chrome
, firefox
, edge
, opera
.apiKey
metric
string
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.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.Success
{
"context": {
"metric": "play",
"interval": "hour",
"timeframe": {
"from": "2024-05-28T11:08:39+00:00",
"to": "2024-05-29T11:08:39+00:00"
}
},
"data": [
{
"emittedAt": "2024-05-29T07:00:00+00:00",
"metricValue": 2
},
{
"emittedAt": "2024-05-29T08:00:00+00:00",
"metricValue": 1
},
{
"emittedAt": "2024-05-29T09:00:00+00:00",
"metricValue": 1
}
],
"pagination": {
"currentPage": 1,
"currentPageItems": 3,
"pageSize": 25,
"pagesTotal": 1,
"itemsTotal": 3,
"links": [
{
"rel": "self",
"uri": "/data/timeseries/play?currentPage=1&pageSize=25"
},
{
"rel": "first",
"uri": "/data/timeseries/play?currentPage=1&pageSize=25"
},
{
"rel": "last",
"uri": "/data/timeseries/play?currentPage=1&pageSize=25"
}
]
}
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Unrecognized request URL
{
"type": "https://docs.api.video/reference/unrecognized-request-url",
"title": "Unrecognized request URL.",
"status": 404
}
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Bad request error
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "An attribute is invalid.",
"status": 400,
"detail": "This value must be of type string.",
"name": "metric"
}
This error occurs when a parameter you provided does not exist, or isn't correct for this endpoint, has an invalid value.
{
"type": "https://docs.api.video/reference/request-invalid-query-parameter",
"title": "A query parameter is invalid.",
"status": 400,
"detail": "This field was not expected.",
"name": "from:2024-05-20T09:15:05+02:00"
}
This error occurs when a query parameter you provided does not exist, isn't correct for this endpoint, or has an invalid value.
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
detail
string
A solution for the error.
name
string
The name of the parameter that caused the error.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
context
object (context)
required
metric
string
Returns the metric you selected.
interval
string
Returns the interval you selected.
timeframe
object (timeframe)
Returns the starting and ending date-times of the period you want analytics for.
from
string
Returns the starting date-time of the period you want analytics for in ATOM date-time format.
to
string
Returns the starting date-time of the period you want analytics for in ATOM date-time format.
data
array[object]
required
Returns an array of metrics and the timestamps .
object
emittedAt
string
Returns the timestamp of the event that belongs to a specific metric in ATOM date-time format. For example, if you set play
with an hour
interval in your request, then emittedAt
returns the hourly timestamps of every play event within the timeframe you defined.
metricValue
number
Returns the data for a specific metric value.
pagination
object (pagination)
required
itemsTotal
int
Total number of items that exist.
pagesTotal
int
Number of items listed in the current page.
pageSize
int
Maximum number of item per page.
currentPage
int
The current page index.
currentPageItems
int
The number of items on the current page.
links
array[object (PaginationLink)]
required
PaginationLink
object (PaginationLink)
rel
string
uri
string
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Was this page helpful?