[DEVELOPERS]

LOPJLB API for developers & AI agents

LOPJLB is a quant research layer, not a raw market-data API. A nightly desk re-scores 12,000+ U.S. names and ships evidence with the call— direction, backtested stats, HMM regime, factor scores, and earnings CallCard synthesis. If you only need OHLCV, free tools are enough; if you want daily regime-aware research opinions, this is the surface. See how it works, compare, methodology.

Programmatic access over one BFF. Free: thin signal-card teaser (depth=public) plus freemium detail / earnings intel (anon ticker budget 30/min · 500/day) — no login. Full PF packs and cross-section /universe need a Pro browser session or an Enterprise API key.

Quick links

Agent surfaces (REST · CLI · PyPI · MCP)

Four peers over one BFF. CLI and PyPI call REST only; HTTP MCP is a separate host protocol (Cursor / Claude). Free needs no browser and no API key — thin teaser + freemium detail/intel (not a full universe dump). Pro is browser-first (session cookie), including live intraday / I·EXH. Enterprise keys unlock headless Pro REST, full signal-card, export, and MCP. Same matrix as /pricing.

SurfaceFreePro (session)Enterprise key
ScreenerSPY25 sampleFull 12k+ universe, filters, I·EXH, CSVPro + keys / webhooks
Signal cardResearch sample (direction, regime, PF)Full packs (PF, composite, fund, best-combo OOS)Full packs (login or API key)
Research chat/chat + lopjlb ask · guest 1/day · signed-in 3/day10 messages/day (browser /chat)Unlimited · CLI ask · MCP ask_research_desk
API / CLIRegime, universes, alt-context, thin card, intel, askFull card + regime history when signed inKeys: universe, export, archives, ask
Intraday / I·EXHLocked1D charts, scanner, browser alertsPro + MCP/CLI via API key
MCP / webhooksBrowser page tools onlyn/aHTTP MCP (incl. ask_research_desk) + Slack / Discord
Rate limits120/min · 10k/day; ticker 30/min · 500/daySame IP budget (signed in)Key 600/min · 50k/day
# Install CLI (pick one) — no browser for free research
uv tool install lopjlb
curl -fsSL https://www.lopjlb.com/install.sh | sh
brew install lopjlb/tap/lopjlb

# Free REST via CLI / PyPI (thin signal-card depth=public)
lopjlb ticker AAPL
lopjlb ticker AAPL intel
lopjlb regime
lopjlb schema
python -c "import lopjlb; print(lopjlb.Ticker('AAPL').summary())"

# Enterprise REST (mint key in Settings after entitlement is active)
# Key unlocks full signal-card + Pro REST (/universe) + export
export LOPJLB_API_KEY=lopjlb_live_
lopjlb screen
lopjlb export signals --out signals.csv

Research chat

Browser desk at /chat. Ticker turns assemble the same CONTEXT pack as scheduled blog posts (signal card, fundamentals, news, earnings CallCard). OpenRouter Nemotron free; quotas: anon 1/day · free 3 · Pro 10 · Enterprise unlimited. Agent Bearer and API keys are accepted on the same BFF routes (identity order: API key → Bearer → session).

# Quota
curl -s https://www.lopjlb.com/bff/api/research/chat/quota

# Stream NDJSON (meta → chip* → delta* → done)
curl -sN https://www.lopjlb.com/bff/api/research/chat \
  -H 'Content-Type: application/json' \
  -d '{"message":"What does LOPJLB say about AAPL?"}'

Agent Registration (WorkOS auth.md)

Discovery skill at /auth.md (proxies AuthKit when WORKOS_AUTHKIT_DOMAIN is set). Protected resource metadata: /.well-known/oauth-protected-resource. Registration AS is AuthKit (not lopjlb.com). After claim + token exchange, call the BFF with Authorization: Bearer. Agent scopes (unverified and verified): lopjlb:read:public + lopjlb:read:freemium. Pro routes follow the claimed user’s Stripe/IAP entitlement — do not grant lopjlb:read:pro or Enterprise on agent tokens. Enterprise MCP / export / webhooks still use Settings X-LOPJLB-API-Key.

# Follow https://www.lopjlb.com/auth.md → AuthKit register/claim/token
curl -s https://www.lopjlb.com/bff/api/hmm/latest \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Base URL

https://www.lopjlb.com/bff/api/

All requests go through the BFF proxy on the web origin. Do not call api.lopjlb.com directly, it requires an internal key.

Public quickstart (no auth)

Anon freemium ticker routes (signal-card, detail, earnings-intel) share a 30/min · 500/day per-IP budget on top of the global 120/min · 10k/day limit.

# Current market regime (HMM)
curl -s https://www.lopjlb.com/bff/api/hmm/latest

# Regime history (public ~1y; Pro/key for full)
curl -s https://www.lopjlb.com/bff/api/hmm/history

# Point-in-time SPY25 / SP500 membership
curl -s 'https://www.lopjlb.com/bff/api/universes/spy25?asof=2025-01'
curl -s https://www.lopjlb.com/bff/api/universes/spy500/months

# Search tickers
curl -s 'https://www.lopjlb.com/bff/api/bigfive/search?q=AAPL'

# Screener preview (top-ranked SPY25-style subset)
curl -s https://www.lopjlb.com/bff/api/bigfive/universe-preview

# Market pulse (breadth, sectors, regime)
curl -s https://www.lopjlb.com/bff/api/market-pulse

# Alt context (congress, prediction markets, treasuries)
curl -s https://www.lopjlb.com/bff/api/congress/summary
curl -s https://www.lopjlb.com/bff/api/prediction-markets/summary
curl -s https://www.lopjlb.com/bff/api/market/treasury-rates

# Thin signal-card teaser (depth=public — not full PF / composite packs)
curl -s https://www.lopjlb.com/bff/api/bigfive/signal-card/AAPL

# Freemium detail (fundamentals + short series; not a universe dump)
curl -s https://www.lopjlb.com/bff/api/bigfive/detail/AAPL

# Earnings intel / CallCard rollup
curl -s https://www.lopjlb.com/bff/api/bigfive/earnings-intel/AAPL

signal-card depth

GET /bff/api/bigfive/signal-card/{symbol} returns a depth field:

  • depth=public (anon BFF) — OG-safe teaser: symbol, name, direction, score, regime, price, daily change, sparkline, headline pf / win_rate, market cap
  • depth=full — PF packs, composite score, fund archetype scores, best-combo, ATR/exhaustion/coil, opt metrics, and related research fields

Full pack requires a WorkOS Pro session (browser cookie on BFF) or an Enterprise X-LOPJLB-API-Key. Direct first-party server jobs (OG SSR, MCP internal) also receive full packs.

# Anon → depth=public
curl -s https://www.lopjlb.com/bff/api/bigfive/signal-card/AAPL | jq .depth

# Enterprise key → depth=full (+ Pro REST)
curl -s -H "X-LOPJLB-API-Key: $LOPJLB_API_KEY" \
  https://www.lopjlb.com/bff/api/bigfive/signal-card/AAPL | jq .depth

SD50 signal service

Monthly model portfolio allocations. Level 1 (RSS) and live MTD tracker are public; CSV and JSON require Pro. See platform docs and /sd50.

# Level 1. RSS feed (public, full monthly history)
curl -s https://www.lopjlb.com/bff/api/sd50/feed

# Live MTD. SD50 + SD14 vs SPY/FTEC/SPMO (public)
curl -s https://www.lopjlb.com/bff/api/sd50/mtd-tracker

# Level 2. CSV (Pro session cookie required)
curl -s -b 'your-workos-session-cookie' \
  'https://www.lopjlb.com/bff/api/sd50/allocation.csv?variant=sd14'

# SD50 full book + share sizing for a $100k account
curl -s -b 'your-workos-session-cookie' \
  'https://www.lopjlb.com/bff/api/sd50/allocation.csv?variant=sd50&account_value=100000'

# Level 3. JSON API (Pro)
curl -s -b 'your-workos-session-cookie' \
  'https://www.lopjlb.com/bff/api/sd50/allocation?variant=sd14&account_value=100000'

Authentication tiers

TierScopeHow
publicRegime, search, preview, market pulse, thin signal-cardNo credentials
freemiumDetail, fundamentals, ETF holdings, earnings intel/transcripts, 30d sparklineNo credentials; ticker routes 30/min · 500/day anon
proFull universe, full signal-card, peers, SD50 allocation, live intraday / I·EXH, chatWorkOS session + pro, or Enterprise API key (BFF maps key → Pro)
enterpriseAPI keys, HTTP MCP, Slack/Discord webhooks, bulk exportLive enterprise entitlement (session or X-LOPJLB-API-Key)

Auth for AI agents

Free CLI returns a thin signal-card (depth=public). A Pro browser session upgrades the card to depth=full on BFF. Headless full-universe /universe, peers, export, and MCP need an Enterprise key minted in Settings after entitlement is active (cancelled plans get 402). Browser intraday / I·EXH is Pro-session.

  1. Free research: no account — lopjlb ticker AAPL (thin card)
  2. Pro UI: account + Pro at /pricing; session cookie → full signal-card + intraday
  3. Enterprise: subscribe, wait for entitlement, create key in Settings
  4. Headless: X-LOPJLB-API-Key: lopjlb_live_… (full card + Pro REST + export/MCP; CLI intraday via key)

Webhooks

Enterprise users can configure outbound Slack and Discord webhooks for signal alerts in Settings. Generic arbitrary URLs are not supported (SSRF allowlist). See the platform docs for setup.

Enterprise: API keys, MCP & export

After Enterprise entitlement is active, open Settings to create API keys. Keys require a live Enterprise subscription. Header: X-LOPJLB-API-Key. Keys unlock full signal-card, Pro REST (/bigfive/universe, peers), HTTP MCP, bulk export, and CLI/MCP intraday tools.

HTTP MCP (Streamable HTTP): POST https://www.lopjlb.com/bff/api/mcp with Accept: application/json. Discovery: server-card.json. Prefer compact tools (get_ticker_summary, screen_universe). Full-universe CSV stays REST/CLI (lopjlb export signals --out …).

Tools include: regime / regime history, search, ticker summary + detail + intel, screener preview, multi-asset screen_universe, get_metrics_schema, get_peers, I·EXH, SD50 allocation, pulse, congress, calendars, PIT universes, intraday, and ask_research_desk (NLP desk — same pipeline as /chat / CLI lopjlb ask; prefer structured tools for screens). See the server card (v1.5) for the full list.

# Cursor / Claude Desktop (remote MCP)
# URL:  https://www.lopjlb.com/bff/api/mcp
# Header: X-LOPJLB-API-Key: lopjlb_live_…

{
  "mcpServers": {
    "lopjlb": {
      "url": "https://www.lopjlb.com/bff/api/mcp",
      "headers": { "X-LOPJLB-API-Key": "lopjlb_live_…" }
    }
  }
}

# Smoke
curl -s https://www.lopjlb.com/bff/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-LOPJLB-API-Key: $LOPJLB_API_KEY" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'

Errors

Stable codes for CLI/SDK: 401 invalid/revoked key, 402 entitlement required (pro_required / enterprise_required), 429 rate limited. Body includes error and optional upgrade_url.

Rate limits

CallerPer minutePer day
Anonymous / session (IP)12010,000
Anon freemium ticker (signal-card / detail / intel)30500
Enterprise API key60050,000
API key validate (IP)30200

Repository

See AGENTS.md in the LOPJLB repository for coding-agent instructions when integrating with this codebase.