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

# Get an analysis

> Poll for completion.

`result` is populated only on `succeeded`; `error` only on `failed`. A 404
means the id was never issued, or the job has aged out of retention.



## OpenAPI

````yaml /api/openapi.json get /v1/analyses/{job_id}
openapi: 3.1.0
info:
  title: BlackQuant TradingAgents API
  description: >

    An HTTP API over the
    [TradingAgents](https://github.com/TauricResearch/TradingAgents)

    multi-agent LLM trading framework by Tauric Research, used under Apache-2.0.


    ## Analyses are asynchronous


    A single analysis runs a full multi-agent debate and takes **minutes**, not

    seconds. `POST /v1/analyses` therefore returns a job reference immediately
    and

    the result is collected by polling `GET /v1/analyses/{id}`.


    ## Ratings


    A completed analysis carries one of `Buy`, `Overweight`, `Hold`,
    `Underweight`,

    `Sell` — or `REVIEW`.


    `REVIEW` is **not** a weak Hold. It means the run produced no parseable
    rating,

    so there is no opinion to act on. Check `is_review` before reading `rating`.


    ## This API places no orders


    Nothing here can move money. It starts analyses and returns what they
    decided.
  version: 0.1.0
servers:
  - url: http://127.0.0.1:8900
    description: Local
security: []
tags:
  - name: Analyses
    description: Start, poll and cancel analyses.
  - name: Service
    description: Health and effective configuration.
paths:
  /v1/analyses/{job_id}:
    get:
      tags:
        - Analyses
      summary: Get an analysis
      description: >-
        Poll for completion.


        `result` is populated only on `succeeded`; `error` only on `failed`. A
        404

        means the id was never issued, or the job has aged out of retention.
      operationId: get_analysis_v1_analyses__job_id__get
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            title: Job Id
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '404':
          description: Unknown or evicted job
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Job:
      properties:
        id:
          type: string
          title: Id
          description: Opaque job identifier.
        status:
          $ref: '#/components/schemas/JobStatus'
        request:
          $ref: '#/components/schemas/AnalysisRequest'
        created_at:
          type: string
          format: date-time
          title: Created At
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        finished_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finished At
        result:
          anyOf:
            - $ref: '#/components/schemas/AnalysisResult'
            - type: 'null'
          description: Present only when `status` is `succeeded`.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Present only when `status` is `failed`.
      type: object
      required:
        - id
        - status
        - request
        - created_at
      title: Job
    Error:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: Error
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    JobStatus:
      type: string
      enum:
        - queued
        - running
        - succeeded
        - failed
        - cancelled
      title: JobStatus
    AnalysisRequest:
      properties:
        ticker:
          type: string
          maxLength: 32
          minLength: 1
          title: Ticker
          description: Instrument symbol, e.g. `NVDA` or `BTC`.
          examples:
            - NVDA
        trade_date:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          title: Trade Date
          description: >-
            The as-of date, `YYYY-MM-DD`. The graph reasons as though standing
            on this date, so a future one yields nothing useful.
          examples:
            - '2024-05-10'
        asset_type:
          $ref: '#/components/schemas/AssetType'
          description: Selects the stock or crypto pipeline.
          default: stock
        analysts:
          items:
            $ref: '#/components/schemas/Analyst'
          type: array
          minItems: 1
          title: Analysts
          description: >-
            Analyst agents to include. Fewer analysts is cheaper and faster, and
            narrows what the debate can consider.
        max_debate_rounds:
          anyOf:
            - type: integer
              maximum: 10
              minimum: 1
            - type: 'null'
          title: Max Debate Rounds
          description: >-
            Overrides `TRADINGAGENTS_MAX_DEBATE_ROUNDS` for this run. Cost
            scales roughly linearly with it.
      type: object
      required:
        - ticker
        - trade_date
      title: AnalysisRequest
    AnalysisResult:
      properties:
        rating:
          $ref: '#/components/schemas/Rating'
          description: The run's rating, or `REVIEW`.
        is_review:
          type: boolean
          title: Is Review
          description: >-
            True when the run produced no parseable rating. Check this before
            reading `rating` as an opinion.
        decision:
          anyOf:
            - type: string
            - type: 'null'
          title: Decision
          description: The trader agent's decision text.
        reports:
          additionalProperties: true
          type: object
          title: Reports
          description: Per-agent reports from the final graph state, keyed by agent.
      type: object
      required:
        - rating
        - is_review
      title: AnalysisResult
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AssetType:
      type: string
      enum:
        - stock
        - crypto
      title: AssetType
      description: Which pipeline the graph runs. The CLI infers this; callers state it.
    Analyst:
      type: string
      enum:
        - market
        - social
        - news
        - fundamentals
      title: Analyst
      description: The analyst agents available to a run.
    Rating:
      type: string
      enum:
        - Buy
        - Overweight
        - Hold
        - Underweight
        - Sell
        - REVIEW
      title: Rating
      description: >-
        The five-tier rating, plus `REVIEW`.


        `REVIEW` is not a weak Hold. It means the decision text carried no
        parseable

        rating, so the run produced no opinion at all — treat it as missing data
        and

        never map it onto the buy/sell axis.

````