{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trendsapi-ai/json-schema/trendsapi-ai-top-trends-response-schema.json",
  "title": "TopTrendsResponse",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trendsapi-ai-openapi.json#/components/schemas/TopTrendsResponse",
  "properties": {
    "as_of_ts": {
      "format": "date-time",
      "type": "string"
    },
    "baseline_ts": {
      "description": "Present only when sort is 'rank_change'.",
      "format": "date-time",
      "type": "string"
    },
    "category": {
      "type": "string"
    },
    "count": {
      "type": "integer"
    },
    "data": {
      "items": {
        "oneOf": [
          {
            "description": "[rank, keyword] for sort='rank'.",
            "prefixItems": [
              {
                "description": "Current rank.",
                "type": "integer"
              },
              {
                "description": "Keyword or item name.",
                "type": "string"
              }
            ],
            "type": "array"
          },
          {
            "description": "Mover row for sort='rank_change'.",
            "properties": {
              "category_path": {
                "type": "string"
              },
              "keyword": {
                "type": "string"
              },
              "prev_rank": {
                "type": "integer"
              },
              "rank": {
                "type": "integer"
              },
              "rank_change": {
                "description": "Positions climbed.",
                "type": "integer"
              }
            },
            "type": "object"
          }
        ]
      },
      "type": "array"
    },
    "limit": {
      "type": "integer"
    },
    "note": {
      "description": "Present when count is 0 to explain why and what to do next.",
      "type": "string"
    },
    "sort": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "window": {
      "type": "string"
    }
  },
  "type": "object"
}