{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adanos-market-sentiment-api/json-schema/adanos-market-sentiment-api-xstock-detail-response-schema.json",
  "title": "XStockDetailResponse",
  "description": "Detailed X/Twitter data for a single stock - unified format matching Reddit API.\n\nV5.5: Uses real tweet data from x_mentions table with HHI-based effective\nauthor diversity when author_distribution is available.",
  "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/XStockDetailResponse",
  "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"
    },
    "found": {
      "type": "boolean",
      "title": "Found",
      "description": "Legacy v1 data-availability flag. `true` means this service has qualifying data for this asset/window. `false` means the asset is supported, but this service has no qualifying data for the requested window. Planned for removal in v2.",
      "default": true,
      "deprecated": true
    },
    "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 using HHI-based author diversity when author_distribution is available, else scaled unique_authors (null if not found)"
    },
    "mentions": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mentions",
      "description": "Total tweet mentions within the selected period"
    },
    "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)"
    },
    "positive_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Positive Count",
      "description": "Deprecated. Prefer bullish_pct with mentions for public analysis; retained for v1 compatibility.",
      "deprecated": true
    },
    "negative_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Negative Count",
      "description": "Deprecated. Prefer bearish_pct with mentions for public analysis; retained for v1 compatibility.",
      "deprecated": true
    },
    "neutral_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Neutral Count",
      "description": "Deprecated. Prefer bullish_pct, bearish_pct and mentions for public analysis; retained for v1 compatibility.",
      "deprecated": true
    },
    "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 (distinct tweet_id)"
    },
    "trend": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "rising",
            "falling",
            "stable"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Trend",
      "description": "Activity momentum over the current 3 UTC days vs previous 3 UTC days using mentions, likes and author breadth; not price movement or Grok rank movement. For `from`/`to`, anchors at `to` (or now when `to` is today)."
    },
    "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"
    },
    "period_days": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Period Days",
      "description": "Analysis period in days"
    },
    "daily_trend": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/XDailyTrendItem"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Daily Trend",
      "description": "Daily mention breakdown for the selected period"
    },
    "top_tweets": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/XTopTweet"
          },
          "type": "array",
          "maxItems": 10
        },
        {
          "type": "null"
        }
      ],
      "title": "Top Tweets",
      "description": "Top tweets from the selected period, ranked by engagement (likes + retweets)"
    },
    "top_authors": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/XTopAuthor"
          },
          "type": "array",
          "maxItems": 5
        },
        {
          "type": "null"
        }
      ],
      "title": "Top Authors",
      "description": "Top X authors in the selected period with mentions, sentiment_score, buzz_score and deprecated count alias"
    }
  },
  "type": "object",
  "required": [
    "ticker"
  ],
  "$defs": {
    "XDailyTrendItem": {
      "properties": {
        "date": {
          "type": "string",
          "title": "Date",
          "description": "Date in YYYY-MM-DD format"
        },
        "mentions": {
          "type": "integer",
          "title": "Mentions",
          "description": "Number of tweet mentions on this date"
        },
        "sentiment_score": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 1.0,
              "minimum": -1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Sentiment Score",
          "description": "Average sentiment score for the day"
        },
        "buzz_score": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 100.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Buzz Score",
          "description": "Buzz score for this date (0-100)"
        },
        "bullish_pct": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 100.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Bullish Pct",
          "description": "Bullish tweet percentage for this date, calculated from positive sentiment-classified tweets"
        },
        "bearish_pct": {
          "anyOf": [
            {
              "type": "integer",
              "maximum": 100.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Bearish Pct",
          "description": "Bearish tweet percentage for this date, calculated from negative sentiment-classified tweets"
        }
      },
      "type": "object",
      "required": [
        "date",
        "mentions"
      ],
      "title": "XDailyTrendItem",
      "description": "Daily trend data point for X/Twitter."
    },
    "XTopAuthor": {
      "properties": {
        "author": {
          "type": "string",
          "title": "Author",
          "description": "Public X/Twitter username"
        },
        "mentions": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Mentions",
          "description": "Tweet mentions by this author in the selected period"
        },
        "sentiment_score": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 1.0,
              "minimum": -1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Sentiment Score",
          "description": "Average sentiment score for this author's mentions in the selected period"
        },
        "buzz_score": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 100.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Buzz Score",
          "description": "Contributor-level buzz score for this author in the selected period"
        },
        "count": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Count",
          "description": "Deprecated alias for mentions. Use mentions instead.",
          "deprecated": true
        }
      },
      "type": "object",
      "required": [
        "author",
        "mentions",
        "count"
      ],
      "title": "XTopAuthor",
      "description": "X author contributor metrics for a stock detail response."
    },
    "XTopTweet": {
      "properties": {
        "text_snippet": {
          "type": "string",
          "maxLength": 280,
          "title": "Text Snippet",
          "description": "Clean tweet paragraph around the detected ticker mention (truncated to 280 chars for this view)"
        },
        "sentiment_score": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 1.0,
              "minimum": -1.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Sentiment Score",
          "description": "Sentiment score (-1 to +1)"
        },
        "sentiment_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sentiment Label",
          "description": "Sentiment label (positive/negative/neutral)"
        },
        "likes": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Likes",
          "description": "Number of likes"
        },
        "retweets": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Retweets",
          "description": "Number of retweets"
        },
        "views": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Views",
          "description": "Number of views"
        },
        "author": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Author",
          "description": "Author username"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At",
          "description": "Tweet creation time (ISO 8601)"
        }
      },
      "type": "object",
      "required": [
        "text_snippet",
        "likes",
        "retweets"
      ],
      "title": "XTopTweet",
      "description": "Top tweet mention for a stock - highest engagement tweets."
    }
  }
}