{"openapi":"3.0.0","info":{"title":"toon.haus","version":"0.3.0","description":"Financial data API for AI agents. Stock quotes, metrics, earnings, price history, options, financials, market news, forex, and crypto. Powered by x402 micropayments."},"servers":[{"url":"https://finance.toonhaus.dev"}],"components":{"schemas":{"StockQuote":{"type":"object","properties":{"ticker":{"type":"string"},"name":{"type":"string"},"industry":{"type":"string"},"exchange":{"type":"string"},"currency":{"type":"string"},"price":{"type":"number","description":"Current price"},"change":{"type":"number","nullable":true,"description":"Price change today"},"changePercent":{"type":"number","nullable":true,"description":"Percent change today"},"open":{"type":"number","description":"Opening price"},"high":{"type":"number","description":"Day high"},"low":{"type":"number","description":"Day low"},"previousClose":{"type":"number","description":"Previous close"},"marketCap":{"type":"number","description":"Market cap in dollars"},"sharesOutstanding":{"type":"number","description":"Shares outstanding"},"logo":{"type":"string"},"website":{"type":"string"},"ipo":{"type":"string","description":"IPO date"},"timestamp":{"type":"string","description":"ISO 8601 timestamp"}},"required":["ticker","name","industry","exchange","currency","price","change","changePercent","open","high","low","previousClose","marketCap","sharesOutstanding","logo","website","ipo","timestamp"]},"ApiError":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"StockMetrics":{"type":"object","properties":{"ticker":{"type":"string"},"valuation":{"type":"object","properties":{"pe":{"type":"number","nullable":true,"description":"P/E ratio TTM"},"forwardPE":{"type":"number","nullable":true,"description":"Forward P/E"},"peg":{"type":"number","nullable":true,"description":"PEG ratio 5yr"},"priceToBook":{"type":"number","nullable":true,"description":"Price to book"},"priceToSales":{"type":"number","nullable":true,"description":"Price to sales TTM"},"evToEbitda":{"type":"number","nullable":true,"description":"EV/EBITDA"}},"required":["pe","forwardPE","peg","priceToBook","priceToSales","evToEbitda"]},"profitability":{"type":"object","properties":{"grossMargin":{"type":"number","nullable":true,"description":"Gross margin TTM"},"operatingMargin":{"type":"number","nullable":true,"description":"Operating margin TTM"},"netMargin":{"type":"number","nullable":true,"description":"Net margin TTM"},"roe":{"type":"number","nullable":true,"description":"Return on equity TTM"},"roa":{"type":"number","nullable":true,"description":"Return on assets TTM"}},"required":["grossMargin","operatingMargin","netMargin","roe","roa"]},"growth":{"type":"object","properties":{"revenueGrowthTTM":{"type":"number","nullable":true},"epsGrowthTTM":{"type":"number","nullable":true},"revenueGrowthQuarterly":{"type":"number","nullable":true}},"required":["revenueGrowthTTM","epsGrowthTTM","revenueGrowthQuarterly"]},"dividends":{"type":"object","properties":{"yield":{"type":"number","nullable":true,"description":"Forward dividend yield"},"payoutRatio":{"type":"number","nullable":true}},"required":["yield","payoutRatio"]},"trading":{"type":"object","properties":{"beta":{"type":"number","nullable":true},"avgVolume10D":{"type":"number","nullable":true},"avgVolume3M":{"type":"number","nullable":true},"week52High":{"type":"number","nullable":true},"week52Low":{"type":"number","nullable":true}},"required":["beta","avgVolume10D","avgVolume3M","week52High","week52Low"]}},"required":["ticker","valuation","profitability","growth","dividends","trading"]},"StockEarnings":{"type":"object","properties":{"ticker":{"type":"string"},"earnings":{"type":"array","items":{"type":"object","properties":{"period":{"type":"string"},"year":{"type":"number","nullable":true},"quarter":{"type":"number","nullable":true},"actual":{"type":"number","nullable":true,"description":"Actual EPS"},"estimate":{"type":"number","nullable":true,"description":"Estimated EPS"},"surprise":{"type":"number","nullable":true},"surprisePercent":{"type":"number","nullable":true}},"required":["period","year","quarter","actual","estimate","surprise","surprisePercent"]}}},"required":["ticker","earnings"]},"StockRecommendations":{"type":"object","properties":{"ticker":{"type":"string"},"current":{"type":"object","nullable":true,"properties":{"strongBuy":{"type":"number"},"buy":{"type":"number"},"hold":{"type":"number"},"sell":{"type":"number"},"strongSell":{"type":"number"},"period":{"type":"string"}},"required":["strongBuy","buy","hold","sell","strongSell","period"]},"history":{"type":"array","items":{"type":"object","properties":{"strongBuy":{"type":"number"},"buy":{"type":"number"},"hold":{"type":"number"},"sell":{"type":"number"},"strongSell":{"type":"number"},"period":{"type":"string"}},"required":["strongBuy","buy","hold","sell","strongSell","period"]}}},"required":["ticker","current","history"]},"StockInsiders":{"type":"object","properties":{"ticker":{"type":"string"},"transactions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"date":{"type":"string","description":"Transaction date"},"filingDate":{"type":"string"},"shares":{"type":"number","description":"Shares changed (negative = sold)"},"price":{"type":"number"},"type":{"type":"string","description":"derivative or non-derivative"},"code":{"type":"string","description":"Transaction code: P=purchase, S=sale, M=option exercise, F=tax withholding, G=gift, A=award/grant, D=disposition to issuer, C=conversion"}},"required":["name","date","filingDate","shares","price","type","code"]}},"sentiment":{"type":"object","nullable":true,"properties":{"monthlyMSPR":{"type":"number","description":"Monthly share purchase ratio (-100 to 100)"},"monthlyChange":{"type":"number","description":"Net shares changed this month"}},"required":["monthlyMSPR","monthlyChange"]}},"required":["ticker","transactions","sentiment"]},"StockPeers":{"type":"object","properties":{"ticker":{"type":"string"},"peers":{"type":"array","items":{"type":"string"}}},"required":["ticker","peers"]},"StockFilings":{"type":"object","properties":{"ticker":{"type":"string"},"filings":{"type":"array","items":{"type":"object","properties":{"form":{"type":"string","description":"Filing type (10-K, 10-Q, 8-K, etc.)"},"filedDate":{"type":"string"},"acceptedDate":{"type":"string"},"reportUrl":{"type":"string"},"filingUrl":{"type":"string"},"accessNumber":{"type":"string"}},"required":["form","filedDate","acceptedDate","reportUrl","filingUrl","accessNumber"]}}},"required":["ticker","filings"]},"StockNews":{"type":"object","properties":{"ticker":{"type":"string"},"news":{"type":"array","items":{"type":"object","properties":{"headline":{"type":"string"},"summary":{"type":"string"},"source":{"type":"string"},"url":{"type":"string"},"publishedAt":{"type":"string","description":"ISO 8601 timestamp"},"category":{"type":"string"}},"required":["headline","summary","source","url","publishedAt","category"]}}},"required":["ticker","news"]},"StockLobbying":{"type":"object","properties":{"ticker":{"type":"string"},"data":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["ticker","data"]},"StockGovSpending":{"type":"object","properties":{"ticker":{"type":"string"},"data":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["ticker","data"]},"StockPriceHistory":{"type":"object","properties":{"ticker":{"type":"string"},"period":{"type":"string"},"interval":{"type":"string"},"currency":{"type":"string"},"prices":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"ISO 8601 date"},"open":{"type":"number"},"high":{"type":"number"},"low":{"type":"number"},"close":{"type":"number"},"volume":{"type":"number"}},"required":["date","open","high","low","close","volume"]}}},"required":["ticker","period","interval","currency","prices"]},"StockPriceTarget":{"type":"object","properties":{"ticker":{"type":"string"},"currentPrice":{"type":"number"},"targetHigh":{"type":"number","nullable":true},"targetLow":{"type":"number","nullable":true},"targetMean":{"type":"number","nullable":true},"targetMedian":{"type":"number","nullable":true},"numberOfAnalysts":{"type":"number","nullable":true},"recommendationKey":{"type":"string","nullable":true},"recommendationMean":{"type":"number","nullable":true}},"required":["ticker","currentPrice","targetHigh","targetLow","targetMean","targetMedian","numberOfAnalysts","recommendationKey","recommendationMean"]},"StockDividends":{"type":"object","properties":{"ticker":{"type":"string"},"dividendRate":{"type":"number","nullable":true},"dividendYield":{"type":"number","nullable":true},"exDividendDate":{"type":"string","nullable":true},"payoutRatio":{"type":"number","nullable":true},"fiveYearAvgDividendYield":{"type":"number","nullable":true},"history":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"amount":{"type":"number"}},"required":["date","amount"]}}},"required":["ticker","dividendRate","dividendYield","exDividendDate","payoutRatio","fiveYearAvgDividendYield","history"]},"StockOptions":{"type":"object","properties":{"ticker":{"type":"string"},"expirationDates":{"type":"array","items":{"type":"string"}},"selectedExpiration":{"type":"string"},"calls":{"type":"array","items":{"type":"object","properties":{"strike":{"type":"number"},"lastPrice":{"type":"number"},"bid":{"type":"number"},"ask":{"type":"number"},"volume":{"type":"number","nullable":true},"openInterest":{"type":"number","nullable":true},"impliedVolatility":{"type":"number","nullable":true},"expiration":{"type":"string"}},"required":["strike","lastPrice","bid","ask","volume","openInterest","impliedVolatility","expiration"]}},"puts":{"type":"array","items":{"type":"object","properties":{"strike":{"type":"number"},"lastPrice":{"type":"number"},"bid":{"type":"number"},"ask":{"type":"number"},"volume":{"type":"number","nullable":true},"openInterest":{"type":"number","nullable":true},"impliedVolatility":{"type":"number","nullable":true},"expiration":{"type":"string"}},"required":["strike","lastPrice","bid","ask","volume","openInterest","impliedVolatility","expiration"]}}},"required":["ticker","expirationDates","selectedExpiration","calls","puts"]},"StockFinancials":{"type":"object","properties":{"ticker":{"type":"string"},"type":{"type":"string","description":"income, balance, cashflow"},"period":{"type":"string","description":"quarterly or annual"},"statements":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"data":{"type":"object","additionalProperties":{"nullable":true}}},"required":["date","data"]}}},"required":["ticker","type","period","statements"]},"ScreenResults":{"type":"object","properties":{"screener":{"type":"string"},"count":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string"},"name":{"type":"string","nullable":true},"price":{"type":"number","nullable":true},"change":{"type":"number","nullable":true},"changePercent":{"type":"number","nullable":true},"marketCap":{"type":"number","nullable":true},"volume":{"type":"number","nullable":true}},"required":["symbol","name","price","change","changePercent","marketCap","volume"]}}},"required":["screener","count","results"]},"MarketNews":{"type":"object","properties":{"news":{"type":"array","items":{"type":"object","properties":{"headline":{"type":"string"},"summary":{"type":"string"},"source":{"type":"string"},"url":{"type":"string"},"publishedAt":{"type":"string","description":"ISO 8601 timestamp"},"category":{"type":"string"}},"required":["headline","summary","source","url","publishedAt","category"]}}},"required":["news"]},"EarningsCalendar":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"earnings":{"type":"array","items":{"type":"object","properties":{"ticker":{"type":"string"},"date":{"type":"string"},"hour":{"type":"string","description":"bmo=before market, amc=after market, dmh=during"},"quarter":{"type":"number"},"year":{"type":"number"},"epsEstimate":{"type":"number","nullable":true},"epsActual":{"type":"number","nullable":true},"revenueEstimate":{"type":"number","nullable":true},"revenueActual":{"type":"number","nullable":true}},"required":["ticker","date","hour","quarter","year","epsEstimate","epsActual","revenueEstimate","revenueActual"]}}},"required":["from","to","earnings"]},"IpoCalendar":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"ipos":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"name":{"type":"string"},"ticker":{"type":"string","nullable":true},"exchange":{"type":"string","nullable":true},"shares":{"type":"number","nullable":true},"priceRange":{"type":"string","nullable":true},"status":{"type":"string"}},"required":["date","name","ticker","exchange","shares","priceRange","status"]}}},"required":["from","to","ipos"]},"MarketIndices":{"type":"object","properties":{"indices":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string"},"name":{"type":"string"},"price":{"type":"number"},"change":{"type":"number","nullable":true},"changePercent":{"type":"number","nullable":true}},"required":["symbol","name","price","change","changePercent"]}},"timestamp":{"type":"string"}},"required":["indices","timestamp"]},"MarketSectors":{"type":"object","properties":{"sectors":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string"},"name":{"type":"string"},"price":{"type":"number"},"change":{"type":"number","nullable":true},"changePercent":{"type":"number","nullable":true}},"required":["symbol","name","price","change","changePercent"]}},"timestamp":{"type":"string"}},"required":["sectors","timestamp"]},"MarketTrending":{"type":"object","properties":{"region":{"type":"string"},"symbols":{"type":"array","items":{"type":"object","properties":{"symbol":{"type":"string"},"name":{"type":"string","nullable":true},"price":{"type":"number","nullable":true},"change":{"type":"number","nullable":true},"changePercent":{"type":"number","nullable":true}},"required":["symbol","name","price","change","changePercent"]}}},"required":["region","symbols"]},"ForexRate":{"type":"object","properties":{"pair":{"type":"string"},"rate":{"type":"number"},"change":{"type":"number","nullable":true},"changePercent":{"type":"number","nullable":true},"bid":{"type":"number","nullable":true},"ask":{"type":"number","nullable":true},"dayHigh":{"type":"number","nullable":true},"dayLow":{"type":"number","nullable":true},"fiftyDayAverage":{"type":"number","nullable":true},"timestamp":{"type":"string"}},"required":["pair","rate","change","changePercent","bid","ask","dayHigh","dayLow","fiftyDayAverage","timestamp"]},"CryptoPrice":{"type":"object","properties":{"symbol":{"type":"string"},"name":{"type":"string"},"price":{"type":"number"},"change":{"type":"number","nullable":true},"changePercent":{"type":"number","nullable":true},"volume24h":{"type":"number","nullable":true},"marketCap":{"type":"number","nullable":true},"circulatingSupply":{"type":"number","nullable":true},"dayHigh":{"type":"number","nullable":true},"dayLow":{"type":"number","nullable":true},"timestamp":{"type":"string"}},"required":["symbol","name","price","change","changePercent","volume24h","marketCap","circulatingSupply","dayHigh","dayLow","timestamp"]}},"parameters":{}},"paths":{"/api/stock/quote":{"get":{"tags":["Stock"],"summary":"Real-time stock quote with company profile","operationId":"getStockQuote","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"}],"responses":{"200":{"description":"Stock quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockQuote"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/metrics":{"get":{"tags":["Stock"],"summary":"Valuation, profitability, growth, and trading metrics","operationId":"getStockMetrics","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"}],"responses":{"200":{"description":"Stock metrics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockMetrics"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/earnings":{"get":{"tags":["Stock"],"summary":"Historical earnings with EPS actuals vs estimates","operationId":"getStockEarnings","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"description":"Maximum number of results to return","example":20},"required":false,"description":"Maximum number of results to return","name":"limit","in":"query"}],"responses":{"200":{"description":"Earnings history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockEarnings"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/recommendations":{"get":{"tags":["Stock"],"summary":"Analyst recommendation trends","operationId":"getStockRecommendations","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"}],"responses":{"200":{"description":"Recommendations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockRecommendations"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/insiders":{"get":{"tags":["Stock"],"summary":"Insider transactions and sentiment","operationId":"getStockInsiders","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start date (YYYY-MM-DD)","example":"2025-01-01"},"required":false,"description":"Start date (YYYY-MM-DD)","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date (YYYY-MM-DD)","example":"2026-04-23"},"required":false,"description":"End date (YYYY-MM-DD)","name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"description":"Maximum number of results to return","example":20},"required":false,"description":"Maximum number of results to return","name":"limit","in":"query"}],"responses":{"200":{"description":"Insider data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockInsiders"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/peers":{"get":{"tags":["Stock"],"summary":"Company peers by industry, sub-industry, or sector","operationId":"getStockPeers","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"string","enum":["industry","subIndustry","sector"],"description":"Grouping criteria for peer selection","example":"sector"},"required":false,"description":"Grouping criteria for peer selection","name":"grouping","in":"query"}],"responses":{"200":{"description":"Peer list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPeers"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/filings":{"get":{"tags":["Stock"],"summary":"SEC filings (10-K, 10-Q, 8-K, etc.)","operationId":"getStockFilings","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"string","description":"Filing type filter (10-K, 10-Q, 8-K, 4, SC 13D, etc.)","example":"10-K"},"required":false,"description":"Filing type filter (10-K, 10-Q, 8-K, 4, SC 13D, etc.)","name":"form","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start date (YYYY-MM-DD)","example":"2025-01-01"},"required":false,"description":"Start date (YYYY-MM-DD)","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date (YYYY-MM-DD)","example":"2026-04-23"},"required":false,"description":"End date (YYYY-MM-DD)","name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"description":"Maximum number of results to return","example":20},"required":false,"description":"Maximum number of results to return","name":"limit","in":"query"},{"schema":{"type":"string","description":"CIK number for company lookup"},"required":false,"description":"CIK number for company lookup","name":"cik","in":"query"},{"schema":{"type":"string","description":"Specific filing access number"},"required":false,"description":"Specific filing access number","name":"accessNumber","in":"query"}],"responses":{"200":{"description":"Filing list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockFilings"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/news":{"get":{"tags":["Stock"],"summary":"Company-specific news articles","operationId":"getStockNews","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start date (YYYY-MM-DD)","example":"2025-01-01"},"required":false,"description":"Start date (YYYY-MM-DD)","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date (YYYY-MM-DD)","example":"2026-04-23"},"required":false,"description":"End date (YYYY-MM-DD)","name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum articles to return","example":10},"required":false,"description":"Maximum articles to return","name":"limit","in":"query"}],"responses":{"200":{"description":"News articles","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockNews"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/lobbying":{"get":{"tags":["Stock"],"summary":"Corporate lobbying activities","operationId":"getStockLobbying","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start date (YYYY-MM-DD)","example":"2025-01-01"},"required":false,"description":"Start date (YYYY-MM-DD)","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date (YYYY-MM-DD)","example":"2026-04-23"},"required":false,"description":"End date (YYYY-MM-DD)","name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"description":"Maximum number of results to return","example":20},"required":false,"description":"Maximum number of results to return","name":"limit","in":"query"}],"responses":{"200":{"description":"Lobbying data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLobbying"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/gov-spending":{"get":{"tags":["Stock"],"summary":"Government spending awards by company","operationId":"getStockGovSpending","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start date (YYYY-MM-DD)","example":"2025-01-01"},"required":false,"description":"Start date (YYYY-MM-DD)","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date (YYYY-MM-DD)","example":"2026-04-23"},"required":false,"description":"End date (YYYY-MM-DD)","name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"description":"Maximum number of results to return","example":20},"required":false,"description":"Maximum number of results to return","name":"limit","in":"query"}],"responses":{"200":{"description":"Government spending data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockGovSpending"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/price-history":{"get":{"tags":["Stock"],"summary":"Historical OHLCV price data","operationId":"getStockPriceHistory","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"string","enum":["1d","5d","1mo","3mo","6mo","1y","2y","5y","10y","ytd","max"],"default":"1y","description":"Time period for historical data","example":"1y"},"required":false,"description":"Time period for historical data","name":"period","in":"query"},{"schema":{"type":"string","enum":["1m","2m","5m","15m","30m","1h","1d","5d","1wk","1mo","3mo"],"default":"1d","description":"Candle interval. Intraday (1m-1h) limited to last 60 days.","example":"1d"},"required":false,"description":"Candle interval. Intraday (1m-1h) limited to last 60 days.","name":"interval","in":"query"},{"schema":{"type":"boolean","nullable":true,"default":false,"description":"Include pre-market and after-hours data","example":false},"required":false,"description":"Include pre-market and after-hours data","name":"includePrePost","in":"query"}],"responses":{"200":{"description":"Price history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPriceHistory"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/price-target":{"get":{"tags":["Stock"],"summary":"Analyst price targets and recommendation summary","operationId":"getStockPriceTarget","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"}],"responses":{"200":{"description":"Price targets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockPriceTarget"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/dividends":{"get":{"tags":["Stock"],"summary":"Dividend rate, yield, and 5-year history","operationId":"getStockDividends","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"}],"responses":{"200":{"description":"Dividend data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockDividends"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/options":{"get":{"tags":["Stock"],"summary":"Options chain (calls and puts) for an expiration","operationId":"getStockOptions","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Options expiration date (YYYY-MM-DD). Omit for nearest expiration.","example":"2026-05-16"},"required":false,"description":"Options expiration date (YYYY-MM-DD). Omit for nearest expiration.","name":"date","in":"query"}],"responses":{"200":{"description":"Options chain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockOptions"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/financials":{"get":{"tags":["Stock"],"summary":"Financial statements (income, balance sheet, cash flow)","operationId":"getStockFinancials","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Stock ticker symbol","example":"AAPL"},"required":true,"description":"Stock ticker symbol","name":"ticker","in":"query"},{"schema":{"type":"string","enum":["income","balance","cashflow"],"default":"income","description":"Financial statement type","example":"income"},"required":false,"description":"Financial statement type","name":"type","in":"query"},{"schema":{"type":"string","enum":["quarterly","annual"],"default":"quarterly","description":"Reporting period","example":"quarterly"},"required":false,"description":"Reporting period","name":"period","in":"query"}],"responses":{"200":{"description":"Financial statements","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockFinancials"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/stock/screen":{"post":{"tags":["Stock"],"summary":"Stock screener — predefined presets or custom query with sector, valuation, growth filters","operationId":"screenStocks","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"screener":{"type":"string","enum":["aggressive_small_caps","day_gainers","day_losers","growth_technology_stocks","most_actives","most_shorted_stocks","small_cap_gainers","undervalued_growth_stocks","undervalued_large_caps","conservative_foreign_funds","high_yield_bond","portfolio_anchors","solid_large_growth_funds","solid_midcap_growth_funds","top_mutual_funds"],"description":"Predefined screener name. Use this OR query, not both.","example":"day_gainers"},"query":{"type":"object","properties":{"operator":{"type":"string","description":"Logical: \"and\", \"or\". Comparison: \"eq\", \"gt\", \"lt\", \"gte\", \"lte\", \"btwn\", \"is-in\""},"operands":{"type":"array","items":{"nullable":true},"description":"For and/or: array of sub-query objects. For comparisons: [field, value] or [field, min, max]"}},"required":["operator","operands"],"description":"Custom query tree. Use this OR screener, not both.","example":{"operator":"and","operands":[{"operator":"eq","operands":["sector","Technology"]},{"operator":"lt","operands":["peratio.lasttwelvemonths",25]}]}},"sortField":{"type":"string","default":"intradaymarketcap","description":"Field to sort by (custom queries only)","example":"intradaymarketcap"},"sortAsc":{"type":"boolean","default":false,"description":"Sort ascending (default: false = descending)"},"count":{"type":"integer","minimum":1,"maximum":250,"default":25,"description":"Number of results (max 250)","example":25}},"description":"Stock screener. Two modes:\n\n1. **Predefined**: Pass \"screener\" with a preset name (e.g. \"day_gainers\", \"most_actives\")\n2. **Custom**: Pass \"query\" with a filter tree for sector, valuation, growth, and more\n\nCustom query fields:\n- Categorical (eq/is-in): sector, region, exchange\n- Valuation (gt/lt/btwn): peratio.lasttwelvemonths, pegratio_5y, pricebookratio.quarterly\n- Market: intradaymarketcap, percentchange, dayvolume, avgdailyvol3m, beta\n- Growth: epsgrowth.lasttwelvemonths, quarterlyrevenuegrowth.quarterly, totalrevenues1yrgrowth.lasttwelvemonths\n- Profitability: returnonequity.lasttwelvemonths, netincomemargin.lasttwelvemonths, grossprofitmargin.lasttwelvemonths\n- Dividends: forward_dividend_yield, consecutive_years_of_dividend_growth_count\n- Leverage: totaldebtequity.lasttwelvemonths, currentratio.lasttwelvemonths\n- Short: short_percentage_of_float.value, days_to_cover_short.value\n\nSectors: Technology, Healthcare, Financial Services, Consumer Cyclical, Consumer Defensive, Industrials, Energy, Real Estate, Basic Materials, Communication Services, Utilities"}}}},"responses":{"200":{"description":"Screen results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScreenResults"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/market/news":{"get":{"tags":["Market"],"summary":"General market news with category filtering","operationId":"getMarketNews","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum articles to return","example":20},"required":false,"description":"Maximum articles to return","name":"limit","in":"query"},{"schema":{"type":"string","enum":["general","forex","crypto","merger"],"default":"general","description":"News category filter","example":"general"},"required":false,"description":"News category filter","name":"category","in":"query"},{"schema":{"type":"integer","nullable":true,"description":"Only return news after this ID (for pagination)"},"required":false,"description":"Only return news after this ID (for pagination)","name":"minId","in":"query"}],"responses":{"200":{"description":"Market news","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketNews"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/market/earnings-calendar":{"get":{"tags":["Market"],"summary":"Upcoming and recent earnings dates","operationId":"getEarningsCalendar","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start date (YYYY-MM-DD). Defaults to today.","example":"2026-04-20"},"required":false,"description":"Start date (YYYY-MM-DD). Defaults to today.","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date (YYYY-MM-DD). Defaults to 7 days from now.","example":"2026-04-30"},"required":false,"description":"End date (YYYY-MM-DD). Defaults to 7 days from now.","name":"to","in":"query"},{"schema":{"type":"string","description":"Filter by specific ticker symbol","example":"AAPL"},"required":false,"description":"Filter by specific ticker symbol","name":"symbol","in":"query"},{"schema":{"type":"boolean","nullable":true,"default":false,"description":"Include international markets"},"required":false,"description":"Include international markets","name":"international","in":"query"}],"responses":{"200":{"description":"Earnings calendar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EarningsCalendar"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/market/ipo-calendar":{"get":{"tags":["Market"],"summary":"Upcoming IPO schedule","operationId":"getIpoCalendar","parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start date (YYYY-MM-DD). Defaults to today.","example":"2026-04-01"},"required":false,"description":"Start date (YYYY-MM-DD). Defaults to today.","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"End date (YYYY-MM-DD). Defaults to 30 days from now.","example":"2026-04-30"},"required":false,"description":"End date (YYYY-MM-DD). Defaults to 30 days from now.","name":"to","in":"query"}],"responses":{"200":{"description":"IPO calendar","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IpoCalendar"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/market/indices":{"get":{"tags":["Market"],"summary":"Major market indices (S&P 500, Nasdaq, Dow, Russell)","operationId":"getMarketIndices","responses":{"200":{"description":"Market indices","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketIndices"}}}}}}},"/api/market/sectors":{"get":{"tags":["Market"],"summary":"Sector ETF performance (XLK, XLF, XLV, etc.)","operationId":"getMarketSectors","responses":{"200":{"description":"Sector performance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketSectors"}}}}}}},"/api/market/trending":{"get":{"tags":["Market"],"summary":"Trending symbols by region","operationId":"getMarketTrending","parameters":[{"schema":{"type":"string","default":"US","description":"Market region code","example":"US"},"required":false,"description":"Market region code","name":"region","in":"query"}],"responses":{"200":{"description":"Trending symbols","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketTrending"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/forex/rate":{"get":{"tags":["Forex"],"summary":"Real-time forex exchange rate","operationId":"getForexRate","parameters":[{"schema":{"type":"string","minLength":6,"maxLength":10,"description":"Currency pair (e.g. EURUSD, GBPJPY)","example":"EURUSD"},"required":true,"description":"Currency pair (e.g. EURUSD, GBPJPY)","name":"pair","in":"query"}],"responses":{"200":{"description":"Exchange rate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForexRate"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/crypto/price":{"get":{"tags":["Crypto"],"summary":"Real-time cryptocurrency price","operationId":"getCryptoPrice","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":10,"description":"Cryptocurrency symbol (e.g. BTC, ETH, SOL)","example":"BTC"},"required":true,"description":"Cryptocurrency symbol (e.g. BTC, ETH, SOL)","name":"symbol","in":"query"}],"responses":{"200":{"description":"Crypto price","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CryptoPrice"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}