Skip to main content

Market Data & Analytics API Reference

Audience: Strategy-R&D engineers building and backtesting trading strategies. Authentication: All public routes under /api/graph/v1/... require a Supabase JWT (user) OR an X-Internal-Secret header (service principal). Routes under /api/internal/... require X-Internal-Secret only. Strict auth enforced in production (anon → 401).

Single-Stock Data API

Get complete stock context, scoring, technical setup, and institutional level proximity. Base path: /api/graph/v1/stocks

GET /stocks/

Fetch complete stock context with all available metrics: current price, volume, technical indicators, confluence scores (v4.5 + v5), conviction (v5), institutional levels, volume profile, patterns, earnings, and optionally computed enhancements. Parameters:
  • symbol (path, required): Stock symbol (e.g., NVDA)
  • date (query, optional): Trade date (YYYY-MM-DD); defaults to today
  • include (query, optional): Comma-separated list of includes to enrich response:
    • levels: IntradayLevel data (pivots, IB, CPR, value area, VWAP, ORB)
    • volume_profile: VolumeProfileSession (prior + developing session)
    • patterns: Active technical patterns (NR7, inside day, VCP, bull flag, etc.)
    • news: News event summary
    • confluence_components: Structured v4.5 component breakdown (8 components with weights, scores, notes)
    • level_ladder: Sorted level ladder with ATR distances and confluence zones
Response:
Performance target: <100ms without includes, <300ms with includes. Example (with all includes):
Returns confluence_score (0-100), conviction_v5 (meta-score with core/direction/regime), pulse_v5 (real-time momentum), entry_v2 (execution timing), momentum_health_v5, regime_v5, peer_divergence_v1, plus institutional levels, patterns, and sorted level ladder with nearest support/resistance.

GET /stocks//confluence

Get confluence scoring breakdown (v3: 6 components, v4.1+: 8 components with regime-aware weighting). Parameters:
  • symbol (path, required): Stock symbol
  • strategy (query, optional): Strategy type to check alignment for
Response:
Score tiers:
  • EXCELLENT (8–10): Full position size
  • GOOD (6–8): Normal position size
  • MODERATE (4–6): Reduced position size
  • WEAK (2–4): Avoid or minimal size
  • POOR (0–2): Do not trade

GET /stocks//fpt

First Passage Time (FPT) probabilistic timing analysis. Pre-computed by Go pattern-detector, reads from graph. Response:
Timeframe fit classifications:
  • EXCELLENT: Median < 2 days (day trade)
  • GOOD: Median 2–5 days (swing)
  • MODERATE: Median 5–10 days (swing/position)
  • EXTENDED: Median 10–20 days (position)
  • LONG: Median > 20 days (investment)

POST /stocks/batch

Lightweight batch endpoint for watchlist tray. Returns price, change, pulse (real-time momentum), relative volume (rvol), and 5-minute sparkline for up to 50 symbols. Request:
Response:
Performance target: <50ms.

GET /stocks//peers

Peer stocks from FMP, enriched with graph data (confluence, conviction, directional bias). Response:

GET /stocks//earnings/history

Historical earnings data: estimates, actuals, and surprise percentages (EPS + revenue). Parameters:
  • limit (query, optional): Number of quarters (1–20, default 12)
Response (shape inferred from handler):

GET /stocks//price-events

Price events detected by Go pattern-detector (gaps, breakouts, MA crosses, volume spikes, compressions). Parameters:
  • days (query, optional): Lookback days (1–90, default 30)
  • event_types (query, optional): Comma-separated event types (e.g., gap_up,golden_cross)
  • min_severity (query, optional): Filter by severity (low, medium, high, critical)
Response:

Chart & OHLCV Data API

Candlestick data with optional server-computed indicators. Base path: /api/graph/v1/chart

GET /chart/

Retrieve OHLCV bars for charting. Parameters:
  • symbol (path, required): Stock symbol
  • interval (query, optional): 1m, 2m, 5m, 15m, 30m, 1h, 1d (default 5m)
  • period (query, optional): 1d, 5d, 1m, 3m, 6m, 1y, 5y (default 1d)
  • session (query, optional): all or regular (RTH only; default all)
  • warmup (query, optional): Extra bars for indicator seeding (0–250)
  • indicators (query, optional): Server-computed indicators (ema9,ema20,sma50,sma200,vwap)
Response:
Notes:
  • Long periods (3m+) fail closed if data is stale; empty candles array returned with staleness diagnostics.
  • Short periods (1d/5d/1m) allow lookback re-query if primary table empty.
  • 1-minute fallback for missing aggregated data.
  • Split-adjusted for daily bars.

Market Context & Regime API

Market-wide conditions: day classification, VIX regime, breadth, session phases. Base path: /api/graph/v1/market

GET /market/context

Current market-wide context for informed trading decisions. Response:
Performance target: <50ms (uses cache).

GET /market/regime

Unified market regime combining V5 vector, VIX, vol regime, and GEX. Response:

GET /market/intraday-bars/

Today’s 1-minute bars for real-time charting. Response:

GET /market/most-active

Top stocks by relative volume (RVOL). Parameters:
  • limit (query, optional): Default 50
Response:

GET /market/leaderboard

Stocks by signal category (top movers, highest conviction, strongest momentum, etc.). Response:

GET /market/indices

Intraday index charts and quotes (SPY, QQQ, DJI, etc.). Response:

GET /market/pulse

Market pulse data for dashboard ticker cards (FMP-powered). Response (shape inferred from handler):
Instruments: ^GSPC, ^IXIC, ^DJI, ^VIX, USO, GCUSD, BTCUSD.

GET /market/sector-rotation

Sector rotation scoring (average conviction, persistence, breadth, leaders/laggards). Response:

GET /market/rrg

Relative Rotation Graph (RRG) for sector rotation analysis. Response:

GET /market/session-phases

Trading session phase analysis. Response:

Symbol & Quote API

GET /symbols/index

Compact symbol index for client-side search (3K stocks, ~40KB gzipped). Response:
Cache: 1 hour (Redis).

GET /quotes/

MSE live quotes (bid, ask, spread). Proxied to Market Signal Engine on localhost:8100. Parameters:
  • symbols (path): Comma-separated symbols (e.g., NVDA,AAPL)
Response: (varies by MSE implementation; typically quote object with bid, ask, last, time)

Performance Analytics API

GET /performance/summary

Aggregate performance metrics for closed trades. Parameters:
  • mode (query, optional): all, paper, or live (default all)
  • start_date (query, optional): ISO date (e.g., 2026-01-01)
  • end_date (query, optional): ISO date (e.g., 2026-12-31)
Response (shape inferred from handler):

Key Schemas

StockResult

Complete stock data. Fields populated based on include query parameter. Core fields:
  • symbol, last_price, volume, dollar_volume
  • technical: RSI, MACD, ADX, ATR, EMAs, SMAs, Bollinger bands, VWAP
  • compression: NR7, inside day, VCP contraction count, BB width percentile
  • levels: Pivots, IB, VWAP bands, value area, prior day/week levels, ORB levels
  • confluence_score, bullish_confluence, bearish_confluence, net_confluence
  • conviction_max_v5, conflict_min_v5, directional_bias_v5
  • pulse_net, pulse_bull, pulse_bear
  • entry_score_bull, entry_score_bear, entry_gates_passed
  • options: IV percentile, put/call ratio, unusual activity, theta drag, pricing edges
  • fundamental: Market cap, PE, EV/EBITDA, margins, dividend yield, beta
  • earnings: Days until, surprise %, beat rate, sentiment bias
  • patterns: []
  • price_events: Gaps, breakouts, MA crosses, volume spikes, compressions
  • dark_pool_pct_1d, block_trade_count, net_buy_volume

RegimeV5

V5 regime state vector (canonical regime, shadow mode).

ConvictionV5

Conviction meta-score: real-time momentum composite (MSE).

ConfluenceComponentBreakdown

Structured v4.5 component breakdown (8 components).

Levels

Institutional price levels: pivots, IB, VWAP bands, value area, ORB, prior levels.

LevelLadder

Sorted level ladder with ATR distances and confluence zones.

Technical

Technical indicators: RSI, MACD, ADX, ATR, MAs, Bollinger bands.

Compression

Volatility compression indicators.

VolumeProfile

Prior and developing session volume profile (VAH, VAL, POC).