================================================================================ OPENBB TERMINAL PROXY API — DOCS FOR EXTERNAL INTEGRATION Base URL: https://open-bb.replit.app Version: 1.2.0 Last Updated: 2026-06-14 ================================================================================ TABLE OF CONTENTS ----------------- 1. Quick Start 2. Authentication & CORS 3. Endpoint Reference (All Routes) 4. Yahoo Finance Compatible Format (Neural Cockpit) 5. Response Format Examples 6. Code Examples (JavaScript, Python, cURL) 7. Error Handling 8. Integration Guide for LLMs / Bots 9. Frontend Routes 10. Rate Limits & Caching ================================================================================ 1. QUICK START ================================================================================ This FastAPI backend proxies financial data through OpenBB/yfinance and returns it in both native and Yahoo Finance-compatible formats. HEALTH CHECK: GET https://open-bb.replit.app/api/health -> {"status": "ok", "openbb_server": "http://localhost:6900"} QUICK TEST (AAPL Quote): GET https://open-bb.replit.app/api/proxy/equity/price/quote?symbol=AAPL -> {"results": [{"symbol": "AAPL", "last_price": 291.13, ...}]} ================================================================================ 2. AUTHENTICATION & CORS ================================================================================ - NO API key required - CORS enabled: allow_origins=["*"] (all domains) - All HTTP methods: GET - Content-Type: application/json ================================================================================ 3. ENDPOINT REFERENCE ================================================================================ ┌─────────────────────────────────────────────────────────────────────────────┐ │ A. OPENBB PROXY ENDPOINTS (Native Format) │ └─────────────────────────────────────────────────────────────────────────────┘ A1. GET /api/proxy/equity/price/quote ───────────────────────────────────────────────────────────────────────── Description: Real-time stock quote Parameters: symbol (string, required) Stock ticker e.g. "AAPL", "MSFT", "SAP.DE" provider (string, optional) Default: "yfinance" Response: {"results": [{ "symbol": "AAPL", "last_price": 291.13, "change": -4.50, "change_percent": -1.52, "volume": 53656670, "market_cap": 4275929874432, "pe_ratio": 35.2, "exchange": "NMS", "year_high": 317.40, "year_low": 195.07 }]} Example: curl "https://open-bb.replit.app/api/proxy/equity/price/quote?symbol=AAPL" ─────────────────────────────────────────────────────────────────────────────── A2. GET /api/proxy/equity/price/historical ───────────────────────────────────────────────────────────────────────── Description: Historical OHLCV stock data Parameters: symbol (string, required) Ticker interval (string, optional) "1d", "1wk", "1mo" — Default: "1d" start_date (string, optional) "YYYY-MM-DD" end_date (string, optional) "YYYY-MM-DD" provider (string, optional) Default: "yfinance" Response: {"results": [ {"date": "2025-06-13", "open": 295.63, "high": 297.14, "low": 291.09, "close": 291.13, "volume": 53656670}, {"date": "2025-06-12", "open": 293.00, "high": 296.50, "low": 291.50, "close": 295.63, "volume": 45000000}, ... ]} Example: curl "https://open-bb.replit.app/api/proxy/equity/price/historical?symbol=AAPL&interval=1d&start_date=2024-01-01" ─────────────────────────────────────────────────────────────────────────────── A3. GET /api/proxy/crypto/price/historical ───────────────────────────────────────────────────────────────────────── Description: Historical OHLCV crypto data Parameters: Same as A2, default symbol: "BTC-USD" Response: Same format as A2 Example: curl "https://open-bb.replit.app/api/proxy/crypto/price/historical?symbol=BTC-USD&interval=1d" ─────────────────────────────────────────────────────────────────────────────── A4. GET /api/proxy/equity/fundamental/income ───────────────────────────────────────────────────────────────────────── Description: Income statement (GuV) Parameters: symbol (string, required) Ticker period (string, optional) "annual" | "quarterly" — Default: "annual" limit (int, optional) Number of periods — Default: 4 provider (string, optional) Default: "yfinance" Response: {"results": [ {"fiscal_date": "2024-09-30", "Total Revenue": 391000000000, "Net Income": 93700000000, ...}, {"fiscal_date": "2023-09-30", "Total Revenue": 383000000000, ...}, ... ]} Example: curl "https://open-bb.replit.app/api/proxy/equity/fundamental/income?symbol=AAPL&period=annual&limit=4" ─────────────────────────────────────────────────────────────────────────────── A5. GET /api/proxy/equity/fundamental/balance ───────────────────────────────────────────────────────────────────────── Description: Balance sheet (Bilanz) Parameters: Same as A4 Response: Same format as A4 with balance sheet fields Example: curl "https://open-bb.replit.app/api/proxy/equity/fundamental/balance?symbol=AAPL&period=annual&limit=4" ─────────────────────────────────────────────────────────────────────────────── A6. GET /api/proxy/equity/news ───────────────────────────────────────────────────────────────────────── Description: Company news articles Parameters: symbol (string, required) Ticker limit (int, optional) Number of articles — Default: 10 provider (string, optional) Default: "yfinance" Response: {"results": [ {"title": "Apple unveils new AI features", "source": "Reuters", "date": "2025-06-10", "url": "https://...", "text": "Summary..."}, ... ]} Example: curl "https://open-bb.replit.app/api/proxy/equity/news?symbol=AAPL&limit=10" ─────────────────────────────────────────────────────────────────────────────── A7. GET /api/proxy/economy/fred_series ───────────────────────────────────────────────────────────────────────── Description: Economic data (FRED series) Parameters: symbol (string, required) FRED series ID e.g. "GDP", "UNRATE", "CPIAUCSL" start_date (string, optional) "YYYY-MM-DD" provider (string, optional) Default: "fred" fred_api_key (string, optional) FRED API key (optional, server has fallback) Response: {"results": [ {"date": "2025-01-01", "value": 29234.5, "series_id": "GDP"}, ... ]} Example: curl "https://open-bb.replit.app/api/proxy/economy/fred_series?symbol=GDP&start_date=2020-01-01" ─────────────────────────────────────────────────────────────────────────────── A8. GET /api/test/all ───────────────────────────────────────────────────────────────────────── Description: Run all 7 proxy endpoints in batch and return status Parameters: None Response: {"results": [ {"endpoint": "/api/proxy/equity/price/quote", "status": "ok", "status_code": 200, "response_time_ms": 245.6, "rows": 1, "error": null}, {"endpoint": "/api/proxy/equity/price/historical", "status": "ok", "status_code": 200, "response_time_ms": 890.2, "rows": 252, "error": null}, ... ]} Example: curl "https://open-bb.replit.app/api/test/all" ┌─────────────────────────────────────────────────────────────────────────────┐ │ B. YAHOO FINANCE COMPATIBLE ENDPOINTS (Neural Cockpit Format) │ └─────────────────────────────────────────────────────────────────────────────┘ These endpoints return data in Yahoo Finance v10/v8 API format — identical to query2.finance.yahoo.com and query1.finance.yahoo.com. Perfect for apps that already consume Yahoo Finance data. B1. GET /api/yahoo/quote/{symbol} ───────────────────────────────────────────────────────────────────────── Description: Full quote data in Yahoo Finance quoteSummary format Path Param: symbol (e.g. AAPL, MSFT, SAP.DE) Query Param: modules (comma-separated, optional) Default: "price,summaryDetail,defaultKeyStatistics,financialData, assetProfile,summaryProfile,earningsTrend, recommendationTrend,calendarEvents" Response: {"quoteSummary": { "result": [{ "price": { "currentPrice": {"raw": 291.13, "fmt": "291.13"}, "regularMarketChange": {"raw": -4.50, "fmt": "-4.50"}, "regularMarketChangePercent": {"raw": -0.0152, "fmt": "-1.52%"}, "regularMarketVolume": {"raw": 53656670, "fmt": "53.66M"}, "marketState": {"raw": "REGULAR", "fmt": "REGULAR"}, "currency": {"raw": "USD", "fmt": "USD"}, ... }, "summaryDetail": { "marketCap": {"raw": 4275929874432, "fmt": "4.28T"}, "trailingPE": {"raw": 35.2, "fmt": "35.2"}, "forwardPE": {"raw": 30.3, "fmt": "30.3"}, "fiftyTwoWeekHigh": {"raw": 317.40, "fmt": "317.40"}, "fiftyTwoWeekLow": {"raw": 195.07, "fmt": "195.07"}, "beta": {"raw": 1.18, "fmt": "1.18"}, ... }, "defaultKeyStatistics": { "enterpriseValue": {"raw": 4292911000000, "fmt": "4.29T"}, "sharesOutstanding": {"raw": 14687000000, "fmt": "14.69B"}, "trailingEps": {"raw": 8.27, "fmt": "8.27"}, "forwardEps": {"raw": 9.59, "fmt": "9.59"}, "52WeekChange": {"raw": 0.4672, "fmt": "46.72%"}, "SandP52WeekChange": {"raw": 0.2318, "fmt": "23.18%"}, "averageDailyVolume10Day": {"raw": 53656670, "fmt": "53.66M"}, "marketCap": {"raw": 4275929874432, "fmt": "4.28T"}, "ebitda": {"raw": 159975997440, "fmt": "159.98B"}, "enterpriseToEbitda": {"raw": 26.83, "fmt": "26.83"}, "enterpriseToRevenue": {"raw": 9.51, "fmt": "9.51"}, "pegRatio": {"raw": 2.35, "fmt": "2.35"}, "trailingPegRatio": {"raw": 2.35, "fmt": "2.35"}, "epsCurrentYear": {"raw": 8.75, "fmt": "8.75"}, "epsTrailingTwelveMonths": {"raw": 8.27, "fmt": "8.27"}, "grossMargins": {"raw": 0.4796, "fmt": "47.96%"}, "operatingMargins": {"raw": 0.3227, "fmt": "32.27%"}, "profitMargins": {"raw": 0.2715, "fmt": "27.15%"}, "ebitdaMargins": {"raw": 0.3544, "fmt": "35.44%"}, "returnOnEquity": {"raw": 1.6597, "fmt": "165.97%"}, "returnOnAssets": {"raw": 0.2284, "fmt": "22.84%"}, "revenueGrowth": {"raw": 0.0572, "fmt": "5.72%"}, "earningsGrowth": {"raw": 0.0732, "fmt": "7.32%"}, "targetHighPrice": {"raw": 350.00, "fmt": "350.00"}, "targetLowPrice": {"raw": 220.00, "fmt": "220.00"}, "targetMeanPrice": {"raw": 295.00, "fmt": "295.00"}, "targetMedianPrice": {"raw": 300.00, "fmt": "300.00"}, "recommendationMean": {"raw": 1.9, "fmt": "1.9"}, "recommendationKey": {"raw": "buy", "fmt": "Buy"}, "numberOfAnalystOpinions": {"raw": 42, "fmt": "42"}, "freeCashflow": {"raw": 101090746368, "fmt": "101.09B"}, "operatingCashflow": {"raw": 118254000000, "fmt": "118.25B"}, "totalCash": {"raw": 65150000000, "fmt": "65.15B"}, "totalDebt": {"raw": 162039997184, "fmt": "162.04B"}, "currentRatio": {"raw": 1.12, "fmt": "1.12"}, "quickRatio": {"raw": 0.98, "fmt": "0.98"}, "debtToEquity": {"raw": 213.73, "fmt": "213.73"}, "fiftyDayAverage": {"raw": 285.49, "fmt": "285.49"}, "twoHundredDayAverage": {"raw": 266.87, "fmt": "266.87"}, "averageVolume": {"raw": 45000000, "fmt": "45.00M"}, "fiftyTwoWeekHigh": {"raw": 317.40, "fmt": "317.40"}, "fiftyTwoWeekLow": {"raw": 195.07, "fmt": "195.07"}, "trailingPE": {"raw": 35.2, "fmt": "35.2"}, "forwardPE": {"raw": 30.3, "fmt": "30.3"}, "priceToSalesTrailing12Months": {"raw": 9.47, "fmt": "9.47"}, ... }, "financialData": { "totalCash": {"raw": 65150000000, "fmt": "65.15B"}, "totalDebt": {"raw": 162039997184, "fmt": "162.04B"}, "currentRatio": {"raw": 1.12, "fmt": "1.12"}, "grossMargins": {"raw": 0.4796, "fmt": "47.96%"}, "operatingMargins": {"raw": 0.3227, "fmt": "32.27%"}, "ebitdaMargins": {"raw": 0.3544, "fmt": "35.44%"}, "freeCashflow": {"raw": 101090746368, "fmt": "101.09B"}, "operatingCashflow": {"raw": 118254000000, "fmt": "118.25B"}, "totalRevenue": {"raw": 391000000000, "fmt": "391.00B"}, "revenueGrowth": {"raw": 0.0572, "fmt": "5.72%"}, "earningsGrowth": {"raw": 0.0732, "fmt": "7.32%"}, "returnOnEquity": {"raw": 1.6597, "fmt": "165.97%"}, "returnOnAssets": {"raw": 0.2284, "fmt": "22.84%"}, "revenuePerShare": {"raw": 26.59, "fmt": "26.59"}, "totalCashPerShare": {"raw": 4.43, "fmt": "4.43"}, "targetHighPrice": {"raw": 350.00, "fmt": "350.00"}, "targetLowPrice": {"raw": 220.00, "fmt": "220.00"}, "targetMeanPrice": {"raw": 295.00, "fmt": "295.00"}, "targetMedianPrice": {"raw": 300.00, "fmt": "300.00"}, "recommendationMean": {"raw": 1.9, "fmt": "1.9"}, "recommendationKey": {"raw": "buy", "fmt": "Buy"}, "numberOfAnalystOpinions": {"raw": 42, "fmt": "42"}, ... }, "assetProfile": { "sector": {"raw": "Technology", "fmt": "Technology"}, "industry": {"raw": "Consumer Electronics", "fmt": "Consumer Electronics"}, "longBusinessSummary": {"raw": "Apple Inc. designs...", "fmt": "Apple Inc. designs..."}, "fullTimeEmployees": {"raw": 164000, "fmt": "164K"}, "country": {"raw": "United States", "fmt": "United States"}, "website": {"raw": "https://www.apple.com", "fmt": "https://www.apple.com"}, ... }, "recommendationTrend": { "trend": [{ "period": "-1m", "strongBuy": {"raw": 8, "fmt": "8"}, "buy": {"raw": 22, "fmt": "22"}, "hold": {"raw": 10, "fmt": "10"}, "sell": {"raw": 2, "fmt": "2"}, "strongSell": {"raw": 0, "fmt": "0"} }] }, "calendarEvents": { "earnings": {"earningsDate": {"raw": "2025-07-30", "fmt": "2025-07-30"}} } }], "error": null }} Example: curl "https://open-bb.replit.app/api/yahoo/quote/AAPL?modules=price,summaryDetail,defaultKeyStatistics" TIP: Append "&cb=" to bypass browser cache. ─────────────────────────────────────────────────────────────────────────────── B2. GET /api/yahoo/chart/{symbol} ───────────────────────────────────────────────────────────────────────── Description: OHLCV chart data in Yahoo Finance chart format Path Param: symbol (e.g. AAPL, BTC-USD) Query Params: range (string, optional) "1d", "5d", "1mo", "3mo", "6mo", "1y", "2y", "5y", "10y", "ytd", "max" — Default: "1y" interval (string, optional) "1d", "1wk", "1mo", "5m", "15m", "1h" — Default: "1d" includePrePost (string, optional) "true" | "false" — Default: "false" Response: {"chart": { "result": [{ "meta": { "symbol": "AAPL", "currency": "USD", "regularMarketPrice": 291.13, "chartPreviousClose": 295.63 }, "timestamp": [1750310400, 1750396800, 1750483200, ...], "indicators": { "quote": [{ "open": [295.63, 293.00, 291.50, ...], "high": [297.14, 296.50, 294.80, ...], "low": [291.09, 291.50, 289.50, ...], "close": [291.13, 295.63, 293.50, ...], "volume": [53656670, 45000000, 52000000, ...] }], "adjclose": [{"adjclose": [291.13, 295.63, 293.50, ...]}] } }], "error": null }} Example: curl "https://open-bb.replit.app/api/yahoo/chart/AAPL?range=1y&interval=1d" ================================================================================ 4. YAHOO FINANCE RAW-FIELD CONVENTION ================================================================================ Every numeric value is wrapped as {"raw": , "fmt": }. ┌────────────────────────┬────────────────────────────────────────────────────┐ │ Field Type │ Conversion Rules │ ├────────────────────────┼────────────────────────────────────────────────────┤ │ Prices (USD, EUR) │ raw = float (e.g. 291.13), fmt = "291.13" │ │ Percentages (margins) │ raw = decimal (0.4796), fmt = "47.96%" │ │ Frontend: ×100 │ e.g. grossMargins.raw × 100 = 47.96% │ │ Market Cap, EV, FCF │ raw = integer (4275929874432), fmt = "4.28T" │ │ Volume │ raw = integer (53656670), fmt = "53.66M" │ │ Ratios (PE, PEG, etc.) │ raw = float (35.2), fmt = "35.2" │ │ Dates │ raw = "YYYY-MM-DD" or Unix timestamp │ │ Recommendation │ raw = "buy" | "hold" | "sell" | "strongbuy" │ │ Recommendation Mean │ raw = float (1.0 = Strong Buy, 5.0 = Strong Sell) │ │ Currency │ raw = "USD" | "EUR" | "GBP" | "JPY" | ... │ └────────────────────────┴────────────────────────────────────────────────────┘ KEY MODULES AVAILABLE: price — Live price, pre/post market, volume, currency summaryDetail — Market cap, PE, 52W range, beta, dividend yield defaultKeyStatistics — 55+ fields: EV, shares, EPS, margins, ratios, targets financialData — Cash, debt, FCF, margins, growth, analyst targets assetProfile — Sector, industry, employees, country, description summaryProfile — Alias for assetProfile earningsTrend — Quarterly EPS estimates recommendationTrend — Buy/hold/sell counts calendarEvents — Earnings dates ================================================================================ 5. RESPONSE FORMAT EXAMPLES ================================================================================ SUCCESS (Quote Proxy): HTTP 200 { "results": [ { "symbol": "AAPL", "last_price": 291.13, "change": -4.50, "change_percent": -1.52, "volume": 53656670, "market_cap": 4275929874432, "pe_ratio": 35.2, "exchange": "NMS", "year_high": 317.40, "year_low": 195.07 } ] } SUCCESS (Yahoo Quote): HTTP 200 { "quoteSummary": { "result": [{"price": {...}, "summaryDetail": {...}, ...}], "error": null } } ERROR (No Data Source): HTTP 200 (with error in body) { "results": [], "error": "No data source available. Install openbb or ensure the OpenBB server is running." } ERROR (Yahoo Quote): HTTP 200 { "quoteSummary": { "result": [], "error": {"code": "InternalError", "description": "Invalid ticker"} } } ================================================================================ 6. CODE EXAMPLES ================================================================================ ┌─────────────────────────────────────────────────────────────────────────────┐ │ JAVASCRIPT (Fetch API) │ └─────────────────────────────────────────────────────────────────────────────┘ // 1. Fetch stock quote async function getQuote(symbol) { const url = `https://open-bb.replit.app/api/proxy/equity/price/quote?symbol=${symbol}`; const res = await fetch(url); const data = await res.json(); return data.results[0]; // { last_price, change, volume, ... } } // 2. Fetch Yahoo-compatible full data async function getYahooQuote(symbol) { const modules = "price,summaryDetail,defaultKeyStatistics,financialData,assetProfile"; const url = `https://open-bb.replit.app/api/yahoo/quote/${symbol}?modules=${modules}`; const res = await fetch(url); const data = await res.json(); const result = data.quoteSummary.result[0]; const price = result.price.currentPrice.raw; const marketCap = result.summaryDetail.marketCap.raw; const pe = result.summaryDetail.trailingPE.raw; const evEbitda = result.defaultKeyStatistics.enterpriseToEbitda.raw; return { price, marketCap, pe, evEbitda }; } // 3. Fetch historical chart data async function getChart(symbol, range = "1y", interval = "1d") { const url = `https://open-bb.replit.app/api/yahoo/chart/${symbol}?range=${range}&interval=${interval}`; const res = await fetch(url); const data = await res.json(); const r = data.chart.result[0]; const timestamps = r.timestamp; const closes = r.indicators.quote[0].close; const volumes = r.indicators.quote[0].volume; return timestamps.map((t, i) => ({ date: new Date(t * 1000), close: closes[i], volume: volumes[i] })); } // 4. Fetch fundamentals async function getIncome(symbol, period = "annual", limit = 4) { const url = `https://open-bb.replit.app/api/proxy/equity/fundamental/income?symbol=${symbol}&period=${period}&limit=${limit}`; const res = await fetch(url); const data = await res.json(); return data.results; // Array of fiscal periods } // 5. Fetch news async function getNews(symbol, limit = 10) { const url = `https://open-bb.replit.app/api/proxy/equity/news?symbol=${symbol}&limit=${limit}`; const res = await fetch(url); const data = await res.json(); return data.results; // Array of { title, source, date, url, text } } // 6. Batch test async function runTests() { const res = await fetch("https://open-bb.replit.app/api/test/all"); const data = await res.json(); return data.results; // Array of test results with status & timing } ┌─────────────────────────────────────────────────────────────────────────────┐ │ PYTHON (requests) │ └─────────────────────────────────────────────────────────────────────────────┘ import requests BASE = "https://open-bb.replit.app" # 1. Quote r = requests.get(f"{BASE}/api/proxy/equity/price/quote", params={"symbol": "AAPL"}) quote = r.json()["results"][0] print(f"Price: {quote['last_price']}, Change: {quote['change_percent']}%") # 2. Yahoo Quote r = requests.get(f"{BASE}/api/yahoo/quote/AAPL") result = r.json()["quoteSummary"]["result"][0] price = result["price"]["currentPrice"]["raw"] market_cap = result["summaryDetail"]["marketCap"]["raw"] print(f"Price: {price}, Market Cap: {market_cap}") # 3. Historical r = requests.get(f"{BASE}/api/proxy/equity/price/historical", params={"symbol": "AAPL", "interval": "1d", "start_date": "2024-01-01"}) for row in r.json()["results"][:3]: print(f"{row['date']}: O={row['open']} H={row['high']} L={row['low']} C={row['close']}") # 4. Chart r = requests.get(f"{BASE}/api/yahoo/chart/AAPL", params={"range": "1y", "interval": "1d"}) chart = r.json()["chart"]["result"][0] timestamps = chart["timestamp"] closes = chart["indicators"]["quote"][0]["close"] print(f"Latest: {closes[-1]} at {timestamps[-1]}") # 5. Income Statement r = requests.get(f"{BASE}/api/proxy/equity/fundamental/income", params={"symbol": "AAPL", "period": "annual", "limit": 4}) for row in r.json()["results"]: print(f"FY {row['fiscal_date']}: Revenue={row.get('Total Revenue')}") # 6. News r = requests.get(f"{BASE}/api/proxy/equity/news", params={"symbol": "AAPL", "limit": 5}) for item in r.json()["results"]: print(f"- {item['title']} ({item['source']})") # 7. FRED r = requests.get(f"{BASE}/api/proxy/economy/fred_series", params={"symbol": "GDP"}) for row in r.json()["results"][-3:]: print(f"{row['date']}: GDP={row['value']}") # 8. Batch Test r = requests.get(f"{BASE}/api/test/all") for test in r.json()["results"]: print(f"{test['endpoint']}: {test['status']} ({test['response_time_ms']}ms)") ┌─────────────────────────────────────────────────────────────────────────────┐ │ cURL (Command Line) │ └─────────────────────────────────────────────────────────────────────────────┘ # Health curl "https://open-bb.replit.app/api/health" # Quote curl "https://open-bb.replit.app/api/proxy/equity/price/quote?symbol=AAPL" # Historical curl "https://open-bb.replit.app/api/proxy/equity/price/historical?symbol=AAPL&start_date=2024-01-01" # Yahoo Quote (all modules) curl "https://open-bb.replit.app/api/yahoo/quote/AAPL?modules=price,summaryDetail,defaultKeyStatistics,financialData,assetProfile" # Yahoo Chart curl "https://open-bb.replit.app/api/yahoo/chart/AAPL?range=1y&interval=1d" # Income Statement curl "https://open-bb.replit.app/api/proxy/equity/fundamental/income?symbol=AAPL&period=annual&limit=4" # News curl "https://open-bb.replit.app/api/proxy/equity/news?symbol=AAPL&limit=5" # FRED GDP curl "https://open-bb.replit.app/api/proxy/economy/fred_series?symbol=GDP" # Batch Test curl "https://open-bb.replit.app/api/test/all" ================================================================================ 7. ERROR HANDLING ================================================================================ HTTP Status Codes: 200 — Success (even if data source returns empty, error is in JSON body) 404 — Endpoint not found 422 — Invalid query parameter (FastAPI validation) 500 — Internal server error Always check the response body: Native endpoints: if data["results"] is empty, check data["error"] Yahoo endpoints: if data["quoteSummary"]["result"] is empty, check data["quoteSummary"]["error"] Chart endpoints: if data["chart"]["result"] is empty, check data["chart"]["error"] Common Errors: "No data source available" — OpenBB server not running AND yfinance not installed "Invalid ticker" — Symbol not found (try different exchange suffix, e.g. "SAP.DE") "InternalError" — Unexpected exception, check server logs ================================================================================ 8. INTEGRATION GUIDE FOR LLMs / BOTS ================================================================================ ┌─────────────────────────────────────────────────────────────────────────────┐ │ PATTERN 1: Simple Stock Bot (Discord/Slack/Telegram) │ └─────────────────────────────────────────────────────────────────────────────┘ User says: "What's AAPL trading at?" Bot does: 1. GET /api/proxy/equity/price/quote?symbol=AAPL 2. Extract: last_price, change_percent, volume, market_cap 3. Reply: "AAPL is at $291.13 (-1.52%). Volume: 53.7M. Market cap: $4.28T." User says: "Show me AAPL fundamentals" Bot does: 1. GET /api/yahoo/quote/AAPL?modules=price,summaryDetail,defaultKeyStatistics 2. Extract: price, trailingPE, forwardPE, marketCap, enterpriseToEbitda, pegRatio 3. Reply with formatted table ┌─────────────────────────────────────────────────────────────────────────────┐ │ PATTERN 2: Dashboard / SPA Integration │ └─────────────────────────────────────────────────────────────────────────────┘ Use the Yahoo-compatible endpoints for maximum compatibility. Example: React/Vue dashboard - fetch(/api/yahoo/quote/{symbol}) → Fill KPI cards - fetch(/api/yahoo/chart/{symbol}?range=1y&interval=1d) → Plotly/Chart.js - fetch(/api/proxy/equity/fundamental/income?symbol={symbol}) → Data tables Cache strategy: - Quote data: 5 minutes - Chart data: 15 minutes - Fundamentals: 1 hour - News: 10 minutes ┌─────────────────────────────────────────────────────────────────────────────┐ │ PATTERN 3: DCF / Valuation Bot │ └─────────────────────────────────────────────────────────────────────────────┘ User says: "Calculate DCF for AAPL with 10% growth" Bot does: 1. GET /api/yahoo/quote/AAPL?modules=financialData,defaultKeyStatistics 2. Extract: freeCashflow, sharesOutstanding, totalDebt, totalCash 3. Compute: netDebt = totalDebt - totalCash 4. Run DCF: FCF × (1+g)^n / (1+WACC)^n + Terminal Value 5. Fair Value = (EV - NetDebt) / SharesOutstanding 6. Upside = (FairValue / CurrentPrice - 1) × 100 7. Reply: "Fair Value: $200.75 (-31.0% vs current $291.13)" ┌─────────────────────────────────────────────────────────────────────────────┐ │ PATTERN 4: Multi-Asset Comparison │ └─────────────────────────────────────────────────────────────────────────────┘ User says: "Compare AAPL vs MSFT vs NVDA" Bot does: 1. Promise.all([ fetch(/api/yahoo/quote/AAPL), fetch(/api/yahoo/quote/MSFT), fetch(/api/yahoo/quote/NVDA) ]) 2. Extract: price, trailingPE, marketCap, revenueGrowth, netMargin 3. Build comparison table ┌─────────────────────────────────────────────────────────────────────────────┐ │ PATTERN 5: Alert / Monitoring System │ └─────────────────────────────────────────────────────────────────────────────┘ Cron job every 5 minutes: 1. GET /api/proxy/equity/price/quote?symbol=AAPL 2. If price < 250 OR price > 350 → send alert 3. If volume > avgVolume × 3 → send alert 4. If change_percent > 5% → send alert ================================================================================ 9. FRONTEND ROUTES ================================================================================ These are the human-facing UI pages, also available at the same base URL: / — API Tester (8-panel grid testing all endpoints) /cockpit — Neural Cockpit (AI-powered dashboard with DCF) /tradingview — TradingView-style chart dashboard /tradingview.html — Same as /tradingview /app/ — Static files directory (frontend assets) All frontend pages are served by the same FastAPI backend. ================================================================================ 10. RATE LIMITS & CACHING ================================================================================ Server-Side: - No explicit rate limiting - Backend uses yfinance which has implicit Yahoo Finance limits - Recommended: max 1 request per second per client - Batch test endpoint (/api/test/all) runs 7 calls internally Client-Side Caching: - Quote data: 5 minutes (300000ms) - Chart data: 5 minutes - Fundamentals: 15 minutes - News: 5 minutes Cache Busting: Append "&cb=" to any URL to force fresh data. Example: /api/yahoo/quote/AAPL?cb=1718361600 ================================================================================ APPENDIX: SYMBOL FORMATS ================================================================================ Stocks: US: AAPL, MSFT, TSLA, GOOGL Germany: SAP.DE, BMW.DE, DTE.DE France: MC.PA, TTE.PA Netherlands: ASML.AS Switzerland: NESN.SW, ROG.SW Taiwan: 2330.TW, 2317.TW Crypto: BTC-USD, ETH-USD, SOL-USD Indices: ^GSPC (S&P 500), ^DJI, ^IXIC, ^VIX Bonds: ^TNX (10Y Treasury), ^IRX (13W Treasury) Forex: DX-Y.NYB (Dollar Index) ================================================================================ APPENDIX: DATA SOURCE HIERARCHY ================================================================================ When a request comes in, the server tries sources in this order: 1. OpenBB Server (localhost:6900) — if running 2. OpenBB Python SDK (obb.*) — if installed 3. yfinance direct (Ticker.info, Ticker.history) — fallback 4. Return error if all fail This means the server is self-healing: even without OpenBB installed, yfinance provides full quote, chart, and fundamental data. ================================================================================ CONTACT / SUPPORT ================================================================================ Base URL: https://open-bb.replit.app Health Check: https://open-bb.replit.app/api/health Batch Test: https://open-bb.replit.app/api/test/all For issues, check the batch test endpoint first — it will show which endpoints are working and which are failing. ================================================================================ END OF DOCUMENT ================================================================================