QuantBrasil
Documentação

quantbrasil inspect

Inspeciona um ativo com dados, métricas, notícias e insights

Sintaxe

quantbrasil inspect <ticker>

Esta é uma operação de leitura. Modos de saída: json, human.

Argumentos e opções

NomeTipoObrigatórioDescriçãoPadrão
tickerArgumentoSimTicker do ativo, por exemplo PETR4
--window <days>OpçãoNãoJanela de notícias em dias30
--limit <count>OpçãoNãoNúmero máximo de notícias10
--jsonOpçãoNãoMostra a resposta em JSON

Exemplos

quantbrasil inspect PETR4
quantbrasil inspect PETR4 --window 7 --limit 5
quantbrasil inspect PETR4 --json

Saída (--json)

Estrutura da resposta retornada com --json:

export interface AssetInspectResponse extends JsonObject {
  ok: boolean;
  summary_markdown: string;
  overview: AssetInspectOverview;
  news: AssetNewsResponse;
  news_summary: AssetInspectNewsSummary;
  feeling: AssetInspectFeeling;
  insights: AssetInspectInsight[];
  warnings: string[];
}

type JsonObject = { [key: string]: JsonValue };

export interface AssetInspectOverview extends JsonObject {
  asset: JsonObject | null;
  as_of: JsonObject | null;
  session: JsonObject | null;
  price: JsonObject | null;
  performance: JsonObject[] | null;
  momentum: JsonObject[] | null;
  technicals: JsonObject | null;
  risk: JsonObject | null;
  fundamentals: JsonObject | null;
  rankings: JsonObject[] | null;
  candles: JsonValue[] | null;
}

export interface AssetNewsResponse {
  ok: boolean;
  asset: AssetNewsAsset;
  window_days: number;
  limit: number;
  total: number;
  articles: AssetNewsArticle[];
}

export interface AssetInspectNewsSummary extends JsonObject {
  mention_count: number;
  sentiment_counts: JsonObject | null;
  current_sentiment_count: number;
  missing_sentiment_count: number;
  positive_count: number;
  negative_count: number;
  neutral_count: number;
  weighted_sentiment_sum: number;
  average_sentiment_score: number | null;
  relevance_score: number;
  overall_sentiment: AssetInspectOverallSentiment;
}

export interface AssetInspectFeeling extends JsonObject {
  kind: AssetInspectFeelingKind;
  label: string;
  drivers: string[];
}

export interface AssetInspectInsight extends JsonObject {
  category: string;
  title: string;
  detail: string;
  severity: "info" | "warning" | "critical";
  data_refs: string[];
}

export interface AssetNewsAsset {
  id: number;
  ticker: string;
  name: string | null;
  type: string | null;
}

export interface AssetNewsArticle {
  id: number;
  source_slug: string;
  source_name: string;
  title: string;
  summary: string | null;
  url: string;
  published_at: string;
  last_seen_at: string;
  content_updated_at: string | null;
  mentioned_tickers: string[];
  sentiment: AssetNewsSentiment | null;
}

export type AssetInspectOverallSentiment =
  | "positive"
  | "negative"
  | "neutral"
  | "mixed"
  | "unavailable";

export type AssetInspectFeelingKind =
  | "constructive"
  | "cautious"
  | "mixed"
  | "neutral"
  | "insufficient_data";

export interface AssetNewsSentiment {
  model: string;
  prompt_version: string;
  sentiment: "positive" | "negative" | "neutral";
  confidence: number | null;
  reason: string | null;
  input_tokens: number | null;
  output_tokens: number | null;
  total_tokens: number | null;
  analyzed_at: string;
}

Exemplo de resposta

{
  "ok": true,
  "summary_markdown": "PETR4 combina preço em alta no dia, notícias recentes positivas e métricas de risco ainda relevantes.",
  "overview": {
    "asset": {
      "symbol": "PETR4",
      "name": "Petrobras PN",
      "type": "B3"
    },
    "as_of": {
      "price_date": "2026-07-16",
      "last_updated": "2026-07-16T21:00:00Z"
    },
    "session": {
      "state": "closed",
      "as_of": "2026-07-16T21:00:00Z",
      "age_minutes": 60
    },
    "price": {
      "close": 37.61,
      "open": 37.2,
      "high": 37.9,
      "low": 37.05,
      "volume": 42000000,
      "prev_close": 37.1,
      "change_pct": 1.37
    },
    "performance": [
      {
        "id": "DAYS_30",
        "label": "30D",
        "value": 4.5
      }
    ],
    "momentum": [
      {
        "id": "DAYS_90",
        "label": "90D",
        "regression_type": "LINEAR",
        "momentum": 0.12,
        "r_squared": 0.78
      }
    ],
    "technicals": {
      "rsi14": 58.2
    },
    "risk": {
      "volatility_30d_ann": 32
    },
    "fundamentals": {
      "p_l": 4.1
    },
    "rankings": [
      {
        "id": "momentum-90d",
        "label": "Momentum - 90 dias",
        "position": 12,
        "total": 120
      }
    ],
    "candles": null
  },
  "news": {
    "ok": true,
    "asset": {
      "id": 1,
      "ticker": "PETR4",
      "name": "Petrobras PN",
      "type": "B3"
    },
    "window_days": 30,
    "limit": 10,
    "total": 1,
    "articles": [
      {
        "id": 5001,
        "source_slug": "valor",
        "source_name": "Valor Econômico",
        "title": "Petrobras anuncia novo plano de investimentos",
        "summary": "A companhia detalhou os aportes previstos para o próximo ciclo.",
        "url": "https://exemplo.com.br/noticia/5001",
        "published_at": "2026-07-15T11:30:00Z",
        "last_seen_at": "2026-07-15T12:00:00Z",
        "content_updated_at": null,
        "mentioned_tickers": ["PETR4"],
        "sentiment": {
          "model": "gpt",
          "prompt_version": "v3",
          "sentiment": "positive",
          "confidence": 0.82,
          "reason": "Anúncio de investimentos tende a ser lido como positivo.",
          "input_tokens": 640,
          "output_tokens": 48,
          "total_tokens": 688,
          "analyzed_at": "2026-07-15T12:05:00Z"
        }
      }
    ]
  },
  "news_summary": {
    "mention_count": 1,
    "sentiment_counts": {
      "positive": 1,
      "negative": 0,
      "neutral": 0,
      "missing": 0
    },
    "current_sentiment_count": 1,
    "missing_sentiment_count": 0,
    "positive_count": 1,
    "negative_count": 0,
    "neutral_count": 0,
    "weighted_sentiment_sum": 0.82,
    "average_sentiment_score": 0.82,
    "relevance_score": 1.41,
    "overall_sentiment": "positive"
  },
  "feeling": {
    "kind": "constructive",
    "label": "Construtivo",
    "drivers": [
      "Noticiário recente com sentimento positivo.",
      "Fechamento acima do preço anterior.",
      "Momentum de 90 dias positivo."
    ]
  },
  "insights": [
    {
      "category": "price",
      "title": "Preço em contexto",
      "detail": "Fechamento em 37,61, alta diária de 1,37%, com volume elevado.",
      "severity": "info",
      "data_refs": ["overview.price"]
    },
    {
      "category": "news",
      "title": "Notícia positiva recente",
      "detail": "A principal manchete retornada tem sentimento positivo e alta confiança.",
      "severity": "info",
      "data_refs": ["news.articles[0].sentiment"]
    }
  ],
  "warnings": []
}