analytics

Fetches an analytics report over a custom date range

Changed on

Fetches an analytics report over a custom date range

post/v2/sites/{site_id}/analytics/queries/

Request

  • Base URL
    https://api.jwplayer.com
  • URL
    https://api.jwplayer.com/v2/sites/{site_id}/analytics/queries/
  • Auth
    API key in header Authorization

Path parameters

site_idstring required

Unique identifier for a resource

Example:Ny05CEfj

Unique alphanumeric ID of the site

Query parameters

source'default' | 'ott'

Data set against which to run the request query

The default option includes <a href="https://docs.jwplayer.com/platform/docs/analytics-metrics-and-dimensions" target="_blank">all JWX data</a>, excluding OTT data.

The ott option (OTT data) includes the following subset of dimensions and metrics:

DIMENSIONS

  • country_code
  • custom_parameter_name
  • custom_parameter_value
  • eastern_date
  • media_id
  • platform_id
  • playlist_id
  • playlist_type
  • tag
  • upload_date
  • video_duration

METRICS

  • ad_impressions
  • ads_per_viewer
  • completes
  • complete_rate
  • logged_in_unique_viewers
  • plays
  • plays_per_viewer
  • time_watched
  • time_watched_per_viewer
  • unique_viewers
format'json' | 'csv'

File type of the response query output

Request body

dimensionsstring[]

Dimensions to include in the report query response

end_datestring required

Last date of a query date range in YYYY-MM-DD format

This date is based on UTC -4/ UTC -5. Time zone is affected by whether daylight saving time or standard time is in effect.

include_metadatainteger

Indicates that eligible dimensions are enriched with additional metadata

Depending on the dimension, enriched metadata appears either in the includes or metadata.name object of the query response.

This feature requires an Enterprise account.

Possible Values:

  • 0: Do not include enriched metadata
  • 1: Include enriched metadata

Default: 0

pageinteger

Index of the page of results

The value of the first page of results is 0. The number of total pages is inversely related to the page_length.

page_lengthinteger

(JSON only) Total number of records returned on each page of results

If not set, the default value is 10. This value must be ≤ 100.

relative_timeframe'7 Days' | '30 Days' | '90 Days' | 'Last Quarter' | 'Month To Date' | 'Today' | 'Yesterday'

Preconfigured time range for a report query

start_datestring required

First date of a query date range in YYYY-MM-DD format

This date is based on UTC -4/ UTC -5. Time zone is affected by whether daylight saving time or standard time is in effect.

Response

Resources successfully retrieved

pageinteger

Index of the page of results

The value of the first page of results is 0. The number of total pages is inversely related to the page_length.

page_lengthinteger

(JSON only) Total number of records returned on each page of results

If not set, the default value is 10. This value must be ≤ 100.

typestring

Changes