{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/creatordb-app/json-schema/creatordb-app-tiktok-performance-data-schema.json",
  "title": "TiktokPerformanceData",
  "description": "The performance metrics.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/creatordb-app-tiktok-api-openapi.yml#/components/schemas/TiktokPerformanceData",
  "type": "object",
  "properties": {
    "contentCountByDays": {
      "type": "object",
      "description": "Published TikTok content over different time intervals.",
      "properties": {
        "7d": {
          "type": "integer",
          "description": "Number of contents published in the past 7 days.",
          "minimum": 0
        },
        "30d": {
          "type": "integer",
          "description": "Number of contents published in the past 30 days.",
          "minimum": 0
        },
        "90d": {
          "type": "integer",
          "description": "Number of contents published in the past 90 days.",
          "minimum": 0
        }
      },
      "required": [
        "7d",
        "30d",
        "90d"
      ]
    },
    "ranking": {
      "type": "object",
      "description": "Percentile rankings for various performance metrics, benchmarked at the global, country, or language level. A value of `1.0` indicates top 1%, while `0.5` represents the median.",
      "properties": {
        "totalFollowers": {
          "type": "object",
          "description": "Percentile rank of the total follower count.",
          "properties": {
            "global": {
              "type": "number",
              "description": "Percentile rank compared to all creators in CreatorDB's database.",
              "minimum": 0,
              "maximum": 1
            },
            "country": {
              "type": "number",
              "description": "Percentile rank among creators from the same country.",
              "minimum": 0,
              "maximum": 1
            },
            "language": {
              "type": "number",
              "description": "Percentile rank among creators using the same primary language.",
              "minimum": 0,
              "maximum": 1
            }
          },
          "required": [
            "global",
            "country",
            "language"
          ]
        },
        "avgViews": {
          "type": "object",
          "description": "Percentile rank of the average views per video.",
          "properties": {
            "global": {
              "type": "number",
              "description": "Percentile rank compared to all creators in CreatorDB's database.",
              "minimum": 0,
              "maximum": 1
            },
            "country": {
              "type": "number",
              "description": "Percentile rank among creators from the same country.",
              "minimum": 0,
              "maximum": 1
            },
            "language": {
              "type": "number",
              "description": "Percentile rank among creators using the same primary language.",
              "minimum": 0,
              "maximum": 1
            }
          },
          "required": [
            "global",
            "country",
            "language"
          ]
        },
        "avgEngagementRate": {
          "type": "object",
          "description": "Percentile rank of the average engagement rate.",
          "properties": {
            "global": {
              "type": "number",
              "description": "Percentile rank compared to all creators in CreatorDB's database.",
              "minimum": 0,
              "maximum": 1
            },
            "country": {
              "type": "number",
              "description": "Percentile rank among creators from the same country.",
              "minimum": 0,
              "maximum": 1
            },
            "language": {
              "type": "number",
              "description": "Percentile rank among creators using the same primary language.",
              "minimum": 0,
              "maximum": 1
            }
          },
          "required": [
            "global",
            "country",
            "language"
          ]
        }
      },
      "required": [
        "totalFollowers",
        "avgViews",
        "avgEngagementRate"
      ]
    },
    "videosPerformanceRecent": {
      "type": "object",
      "description": "Performance metrics of the creator's recent TikTok videos.",
      "properties": {
        "likes": {
          "type": "object",
          "properties": {
            "all": {
              "type": "integer",
              "description": "Total number of likes.",
              "minimum": 0
            },
            "avg": {
              "type": "integer",
              "description": "Average likes per video, rounded to an integer.",
              "minimum": 0
            },
            "median": {
              "type": "integer",
              "description": "Median number of likes.",
              "minimum": 0
            },
            "min": {
              "type": "integer",
              "description": "Minimum number of likes.",
              "minimum": 0
            },
            "max": {
              "type": "integer",
              "description": "Maximum number of likes.",
              "minimum": 0
            }
          },
          "required": [
            "all",
            "avg",
            "median",
            "min",
            "max"
          ]
        },
        "comments": {
          "type": "object",
          "properties": {
            "all": {
              "type": "integer",
              "description": "Total number of comments.",
              "minimum": 0
            },
            "avg": {
              "type": "integer",
              "description": "Average comments per video, rounded to an integer.",
              "minimum": 0
            },
            "median": {
              "type": "integer",
              "description": "Median number of comments.",
              "minimum": 0
            },
            "min": {
              "type": "integer",
              "description": "Minimum number of comments.",
              "minimum": 0
            },
            "max": {
              "type": "integer",
              "description": "Maximum number of comments.",
              "minimum": 0
            }
          },
          "required": [
            "all",
            "avg",
            "median",
            "min",
            "max"
          ]
        },
        "views": {
          "type": "object",
          "properties": {
            "all": {
              "type": "integer",
              "description": "Total number of views.",
              "minimum": 0
            },
            "avg": {
              "type": "integer",
              "description": "Average views per video, rounded to an integer.",
              "minimum": 0
            },
            "median": {
              "type": "integer",
              "description": "Median number of views.",
              "minimum": 0
            },
            "min": {
              "type": "integer",
              "description": "Minimum number of views.",
              "minimum": 0
            },
            "max": {
              "type": "integer",
              "description": "Maximum number of views.",
              "minimum": 0
            }
          },
          "required": [
            "all",
            "avg",
            "median",
            "min",
            "max"
          ]
        },
        "shares": {
          "type": "object",
          "properties": {
            "all": {
              "type": "integer",
              "description": "Total number of shares.",
              "minimum": 0
            },
            "avg": {
              "type": "integer",
              "description": "Average shares per video, rounded to an integer.",
              "minimum": 0
            },
            "median": {
              "type": "integer",
              "description": "Median number of shares.",
              "minimum": 0
            },
            "min": {
              "type": "integer",
              "description": "Minimum number of shares.",
              "minimum": 0
            },
            "max": {
              "type": "integer",
              "description": "Maximum number of shares.",
              "minimum": 0
            }
          },
          "required": [
            "all",
            "avg",
            "median",
            "min",
            "max"
          ]
        },
        "engagement": {
          "type": "object",
          "description": "Engagement performance metrics including rates, per-follower statistics and consistency analysis.",
          "properties": {
            "avgEngagementRate": {
              "type": "number",
              "description": "Average engagement rate per video, rounded to 4th decimal place. <br />\n- *Engagement Rate &#61; (Likes + Comments + Shares)/ Views*",
              "minimum": 0
            },
            "likesPerFollower": {
              "type": "number",
              "description": "Average likes per follower, rounded to 4th decimal place.",
              "minimum": 0
            },
            "commentsPerFollower": {
              "type": "number",
              "description": "Average comments per follower, rounded to 4th decimal place.",
              "minimum": 0
            },
            "viewsPerFollower": {
              "type": "number",
              "description": "Average views per follower, rounded to 4th decimal place.",
              "minimum": 0
            },
            "engagementConsistency": {
              "type": "object",
              "description": "Consistency of engagement performance.",
              "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 the `consistencyScore` is `null`."
                }
              },
              "required": [
                "cv",
                "medianVsMean",
                "topBottomRatio",
                "consistencyScore",
                "consistencyLevel"
              ]
            }
          },
          "required": [
            "avgEngagementRate",
            "likesPerFollower",
            "commentsPerFollower",
            "viewsPerFollower",
            "engagementConsistency"
          ]
        }
      },
      "required": [
        "likes",
        "comments",
        "views",
        "shares",
        "engagement"
      ]
    },
    "recentVideosGrowth": {
      "type": "object",
      "description": "Growth metrics for recent videos across 7, 30, and 90-day periods.",
      "properties": {
        "g7": {
          "type": "object",
          "description": "Growth metrics over 7 days.",
          "properties": {
            "engagementRate": {
              "type": "number",
              "description": "Growth rate of engagement rate, rounded to 4th decimal place."
            }
          },
          "required": [
            "engagementRate"
          ]
        },
        "g30": {
          "type": "object",
          "description": "Growth metrics over 30 days.",
          "properties": {
            "engagementRate": {
              "type": "number",
              "description": "Growth rate of engagement rate, rounded to 4th decimal place."
            }
          },
          "required": [
            "engagementRate"
          ]
        },
        "g90": {
          "type": "object",
          "description": "Growth metrics over 90 days.",
          "properties": {
            "engagementRate": {
              "type": "number",
              "description": "Growth rate of engagement rate, rounded to 4th decimal place."
            }
          },
          "required": [
            "engagementRate"
          ]
        }
      },
      "required": [
        "g7",
        "g30",
        "g90"
      ]
    }
  }
}