API Reference
Stratosfi exposes a REST API for all platform features. This page documents the main endpoints available.
WARNING
The API is primarily designed for internal use by the Stratosfi frontend. Third-party API access may be subject to rate limits and authentication requirements.
Authentication
All authenticated endpoints require a valid session. Authentication is handled via HTTP-only cookies set during login.
CSRF protection uses the Signed Double Submit Cookie pattern. After login, send the X-CSRF-Token response header value in the x-csrf-token request header for all POST/PUT/DELETE requests.
POST /api/auth/register
Create a new account.
Body:
{
"email": "user@example.com",
"password": "SecurePassword123!",
"name": "Jane Doe"
}POST /api/auth/login
Log in and receive session cookies.
Body:
{
"email": "user@example.com",
"password": "SecurePassword123!"
}POST /api/auth/logout
End the current session and revoke tokens.
POST /api/auth/refresh
Refresh an expired access token using the refresh token cookie.
GET /api/auth/me
Get the current authenticated user's profile and organizations.
Market Data
GET /api/quote/:symbol
Get the current quote for a symbol.
Response:
{
"symbol": "AAPL",
"price": 178.52,
"change": 2.34,
"changePercent": 1.33,
"volume": 52341200,
"marketCap": 2780000000000
}GET /api/quotes?symbols=:symbols
Get batch quotes for multiple symbols (comma-separated).
GET /api/history/:symbol
Get historical OHLCV price data for charting.
Query parameters:
range— time range:1d,5d,1mo,3mo,6mo,1y,5y,maxinterval— candle interval:1m,5m,15m,1h,1d,1wk,1mo
GET /api/search?q=:query
Search for symbols by name or ticker.
GET /api/movers
Get top gainers, losers, and most active stocks.
GET /api/sectors
Get sector ETF performance (daily, weekly, monthly, quarterly, yearly).
GET /api/details/:symbol
Get company details including sector, industry, description, and key metrics.
GET /api/financials/:symbol
Get financial statements (income, balance sheet, key stats).
GET /api/prices/:symbol
Get historical daily prices with OHLCV data.
GET /api/options/:symbol
Get options chain with expirations, calls, puts, and Greeks.
GET /api/holders/:symbol
Get institutional holders breakdown.
GET /api/management/:symbol
Get executive team data (names, titles, compensation).
GET /api/peers/:symbol
Get peer comparison data.
GET /api/analysts/:symbol
Get analyst ratings trend and history.
GET /api/dividends/:symbol
Get dividend history.
News
GET /api/news
Get general financial news.
GET /api/news/:symbol
Get news specific to a symbol.
Crypto
GET /api/crypto/market
Get global crypto market data (total market cap, BTC dominance).
GET /api/crypto/coins
Get top cryptocurrencies with prices, market cap, and changes.
GET /api/crypto/fear-greed
Get the Crypto Fear & Greed index.
Economic Data
GET /api/economic/calendar
Get upcoming economic events and news.
GET /api/econ/central-banks
Get central bank interest rates.
GET /api/econ/indicators
Get economic indicators.
Query parameters:
code— indicator code (e.g.,CPGRLE01)
Portfolio & Trading
GET /api/portfolio
Get the current user's portfolio (cash, positions, history).
POST /api/portfolio/buy
Buy shares of a stock.
Body:
{
"symbol": "AAPL",
"shares": 10,
"price": 178.52
}POST /api/portfolio/sell
Sell shares of a stock.
Body:
{
"symbol": "AAPL",
"shares": 5,
"price": 180.00
}GET /api/broker/orders
Get pending trade orders.
Watchlists & Alerts
GET /api/watchlists
Get user watchlists.
POST /api/watchlist/:name
Create or update a watchlist.
Body:
{
"symbols": ["AAPL", "GOOGL", "MSFT"]
}GET /api/alerts
Get price alerts.
GET /api/preferences
Get user preferences (ticker tape symbols, layout settings).
AI
POST /api/ai/chat
Send a message to the AI assistant.
Body:
{
"message": "Analyze AAPL",
"symbol": "AAPL"
}POST /api/ai/analyze/:symbol
Get AI-generated stock analysis.
Screener
GET /api/screener
Get screener results with filters.
Query parameters:
minPrice,maxPrice— price rangeminVolume— minimum daily volumeminMarketCap,maxMarketCap— market cap rangesector— sector filtersort— sort fieldorder—ascordesc
Dashboards
GET /api/dashboards
Get user dashboards.
POST /api/dashboards
Create a new dashboard.
Body:
{
"name": "My Dashboard",
"icon": "chart"
}Company Explorer
GET /api/explorer/expand/:symbol
Get company relationship graph (nodes, edges).
GET /api/explorations
Get saved explorations.
GET /api/analysis/supply-chain/:symbol
Get AI-generated supply chain analysis (requires auth).
Other
GET /api/ipos
Get IPO news and calendar.
GET /api/polymarket/markets
Get prediction market data from Polymarket.
WebSocket
ws://[host]/ws
Real-time quote streaming via WebSocket.
Subscribe to a symbol:
{ "type": "subscribe", "symbol": "AAPL" }Unsubscribe:
{ "type": "unsubscribe", "symbol": "AAPL" }Incoming messages:
{
"type": "quote",
"symbol": "AAPL",
"price": 178.55,
"change": 2.37,
"changePercent": 1.35,
"volume": 52345600
}Rate Limits
| Endpoint Type | Limit |
|---|---|
| General | 100 requests / 15 min |
| Market Data | 200 requests / 15 min |
| Authentication | 10 requests / 15 min |
| Trading | 30 requests / 15 min |
Rate limit headers are included in responses:
X-RateLimit-Limit— max requests allowedX-RateLimit-Remaining— requests remainingX-RateLimit-Reset— time when the limit resets (Unix timestamp)