{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-video/json-schema/api-video-analytics-metrics-over-time-response-schema.json",
  "title": "Analytics response for metrics over time",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-video-analytics-api-openapi.yml#/components/schemas/analytics-metrics-over-time-response",
  "type": "object",
  "properties": {
    "context": {
      "type": "object",
      "properties": {
        "metric": {
          "description": "Returns the metric and relevant parameters you selected.",
          "type": "string",
          "enum": [
            "play",
            "play-rate",
            "start",
            "end",
            "impression",
            "ccv-average",
            "ccv-peak",
            "unique-ccv-average",
            "unique-ccv-peak",
            "view-3",
            "view-5",
            "view-10",
            "view-30",
            "unique-view",
            "unique-view-3",
            "unique-view-5",
            "unique-view-10",
            "unique-view-30"
          ]
        },
        "interval": {
          "description": "Returns the interval you selected.",
          "type": "string",
          "enum": [
            "minute",
            "hour",
            "day"
          ]
        },
        "timeframe": {
          "description": "Returns the starting and ending date-times of the period you want analytics for.",
          "type": "object",
          "properties": {
            "from": {
              "description": "Returns the starting date-time of the period you want analytics for in ATOM date-time format.",
              "type": "string",
              "format": "date-time"
            },
            "to": {
              "description": "Returns the starting date-time of the period you want analytics for in ATOM date-time format.",
              "type": "string",
              "format": "date-time"
            }
          }
        }
      }
    },
    "data": {
      "description": "Returns an array of metrics and the timestamps.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "emittedAt": {
            "description": "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.",
            "type": "string"
          },
          "metricValue": {
            "description": "Returns the data for a specific metric value.",
            "type": "number",
            "format": "float"
          }
        }
      }
    },
    "pagination": {
      "$ref": "#/$defs/pagination"
    }
  },
  "required": [
    "context",
    "data",
    "pagination"
  ],
  "$defs": {
    "pagination": {
      "title": "Pagination",
      "required": [
        "links"
      ],
      "type": "object",
      "properties": {
        "itemsTotal": {
          "type": "integer",
          "description": "Total number of items that exist.",
          "readOnly": true
        },
        "pagesTotal": {
          "type": "integer",
          "description": "Number of items listed in the current page.",
          "readOnly": true
        },
        "pageSize": {
          "type": "integer",
          "description": "Maximum number of item per page.",
          "readOnly": true
        },
        "currentPage": {
          "type": "integer",
          "description": "The current page index.",
          "readOnly": true
        },
        "currentPageItems": {
          "type": "integer",
          "description": "The number of items on the current page.",
          "readOnly": true
        },
        "links": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/pagination-link"
          }
        }
      }
    },
    "pagination-link": {
      "title": "PaginationLink",
      "type": "object",
      "properties": {
        "rel": {
          "type": "string"
        },
        "uri": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}