{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adanos-market-sentiment-api/json-schema/adanos-market-sentiment-api-xtrending-stock-schema.json",
  "title": "XTrendingStock",
  "description": "Trending stock on X/Twitter - unified format matching Reddit API structure.\n\nV5.5: Uses real tweet data from x_mentions (collected via twscrape).\nAuthor diversity now prefers HHI-based effective authors from\nauthor_distribution and falls back to scaled unique_authors only when the\nfull distribution is unavailable.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adanos-market-sentiment-api-x-twitter-stocks-api-openapi.yml#/components/schemas/XTrendingStock",
  "properties": {
    "ticker": {
      "type": "string",
      "title": "Ticker",
      "description": "Stock ticker symbol"
    },
    "company_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Company Name",
      "description": "Company name from ticker_reference"
    },
    "buzz_score": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 100.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Buzz Score",
      "description": "V5.5 buzz score from real tweet data. Components: mentions (20), sentiment (20), quality (10), author diversity (14, HHI-based when author_distribution is available, else scaled unique_authors), trend (-10 to +20). Asymptotic scaling caps at 100."
    },
    "trend": {
      "type": "string",
      "enum": [
        "rising",
        "falling",
        "stable"
      ],
      "title": "Trend",
      "description": "Activity momentum over the current 3 UTC days vs previous 3 UTC days, not price movement or Grok rank movement."
    },
    "mentions": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Mentions",
      "description": "Number of tweet mentions from x_mentions table"
    },
    "sentiment_score": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 1.0,
          "minimum": -1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Sentiment Score",
      "description": "Average sentiment score from tweet analysis (-1 to +1)"
    },
    "bullish_pct": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Bullish Pct",
      "description": "Percentage of bullish tweet mentions"
    },
    "bearish_pct": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Bearish Pct",
      "description": "Percentage of bearish tweet mentions"
    },
    "total_upvotes": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Total Upvotes",
      "description": "Total likes across all tweet mentions"
    },
    "unique_tweets": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Unique Tweets",
      "description": "Number of unique tweets mentioning this ticker (distinct tweet_id)"
    },
    "trend_history": {
      "items": {
        "type": "number"
      },
      "type": "array",
      "title": "Trend History",
      "description": "Daily buzz scores (oldest→newest). Length follows the resolved period, with a minimum of 7 values. For live windows, the final value is the current live buzz_score; closed historical windows end at `to`."
    }
  },
  "type": "object",
  "required": [
    "ticker",
    "buzz_score",
    "trend",
    "mentions"
  ]
}