{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/createmod-com/json-schema/createmod-com-schematic-stats-response-schema.json",
  "title": "SchematicStatsResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/createmod-com-openapi.yml#/components/schemas/SchematicStatsResponse",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "total_views": {
      "type": "integer"
    },
    "total_downloads": {
      "type": "integer"
    },
    "comments": {
      "type": "integer",
      "format": "int64"
    },
    "vd_ratio": {
      "type": "number",
      "format": "float",
      "description": "Downloads / views ratio (0 to 1)"
    },
    "site_avg_vd_ratio": {
      "type": "number",
      "format": "float",
      "description": "Site-wide average downloads/views ratio"
    },
    "has_video": {
      "type": "boolean"
    },
    "views": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HourlyStat"
      },
      "description": "Hourly view counts for the last 30 days"
    },
    "downloads": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HourlyStat"
      },
      "description": "Hourly download counts"
    },
    "video_plays": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HourlyStat"
      },
      "description": "Hourly video play counts (only present if has_video is true)"
    },
    "yt_clicks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HourlyStat"
      },
      "description": "Hourly YouTube click counts (only present if has_video is true)"
    },
    "time_on_page": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HourlyStat"
      },
      "description": "Average time on page per hour (seconds)"
    },
    "layer_views": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HourlyStat"
      },
      "description": "Hourly layer viewer usage counts"
    }
  },
  "required": [
    "name",
    "title",
    "total_views",
    "total_downloads",
    "comments",
    "vd_ratio",
    "site_avg_vd_ratio",
    "has_video",
    "views",
    "downloads",
    "time_on_page",
    "layer_views"
  ],
  "$defs": {
    "HourlyStat": {
      "type": "object",
      "properties": {
        "hour": {
          "type": "string",
          "description": "Hour bucket in YYYY-MM-DD HH format (UTC)"
        },
        "count": {
          "type": "integer",
          "format": "int64",
          "description": "Value for this hour"
        }
      },
      "required": [
        "hour",
        "count"
      ]
    }
  }
}