API Reference
AlgoTradingAI exposes a REST API consumed by the frontend. This page documents the key endpoints, authentication, and rate limits.
Authentication
All authenticated endpoints require a JWT bearer token in the Authorization header:
Authorization: Bearer <access_token>- Access tokens are obtained via
POST /api/auth/loginorPOST /api/auth/google. - Refresh tokens are used to obtain new access tokens via
POST /api/auth/refresh. - Tokens are JWTs with configurable expiry.
Core Endpoints
Auth
POST /api/auth/register— Create accountPOST /api/auth/login— Email/password loginPOST /api/auth/google— Google OAuth loginPOST /api/auth/refresh— Refresh access tokenGET /api/auth/me— Current user profile (includes active plan)
Watchlist
GET /api/watchlist— List user watchlist symbolsPOST /api/watchlist— Add symbol to watchlistDELETE /api/watchlist/:symbol— Remove symbol
Advisor
POST /api/advisor/advise— Run full advisory pipeline (analysis + news + sentiment + AI)GET /api/advisor/stream?request_id=— SSE endpoint for pipeline progressPOST /api/advisor/simulate— Quick backtest simulationGET /api/advisor/decisions— List recent decisionsGET /api/advisor/decision/:id— Get decision with audit trail
Forecast
POST /api/forecast— Run fused forecast (multi-model)GET /api/forecast/:symbol— Get latest forecast for symbolGET /api/forecast/:symbol/horizons— Get all horizon forecasts
Trade Signals
GET /api/trades/live— Active trade signalsGET /api/trades/closed— Closed trade historyGET /api/trades/stats— Aggregate performance statistics
Paper Playground
POST /api/playground/orders— Place paper orderGET /api/playground/holdings— View paper holdingsGET /api/playground/history— Order history
Public SEO
GET /api/public/seo/stocks— Public stock summaries (rate-limited)GET /api/public/seo/stocks/:slug— Stock detail by slugGET /api/public/seo/options-watchlist— Options watchlist
Rate Limits
- Public endpoints: 30 requests per 60 seconds per IP.
- Authenticated endpoints: per-user limits based on plan tier.
- Broker-proxied operations: subject to Zerodha KiteConnect rate limits.
Error Responses
Errors follow a consistent JSON format:
{
"detail": "Error description",
"code": "error_code"
}Common error codes:
unauthorized— Missing or invalid tokenforbidden— Insufficient plan tierrate_limited— Too many requestsbroker_required_for_more_symbols— Connect broker to add more symbolssymbol_limit_reached— Plan symbol limit exceeded
Webhooks
Webhook support for external integrations is planned for a future release. Currently, real-time updates are delivered via Server-Sent Events (SSE) on the advisor stream endpoint.