General Guidelines

  • To query for totals or averages of metrics over any time range, use the following parameters in the API call:

    • dimension=all

    • count=1

    • agg=1

  • To query for totals or averages of metrics over any time range grouped by different values of a dimension, use the following parameters in the API call:

    • dimension=<name_of_dimension>

    • count=1

    • agg=1

    • aggby=<name_of_primary_metric>

    For example, to query for total plays per asset, use the following parameters in the API call: dimension=asset&count=1&agg=1&aggby=assetid

  • To query for timeline trends, use the following parameters in the API call:

    • metrics=timestamp,<all_other_metrics>

    • agg=1

    • orderby=timestamp

  • To filter data on a particular dimension, use the following parameters in the API call:

    • metrics=<filter_metric_name>

    • filter=<filter_metric_name><operator><value>

    • count=1

    • agg=1

    For example, to filter data of “GameOfThrones” asset, use the following parameters in the API call: metrics=assetid&dimension=asset&count=1&agg=1&filter=assetid=GameOfThrones

  • To query for totals or averages of metrics for a particular dimension value, use:

    • dimension=<name_of_dimension>

    • count=1

    • agg=1

    • filter=<metric name><operator><value>

    For example, to query for total play time of “GameOfThrones” asset, use the following parameters in the API call: metrics=assetid,playdur&dimension=asset&count=1&agg=1&filter=assetid=GameOfThrones

  • To sort responses, use:

    • orderby=<metric_name>

    • orderas=DESC or orderas=ASC

    The orderas parameter accepts DESC and ASC and is case-sensitive.

  • Always add the metrics used in filter, aggby and orderby parameters in the metrics parameter for them to be effective.

Last updated