Swagger UI
Interactive API explorer at /api/v1/docs
The Quantum Trader API provides programmatic access to stock data, strategy management, backtesting, and portfolio tracking.
http://localhost:8501/api/v1Swagger UI
Interactive API explorer at /api/v1/docs
ReDoc
Beautiful API documentation at /api/v1/redoc
Authentication
JWT-based authentication with access and refresh tokens. Learn more →
Stock Data
OHLCV data with automatic interval aggregation. Learn more →
Indicators
Technical indicators with customizable parameters. Learn more →
Strategies
Create and manage trading strategies. Learn more →
Backtests
Run and analyze strategy backtests. Learn more →
Portfolios
Manage portfolios and positions. Learn more →
Tickers
Manage tracked symbols and data collection. Learn more →
Task Queue
Background task management and monitoring. Learn more →
curl -X POST http://localhost:8501/api/v1/auth/login \ -H "Content-Type: application/json" \curl http://localhost:8501/api/v1/strategies \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN"curl "http://localhost:8501/api/v1/stocks/AAPL/ohlcv?interval=1d&limit=100"All responses are JSON with consistent structure:
{ "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My Strategy", "created_at": "2025-01-15T10:30:00Z"}{ "detail": "Strategy not found"}{ "items": [...], "total": 100, "limit": 50, "offset": 0}| Code | Description |
|---|---|
200 | Success |
201 | Created |
204 | No Content (successful deletion) |
400 | Bad Request (validation error) |
401 | Unauthorized (invalid/missing token) |
403 | Forbidden (insufficient permissions) |
404 | Not Found |
422 | Unprocessable Entity |
429 | Too Many Requests (rate limited) |
500 | Internal Server Error |
import axios from 'axios';
const api = axios.create({ baseURL: 'http://localhost:8501/api/v1', headers: { 'Authorization': `Bearer ${accessToken}` }});
// Fetch strategiesconst { data: strategies } = await api.get('/strategies');
// Create backtestconst { data: backtest } = await api.post('/backtests', { strategy_id: strategies[0].id, symbols: ['AAPL'], start_date: '2024-01-01', end_date: '2024-12-31', initial_capital: 100000});import requests
BASE_URL = "http://localhost:8501/api/v1"headers = {"Authorization": f"Bearer {access_token}"}
# Fetch strategiesstrategies = requests.get( f"{BASE_URL}/strategies", headers=headers).json()
# Create backtestbacktest = requests.post( f"{BASE_URL}/backtests", headers=headers, json={ "strategy_id": strategies[0]["id"], "symbols": ["AAPL"], "start_date": "2024-01-01", "end_date": "2024-12-31", "initial_capital": 100000 }).json()# LoginTOKEN=$(curl -s -X POST http://localhost:8501/api/v1/auth/login \ -H "Content-Type: application/json" \ | jq -r '.access_token')
# Fetch strategiescurl http://localhost:8501/api/v1/strategies \ -H "Authorization: Bearer $TOKEN"
# Create backtestcurl -X POST http://localhost:8501/api/v1/backtests \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "strategy_id": "UUID_HERE", "symbols": ["AAPL"], "start_date": "2024-01-01", "end_date": "2024-12-31", "initial_capital": 100000 }'