{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/creatordb-app/json-schema/creatordb-app-youtube-performance-history-data-schema.json",
  "title": "YoutubePerformanceHistoryData",
  "description": "The YouTube performance historical data.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/creatordb-app-openapi.yaml#/components/schemas/YoutubePerformanceHistoryData",
  "type": "object",
  "properties": {
    "histories": {
      "type": "array",
      "description": "Historical performance snapshots, each containing metrics and a corresponding Unix timestamp in milliseconds.",
      "items": {
        "type": "object",
        "description": "A single historical performance snapshot containing metrics and a corresponding Unix timestamp in milliseconds.",
        "properties": {
          "timestamp": {
            "type": "integer",
            "description": "The performance snapshot date, represented as a Unix timestamp in milliseconds.",
            "minimum": 0
          },
          "totalSubscribers": {
            "type": "integer",
            "description": "Total number of subscribers.",
            "minimum": 0
          },
          "totalContents": {
            "type": "integer",
            "description": "Total number of videos and shorts.",
            "minimum": 0
          },
          "videosPerformanceAll": {
            "type": "object",
            "description": "Performance metrics for the last 800 YouTube videos.",
            "properties": {
              "likes": {
                "type": "object",
                "description": "Likes statistics for the last 800 YouTube videos.",
                "properties": {
                  "all": {
                    "type": "integer",
                    "description": "Total number of likes across the last 800 YouTube videos.",
                    "minimum": 0
                  },
                  "avg": {
                    "type": "integer",
                    "description": "Average likes per video for up to the last 800 videos, rounded to an integer.",
                    "minimum": 0
                  },
                  "median": {
                    "type": "integer",
                    "description": "Median number of likes across the last 800 videos.",
                    "minimum": 0
                  },
                  "min": {
                    "type": "integer",
                    "description": "Minimum number of likes across the last 800 videos.",
                    "minimum": 0
                  },
                  "max": {
                    "type": "integer",
                    "description": "Maximum number of likes across the last 800 videos.",
                    "minimum": 0
                  }
                },
                "required": [
                  "all",
                  "avg",
                  "median",
                  "min",
                  "max"
                ]
              },
              "comments": {
                "type": "object",
                "description": "Comments statistics for the last 800 YouTube videos.",
                "properties": {
                  "all": {
                    "type": "integer",
                    "description": "Total number of comments across the last 800 videos.",
                    "minimum": 0
                  },
                  "avg": {
                    "type": "integer",
                    "description": "Average comments per video for the last 800 videos, rounded to an integer.",
                    "minimum": 0
                  },
                  "median": {
                    "type": "integer",
                    "description": "Median number of comments across the last 800 videos.",
                    "minimum": 0
                  },
                  "min": {
                    "type": "integer",
                    "description": "Minimum number of comments across the last 800 YouTube videos.",
                    "minimum": 0
                  },
                  "max": {
                    "type": "integer",
                    "description": "Maximum number of comments across the last 800 YouTube videos.",
                    "minimum": 0
                  }
                },
                "required": [
                  "all",
                  "avg",
                  "median",
                  "min",
                  "max"
                ]
              },
              "views": {
                "type": "object",
                "description": "Views statistics for the last 800 YouTube videos.",
                "properties": {
                  "all": {
                    "type": "integer",
                    "description": "Total number of views across the last 800 videos.",
                    "minimum": 0
                  },
                  "avg": {
                    "type": "integer",
                    "description": "Average views per video for the last 800 videos, rounded to an integer.",
                    "minimum": 0
                  },
                  "median": {
                    "type": "integer",
                    "description": "Median number of views across the last 800 videos.",
                    "minimum": 0
                  },
                  "min": {
                    "type": "integer",
                    "description": "Minimum number of views across the last 800 videos.",
                    "minimum": 0
                  },
                  "max": {
                    "type": "integer",
                    "description": "Maximum number of views across the last 800 videos.",
                    "minimum": 0
                  },
                  "percentile25": {
                    "type": "integer",
                    "description": "The 25th percentile (first quartile) of views across the last 800 videos.",
                    "minimum": 0
                  },
                  "percentile75": {
                    "type": "integer",
                    "description": "The 75th percentile (third quartile) of views across the last 800 videos.",
                    "minimum": 0
                  },
                  "iqr": {
                    "type": "integer",
                    "description": "Interquartile range (IQR) of views, calculated as 25th to 75th percentile, representing the spread of the middle 50%.",
                    "minimum": 0
                  }
                },
                "required": [
                  "all",
                  "avg",
                  "median",
                  "min",
                  "max",
                  "percentile25",
                  "percentile75",
                  "iqr"
                ]
              },
              "length": {
                "type": "object",
                "description": "Length statistics for the last 800 YouTube videos.",
                "properties": {
                  "avg": {
                    "type": "integer",
                    "description": "Average video length in seconds, rounded to an integer.",
                    "minimum": 0
                  }
                },
                "required": [
                  "avg"
                ]
              },
              "engagement": {
                "type": "object",
                "description": "Engagement metrics for the last 800 videos.",
                "properties": {
                  "avgEngagementRate": {
                    "type": "number",
                    "description": "Average engagement rate per video, rounded to 4th decimal place <br />\n- *Engagement Rate = (Likes + Comments)/Views*.",
                    "minimum": 0
                  },
                  "likesPerSubscriber": {
                    "type": "number",
                    "description": "Average likes per subscriber for the last 800 videos, rounded to 4th decimal place.",
                    "minimum": 0
                  },
                  "commentsPerSubscriber": {
                    "type": "number",
                    "description": "Average comments per subscriber for the last 800 videos, rounded to 4th decimal place.",
                    "minimum": 0
                  },
                  "viewsPerSubscriber": {
                    "type": "number",
                    "description": "Average views per subscriber for the last 800 videos, rounded to 4th decimal place.",
                    "minimum": 0
                  },
                  "engagementConsistency": {
                    "type": "object",
                    "description": "Consistency of engagement performance across the last 800 videos.",
                    "properties": {
                      "cv": {
                        "type": "number",
                        "description": "*cv &#61; Standard Deviation of Engagement Rate/Mean Engagement Rate* <br />\n- The value is rounded to 4th decimal place. <br />\n- Lower values indicate more consistent performance. <br />\n- *A value of `0` indicates insufficient data.*",
                        "minimum": 0
                      },
                      "medianVsMean": {
                        "type": "number",
                        "description": "*medianVsMean &#61;  Median Engagement Rate/Mean Engagement Rate* <br />\n - The value is rounded to 4th decimal place. <br />\n - Values closer to `1` indicate more consistent performance. <br />\n - *A value of `0` indicates insufficient data.*",
                        "minimum": 0
                      },
                      "topBottomRatio": {
                        "type": "number",
                        "description": "*topBottomRatio &#61; avg(Top 3 Engagement)/avg(Bottom 3 Engagement)* <br />\n- The value is rounded to 4th decimal place. <br />\n- Lower ratios indicate more consistent performance. <br />\n- *A value of `0` indicates insufficient data.*",
                        "minimum": 0
                      },
                      "consistencyScore": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "*consistencyScore &#61; 100 - [(cvScore\\*weight_cv) + (topBottomScore\\*weight_topBottom) + (medianVsMeanScore\\*weight_medianVsMean)]* <br />\n- The score is rounded to an integer. <br />\n- A higher score indicates more stable and consistent performance. <br />\n- If any of the three indicators is `0`, the `consistencyScore` will be `null`.",
                        "minimum": 0,
                        "maximum": 100
                      },
                      "consistencyLevel": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "high",
                          "moderate",
                          "low",
                          null
                        ],
                        "description": "A qualitative label based on the `consistencyScore`: <br />\n- high: 81 - 100 <br />\n- moderate: 51 - 80 <br />\n- low: 0 - 50 <br />\n- Returns `null` when `consistencyScore` is `null`."
                      }
                    },
                    "required": [
                      "cv",
                      "medianVsMean",
                      "topBottomRatio",
                      "consistencyScore",
                      "consistencyLevel"
                    ]
                  }
                },
                "required": [
                  "avgEngagementRate",
                  "likesPerSubscriber",
                  "commentsPerSubscriber",
                  "viewsPerSubscriber",
                  "engagementConsistency"
                ]
              }
            },
            "required": [
              "likes",
              "comments",
              "views",
              "length",
              "engagement"
            ]
          },
          "shortsPerformanceAll": {
            "type": "object",
            "description": "Performance metrics for the last 800 YouTube shorts.",
            "properties": {
              "likes": {
                "type": "object",
                "description": "Likes statistics for the last 800 YouTube shorts.",
                "properties": {
                  "all": {
                    "type": "integer",
                    "description": "Total number of likes across the last 800 shorts.",
                    "minimum": 0
                  },
                  "avg": {
                    "type": "integer",
                    "description": "Average likes per short for the last 800 shorts, rounded to an integer.",
                    "minimum": 0
                  },
                  "median": {
                    "type": "integer",
                    "description": "The median number of likes across the last 800 shorts.",
                    "minimum": 0
                  },
                  "min": {
                    "type": "integer",
                    "description": "The minimum number of likes across the last 800 shorts.",
                    "minimum": 0
                  },
                  "max": {
                    "type": "integer",
                    "description": "The maximum number of likes across the last 800 shorts.",
                    "minimum": 0
                  }
                },
                "required": [
                  "all",
                  "avg",
                  "median",
                  "min",
                  "max"
                ]
              },
              "comments": {
                "type": "object",
                "description": "Comments statistics for the last 800 YouTube shorts.",
                "properties": {
                  "all": {
                    "type": "integer",
                    "description": "Total number of comments across the last 800 shorts.",
                    "minimum": 0
                  },
                  "avg": {
                    "type": "integer",
                    "description": "Average comments per short for the last 800 shorts, rounded to an integer.",
                    "minimum": 0
                  },
                  "median": {
                    "type": "integer",
                    "description": "Median number of comments across the last 800 shorts.",
                    "minimum": 0
                  },
                  "min": {
                    "type": "integer",
                    "description": "Minimum number of comments across the last 800 shorts.",
                    "minimum": 0
                  },
                  "max": {
                    "type": "integer",
                    "description": "Maximum number of comments across the last 800 shorts.",
                    "minimum": 0
                  }
                },
                "required": [
                  "all",
                  "avg",
                  "median",
                  "min",
                  "max"
                ]
              },
              "views": {
                "type": "object",
                "description": "Views statistics for the last 800 shorts.",
                "properties": {
                  "all": {
                    "type": "integer",
                    "description": "Total number of views across the last 800 shorts.",
                    "minimum": 0
                  },
                  "avg": {
                    "type": "integer",
                    "description": "Average views per short for the last 800 shorts, rounded to an integer.",
                    "minimum": 0
                  },
                  "median": {
                    "type": "integer",
                    "description": "Median number of views across the last 800 shorts.",
                    "minimum": 0
                  },
                  "min": {
                    "type": "integer",
                    "description": "Minimum number of views across the last 800 shorts.",
                    "minimum": 0
                  },
                  "max": {
                    "type": "integer",
                    "description": "Maximum number of views across the last 800 shorts.",
                    "minimum": 0
                  },
                  "percentile25": {
                    "type": "integer",
                    "description": "The 25th percentile (first quartile) of views across the last 800 shorts.",
                    "minimum": 0
                  },
                  "percentile75": {
                    "type": "integer",
                    "description": "The 75th percentile (third quartile) of views across the last 800 shorts.",
                    "minimum": 0
                  },
                  "iqr": {
                    "type": "integer",
                    "description": "Interquartile range (IQR) of views, calculated as 25th to 75th percentile, representing the spread of the middle 50%.",
                    "minimum": 0
                  }
                },
                "required": [
                  "all",
                  "avg",
                  "median",
                  "min",
                  "max",
                  "percentile25",
                  "percentile75",
                  "iqr"
                ]
              },
              "length": {
                "type": "object",
                "description": "Length statistics for the last 800 YouTube shorts.",
                "properties": {
                  "avg": {
                    "type": "integer",
                    "description": "Average shorts length in seconds, rounded to an integer.",
                    "minimum": 0
                  }
                },
                "required": [
                  "avg"
                ]
              },
              "engagement": {
                "type": "object",
                "description": "Engagement metrics for the last 800 shorts.",
                "properties": {
                  "avgEngagementRate": {
                    "type": "number",
                    "description": "Average engagement rate per short, rounded to 4th decimal place. <br />\n- *Engagement Rate = (Likes + Comments)/ Views*.",
                    "minimum": 0
                  },
                  "likesPerSubscriber": {
                    "type": "number",
                    "description": "Average likes per subscriber for the last 800 shorts, rounded to 4th decimal place.",
                    "minimum": 0
                  },
                  "commentsPerSubscriber": {
                    "type": "number",
                    "description": "Average comments per subscriber for the last 800 shorts, rounded to 4th decimal place.",
                    "minimum": 0
                  },
                  "viewsPerSubscriber": {
                    "type": "number",
                    "description": "Average views per subscriber for the last 800 shorts, rounded to 4th decimal place.",
                    "minimum": 0
                  },
                  "engagementConsistency": {
                    "type": "object",
                    "description": "Consistency of engagement performance across the last 800 shorts.",
                    "properties": {
                      "cv": {
                        "type": "number",
                        "description": "*cv &#61; Standard Deviation of Engagement Rate/ Mean Engagement Rate* <br />\n- The value is rounded to 4th decimal place. <br />\n- Lower values indicate more consistent performance. <br />\n- *A value of `0` indicates insufficient data.*",
                        "minimum": 0
                      },
                      "medianVsMean": {
                        "type": "number",
                        "description": "*medianVsMean &#61; Median Engagement Rate/ Mean Engagement Rate* <br />\n- The value is rounded to 4th decimal place. <br />\n- Values closer to `1` indicate more consistent performance. <br />\n- *A value of `0` indicates insufficient data.*",
                        "minimum": 0
                      },
                      "topBottomRatio": {
                        "type": "number",
                        "description": "*topBottomRatio &#61; avg(Top 3 Engagement)/avg(Bottom 3 Engagement)* <br />\n- The value is rounded to 4th decimal place <br />\n- Lower ratios indicate more consistent performance <br />\n- *A value of `0` indicates insufficient data.*",
                        "minimum": 0
                      },
                      "consistencyScore": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "description": "*consistencyScore &#61; 100 - [(cvScore\\*weight_cv) + (topBottomScore\\*weight_topBottom) + (medianVsMeanScore\\*weight_medianVsMean)]* <br />\n- The score is rounded to an integer. <br />\n- A higher score indicates more stable and consistent performance. <br />\n- If any of the three indicators is `0`, the `consistencyScore` will be `null`.",
                        "minimum": 0,
                        "maximum": 100
                      },
                      "consistencyLevel": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "high",
                          "moderate",
                          "low",
                          null
                        ],
                        "description": "A qualitative label based on the `consistencyScore`: <br />\n- high: 81 - 100 <br />\n- moderate: 51 - 80 <br />\n- low: 0 - 50 <br />\n- Returns `null` when `consistencyScore` is `null`."
                      }
                    },
                    "required": [
                      "cv",
                      "medianVsMean",
                      "topBottomRatio",
                      "consistencyScore",
                      "consistencyLevel"
                    ]
                  }
                },
                "required": [
                  "avgEngagementRate",
                  "likesPerSubscriber",
                  "commentsPerSubscriber",
                  "viewsPerSubscriber",
                  "engagementConsistency"
                ]
              }
            },
            "required": [
              "likes",
              "comments",
              "views",
              "length",
              "engagement"
            ]
          }
        },
        "required": [
          "timestamp",
          "totalSubscribers",
          "totalContents",
          "videosPerformanceAll",
          "shortsPerformanceAll"
        ]
      }
    }
  },
  "required": [
    "histories"
  ]
}