Aggregated Data

This endpoint retrieves aggregated data of the given metrics.

Body
application/json
  • aggregate
    Type: array object[]
    required

    Aggregate multiple metrics at the same time

  • timeframe
    Type: object
    required

    The timeframe to get the data for. Currently we only support maximum difference between start_at and end_at to be 60 days

  • workspace_id
    Type: string
    required

    The unique identifier of the Gumlet workspace ID available on the Video Workspaces.

  • filters
    Type: array object[]

    Get aggregations for metrics with multiple filters, value should be an exact match

Responses
  • application/json
  • application/json
  • application/json
Request Example for post/insights/aggregated-data
import Gumlet from '@gumlet/nodejs-sdk';

const client = new Gumlet({
  apiKey: process.env['API_KEY'], // defaults to the API_KEY env var
});

const videoAnalytic = await client.videoAnalytics.aggregatedData({
  aggregate: [
    {
      metric: 'views',
      function: 'sum',
    },
  ],
  workspace_id: '',
  timeframe: {},
});

console.log(videoAnalytic);
{
  "views": {
    "sum": {
      "value": 79,
      "unit": "views"
    }
  }
}