> ## Documentation Index
> Fetch the complete documentation index at: https://www.worldmonitor.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GetStockAnalysisHistory

> GetStockAnalysisHistory retrieves shared premium stock analysis history from the backend store. PRO-gated. Requires entitlement tier >= 1.



## OpenAPI

````yaml /api/MarketService.openapi.yaml get /api/market/v1/get-stock-analysis-history
openapi: 3.1.0
info:
  title: MarketService API
  version: 1.0.0
servers:
  - url: https://api.worldmonitor.app
security:
  - WorldMonitorKey: []
  - ApiKeyHeader: []
paths:
  /api/market/v1/get-stock-analysis-history:
    get:
      tags:
        - MarketService
      summary: GetStockAnalysisHistory
      description: >-
        GetStockAnalysisHistory retrieves shared premium stock analysis history
        from the backend store. PRO-gated. Requires entitlement tier >= 1.
      operationId: GetStockAnalysisHistory
      parameters:
        - name: symbols
          in: query
          description: >-
            Stock ticker symbols whose stored analysis history should be
            returned.
          required: false
          style: form
          explode: true
          example:
            - AAPL
          schema:
            type: array
            items:
              type: string
        - name: limit_per_symbol
          in: query
          description: Maximum number of history snapshots to return per symbol.
          required: false
          example: 25
          schema:
            type: integer
            format: int32
        - name: include_news
          in: query
          description: Whether history snapshots should include stored news summaries.
          required: false
          example: true
          schema:
            type: boolean
        - name: jmespath
          in: query
          description: >-
            Optional JMESPath expression applied server-side to project or
            reduce the JSON response before it is returned (mirrors the MCP
            jmespath argument). Invalid expressions, expressions larger than
            1024 UTF-8 bytes, or projections that exceed the 256 KB output cap
            return HTTP 400 with a {_jmespath_error, original_keys} envelope.
            Grammar and worked examples:
            https://www.worldmonitor.app/docs/mcp-jmespath.
          required: false
          example: keys(@)
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              example:
                items:
                  - snapshots:
                      - action: example
                        analysisAt: 1717200000000
                        analysisId: example-id
                        analystConsensus:
                          buy: 1
                          hold: 1
                          period: daily
                          sell: 1
                          strongBuy: 1
                        atr: 1.5
                    symbol: AAPL
              schema:
                $ref: '#/components/schemas/GetStockAnalysisHistoryResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationError'
                  - $ref: '#/components/schemas/JmespathProjectionError'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: PRO entitlement access denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '429':
          description: Rate limit exceeded.
          headers:
            X-RateLimit-Limit:
              description: Maximum requests allowed in the active rate-limit window.
              schema:
                type: string
            X-RateLimit-Remaining:
              description: Requests remaining in the active rate-limit window.
              schema:
                type: string
            X-RateLimit-Reset:
              description: >-
                Unix epoch milliseconds when the active rate-limit window
                resets.
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying the request.
              schema:
                type: string
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Error'
                  - $ref: '#/components/schemas/RateLimitError'
        default:
          description: Gateway or handler error response.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/Error'
                  - $ref: '#/components/schemas/GatewayError'
      security:
        - WorldMonitorKey: []
        - ApiKeyHeader: []
        - BearerAuth: []
components:
  schemas:
    GetStockAnalysisHistoryResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/StockAnalysisHistoryItem'
    ValidationError:
      type: object
      properties:
        violations:
          type: array
          items:
            $ref: '#/components/schemas/FieldViolation'
          description: List of validation violations
      required:
        - violations
      description: >-
        ValidationError is returned when request validation fails. It contains a
        list of field violations describing what went wrong.
    JmespathProjectionError:
      description: >-
        Returned when a REST jmespath projection is invalid or exceeds the
        expression/output byte limits.
      properties:
        _jmespath_error:
          description: Projection error discriminator and details.
          type: string
        original_keys:
          description: Top-level keys or shape of the unprojected response.
          items:
            type: string
          type: array
      required:
        - _jmespath_error
        - original_keys
      type: object
    UnauthorizedError:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
      required:
        - error
      description: >-
        Returned when the API key is missing, malformed, or lacks current API
        access.
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          description: Human-readable entitlement failure reason.
        requiredTier:
          type: integer
          format: int32
          description: Minimum entitlement tier required for this endpoint.
        currentTier:
          type: integer
          format: int32
          description: Caller entitlement tier when known.
        planKey:
          type: string
          description: Caller plan key when known.
      required:
        - error
      description: >-
        Returned when a PRO-gated endpoint denies access because the caller has
        no resolved authenticated user, entitlements cannot be verified, or the
        caller lacks the required entitlement tier.
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message (e.g., 'user not found', 'database connection failed')
      description: >-
        Error is returned when a handler encounters an error. It contains a
        simple error message that the developer can customize.
    RateLimitError:
      type: object
      description: Returned when a gateway or handler rate limit rejects the request.
      properties:
        error:
          type: string
          description: Human-readable rate-limit failure reason.
      required:
        - error
    GatewayError:
      type: object
      description: >-
        Returned by gateway infrastructure errors before an RPC handler runs,
        such as origin, routing, method, authentication, or quota checks.
      properties:
        error:
          oneOf:
            - type: string
            - type: object
              additionalProperties: true
          description: Gateway error reason or structured gateway failure details.
      required:
        - error
    StockAnalysisHistoryItem:
      type: object
      properties:
        symbol:
          type: string
        snapshots:
          type: array
          items:
            $ref: '#/components/schemas/AnalyzeStockResponse'
    FieldViolation:
      type: object
      properties:
        field:
          type: string
          description: >-
            The field path that failed validation (e.g., 'user.email' for nested
            fields). For header validation, this will be the header name (e.g.,
            'X-API-Key')
        description:
          type: string
          description: >-
            Human-readable description of the validation violation (e.g., 'must
            be a valid email address', 'required field missing')
      required:
        - field
        - description
      description: FieldViolation describes a single validation error for a specific field.
    AnalyzeStockResponse:
      type: object
      properties:
        available:
          type: boolean
        symbol:
          type: string
        name:
          type: string
        display:
          type: string
        currency:
          type: string
        currentPrice:
          type: number
          format: double
        changePercent:
          type: number
          format: double
        signalScore:
          type: number
          format: double
          description: >-
            Technical-analysis score (0-100), retained as a stable pair with
            signal
             for clients that predate the fundamentals-blended rating.
        signal:
          type: string
          description: >-
            Technical-only signal paired with signal_score. New clients should
            use
             rating_signal with composite_score for the surfaced investment rating.
        trendStatus:
          type: string
        volumeStatus:
          type: string
        macdStatus:
          type: string
        rsiStatus:
          type: string
        summary:
          type: string
        action:
          type: string
        confidence:
          type: string
        technicalSummary:
          type: string
        newsSummary:
          type: string
        whyNow:
          type: string
        bullishFactors:
          type: array
          items:
            type: string
        riskFactors:
          type: array
          items:
            type: string
        supportLevels:
          type: array
          items:
            type: number
            format: double
        resistanceLevels:
          type: array
          items:
            type: number
            format: double
        headlines:
          type: array
          items:
            $ref: '#/components/schemas/StockAnalysisHeadline'
        ma5:
          type: number
          format: double
        ma10:
          type: number
          format: double
        ma20:
          type: number
          format: double
        ma60:
          type: number
          format: double
        biasMa5:
          type: number
          format: double
        biasMa10:
          type: number
          format: double
        biasMa20:
          type: number
          format: double
        volumeRatio5d:
          type: number
          format: double
        rsi12:
          type: number
          format: double
        macdDif:
          type: number
          format: double
        macdDea:
          type: number
          format: double
        macdBar:
          type: number
          format: double
        provider:
          type: string
        model:
          type: string
        fallback:
          type: boolean
        newsSearched:
          type: boolean
        generatedAt:
          type: string
        analysisId:
          type: string
        analysisAt:
          type: integer
          format: int64
          description: 'Warning: Values > 2^53 may lose precision in JavaScript'
        stopLoss:
          type: number
          format: double
        takeProfit:
          type: number
          format: double
        engineVersion:
          type: string
        analystConsensus:
          $ref: '#/components/schemas/AnalystConsensus'
        priceTarget:
          $ref: '#/components/schemas/PriceTarget'
        recentUpgrades:
          type: array
          items:
            $ref: '#/components/schemas/UpgradeDowngrade'
        dividendYield:
          type: number
          format: double
        trailingAnnualDividendRate:
          type: number
          format: double
        exDividendDate:
          type: integer
          format: int64
          description: 'Warning: Values > 2^53 may lose precision in JavaScript'
        payoutRatio:
          type: number
          format: double
        dividendFrequency:
          type: string
        dividendCagr:
          type: number
          format: double
        marketSession:
          type: string
          description: >-
            US-equity trading session at analysis time: "regular", "pre", "post"
            or
             "closed". Empty when session detection does not apply (non-US symbols).
        extendedPrice:
          type: number
          format: double
          description: >-
            Latest pre/post-market price from Yahoo extended-hours candles. Only
            set
             when market_session is "pre" or "post" and extended data is available.
        extendedChangePercent:
          type: number
          format: double
          description: >-
            Extended-hours change % vs the last regular-session close. Only set
            when
             extended_price is set.
        fundamentals:
          $ref: '#/components/schemas/Fundamentals'
        fundamentalScore:
          type: number
          format: double
          description: >-
            Fundamental health score (0-100) blended from the
            quality/growth/leverage
             fundamentals above. Unset when too few fundamentals are available to score,
             in which case composite_score falls back to signal_score.
        compositeScore:
          type: number
          format: double
          description: |-
            Blend of signal_score (technicals) and fundamental_score that drives
             rating_signal, so a Strong buy/sell no longer fires on price action alone.
             Equals signal_score when fundamental_score is unset.
        nextEarningsDate:
          type: string
          description: >-
            Next scheduled earnings date (YYYY-MM-DD) plus consensus EPS /
            revenue for
             the symbol, joined from the market:earnings-calendar:v1 seed. Unset when the
             symbol has no upcoming (not-yet-reported) entry in the seed's ~2-week window.
             (61-62 are taken by a concurrent PR; using 63-65 to avoid a field collision.)
        consensusEps:
          type: number
          format: double
        consensusRevenue:
          type: number
          format: double
        newsSentiment:
          type: number
          format: double
          description: >-
            LLM-derived news sentiment for the analyzed symbol: a signed score
            in
             [-1, 1] (-1 very bearish, 0 neutral / no material news, +1 very bullish),
             emitted by the same overlay model that already reads the headlines — no
             extra call. Omitted when the analysis falls back to rules (no LLM overlay).
             (69 avoids a field collision with in-flight PRs: 61-62 blend fundamentals
             into the rating, 63-65 are the merged earnings join, 66-68 are the in-flight
             risk-analytics PR.)
        realizedVolatility:
          type: number
          format: double
          description: >-
            Risk analytics computed from the 6-month daily candles already
            fetched for
             the technical snapshot (no extra upstream call).
             (66-68 avoid a field collision: 61-62 are claimed by the in-flight PR that
             blends fundamentals into the rating, and 63-65 by the merged earnings join.)

             Annualized realized volatility — sample stdev of daily log returns × √252 —
             as a fractional ratio where 0.25 means 25%. 0 when history is insufficient.
        atr:
          type: number
          format: double
          description: >-
            Wilder's 14-period Average True Range, in the response currency's
            price
             units. 0 when history is insufficient.
        maxDrawdown:
          type: number
          format: double
          description: >-
            Maximum peak-to-trough drawdown over the window, as a non-positive
            fractional
             ratio where -0.25 means a 25% decline. 0 for a monotonically rising series.
        ratingSignal:
          type: string
          description: >-
            Fundamentals-blended signal paired with composite_score. Kept
            separate
             from the legacy technical-only signal/signal_score pair so already-loaded
             web, desktop, and API clients never render a mixed-version rating.
        ratingSummary:
          type: string
          description: >-
            Fundamentals-blended narrative paired with
            rating_signal/composite_score.
             Legacy summary remains paired with signal/signal_score during rollout.
        ratingAction:
          type: string
          description: >-
            Fundamentals-blended action paired with
            rating_signal/composite_score.
             Legacy action remains paired with signal/signal_score during rollout.
        ratingConfidence:
          type: string
          description: >-
            Fundamentals-blended confidence paired with
            rating_signal/composite_score.
             Legacy confidence remains paired with signal/signal_score during rollout.
        ratingWhyNow:
          type: string
          description: >-
            Fundamentals-blended explanation paired with
            rating_signal/composite_score.
             Legacy why_now remains paired with signal/signal_score during rollout.
        ratingBullishFactors:
          type: array
          items:
            type: string
            description: >-
              Fundamentals-aware positive factors supporting the composite
              rating.
               Legacy bullish_factors remain technical-only during rollout.
        ratingRiskFactors:
          type: array
          items:
            type: string
            description: |-
              Fundamentals-aware risks supporting the composite rating.
               Legacy risk_factors remain technical-only during rollout.
    StockAnalysisHeadline:
      type: object
      properties:
        title:
          type: string
        source:
          type: string
        link:
          type: string
        publishedAt:
          type: integer
          format: int64
          description: 'Warning: Values > 2^53 may lose precision in JavaScript'
    AnalystConsensus:
      type: object
      properties:
        strongBuy:
          type: integer
          format: int32
        buy:
          type: integer
          format: int32
        hold:
          type: integer
          format: int32
        sell:
          type: integer
          format: int32
        strongSell:
          type: integer
          format: int32
        total:
          type: integer
          format: int32
        period:
          type: string
    PriceTarget:
      type: object
      properties:
        high:
          type: number
          format: double
        low:
          type: number
          format: double
        mean:
          type: number
          format: double
        median:
          type: number
          format: double
        current:
          type: number
          format: double
        numberOfAnalysts:
          type: integer
          format: int32
    UpgradeDowngrade:
      type: object
      properties:
        firm:
          type: string
        toGrade:
          type: string
        fromGrade:
          type: string
        action:
          type: string
        epochGradeDate:
          type: integer
          format: int64
          description: 'Warning: Values > 2^53 may lose precision in JavaScript'
    Fundamentals:
      type: object
      properties:
        profitMargin:
          type: number
          format: double
          description: Fractional ratio where 0.25 means 25%.
        grossMargin:
          type: number
          format: double
          description: Fractional ratio where 0.25 means 25%.
        operatingMargin:
          type: number
          format: double
          description: Fractional ratio where 0.25 means 25%.
        returnOnEquity:
          type: number
          format: double
          description: Fractional ratio where 0.25 means 25%.
        returnOnAssets:
          type: number
          format: double
          description: Fractional ratio where 0.25 means 25%.
        revenueGrowth:
          type: number
          format: double
          description: Fractional ratio where 0.25 means 25%.
        earningsGrowth:
          type: number
          format: double
          description: Fractional ratio where 0.25 means 25%.
        debtToEquity:
          type: number
          format: double
          description: Normalized debt/equity ratio where 1.5 means debt is 1.5x equity.
        totalCash:
          type: number
          format: double
          description: Latest Yahoo financialData value denominated in financial_currency.
        totalDebt:
          type: number
          format: double
          description: Latest Yahoo financialData value denominated in financial_currency.
        freeCashflow:
          type: number
          format: double
          description: Latest Yahoo financialData value denominated in financial_currency.
        ebitda:
          type: number
          format: double
          description: Latest Yahoo financialData value denominated in financial_currency.
        financialCurrency:
          type: string
          description: >-
            ISO 4217 currency used by the company's financial statements. This
            can
             differ from AnalyzeStockResponse.currency for ADRs and cross-listings.
  securitySchemes:
    WorldMonitorKey:
      type: apiKey
      in: header
      name: X-WorldMonitor-Key
      description: User-issued WorldMonitor API key.
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Alias header for the WorldMonitor API key (X-WorldMonitor-Key).
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token: a Clerk-issued JWT for browser session flows, passed as
        Authorization: Bearer <token>.

````