Skip to content

API Reference

The Quantum Trader API provides programmatic access to stock data, strategy management, backtesting, and portfolio tracking.

http://localhost:8501/api/v1

Swagger 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 →

Task Queue

Background task management and monitoring. Learn more →

Terminal window
curl -X POST http://localhost:8501/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "[email protected]", "password": "your_password"}'
Terminal window
curl http://localhost:8501/api/v1/strategies \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Terminal window
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"
}
CodeDescription
200Success
201Created
204No Content (successful deletion)
400Bad Request (validation error)
401Unauthorized (invalid/missing token)
403Forbidden (insufficient permissions)
404Not Found
422Unprocessable Entity
429Too Many Requests (rate limited)
500Internal Server Error
import axios from 'axios';
const api = axios.create({
baseURL: 'http://localhost:8501/api/v1',
headers: {
'Authorization': `Bearer ${accessToken}`
}
});
// Fetch strategies
const { data: strategies } = await api.get('/strategies');
// Create backtest
const { 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
});