{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/slimlytics-com/json-schema/slimlytics-com-site-summary-schema.json",
  "title": "SiteSummary",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/slimlytics-com-openapi.json#/components/schemas/SiteSummary",
  "type": "object",
  "required": [
    "siteId",
    "views",
    "visitors",
    "currentOnline",
    "bounceRate",
    "avgDurationSeconds",
    "trend"
  ],
  "properties": {
    "siteId": {
      "type": "string",
      "format": "uuid"
    },
    "views": {
      "type": "integer",
      "description": "Human page views in the range"
    },
    "visitors": {
      "$ref": "#/$defs/Metric"
    },
    "currentOnline": {
      "type": "integer",
      "description": "Distinct human visitors with an event in the last five minutes"
    },
    "bounceRate": {
      "type": "number",
      "minimum": 0,
      "maximum": 100
    },
    "avgDurationSeconds": {
      "type": "number",
      "minimum": 0
    },
    "trend": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TrendPoint"
      }
    }
  },
  "$defs": {
    "Metric": {
      "type": "object",
      "required": [
        "current",
        "previous",
        "change_percent"
      ],
      "properties": {
        "current": {
          "type": "integer"
        },
        "previous": {
          "type": "integer"
        },
        "change_percent": {
          "type": [
            "number",
            "null"
          ]
        }
      }
    },
    "TrendPoint": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "date",
        "visitors",
        "pageViews"
      ],
      "properties": {
        "date": {
          "type": "string",
          "format": "date"
        },
        "visitors": {
          "type": "integer",
          "minimum": 0
        },
        "pageViews": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}