API Endpoints Reference

Complete reference for all Stratify REST API endpoints with request/response examples, parameters, and error handling.

Base URL: http://localhost:8000/api/v1
Authentication: Bearer token required for most endpoints

Market Data Endpoints

GET/api/v1/market/quote/{symbol}

Get current market quote for a symbol.

Parameters:

  • symbol (path, required) - Stock symbol (e.g., AAPL)

Response:

{
  "success": true,
  "data": {
    "symbol": "AAPL",
    "price": 182.50,
    "change": 2.30,
    "change_percent": 1.28,
    "volume": 52847392,
    "high": 183.20,
    "low": 180.15,
    "market_cap": 2847392847392
  }
}
GET/api/v1/market/ohlcv/{symbol}

Get historical OHLCV data.

Parameters:

  • symbol (path) - Stock symbol
  • timeframe (query) - 1m, 5m, 15m, 1h, 1d, 1w
  • from (query) - Start date (YYYY-MM-DD)
  • to (query) - End date (YYYY-MM-DD)

Watchlist Endpoints

GET/api/v1/watchlists

List all user watchlists.

POST/api/v1/watchlists

Create new watchlist.

Request Body:

{
  "name": "Tech Stocks",
  "description": "Large-cap technology companies",
  "symbols": ["AAPL", "MSFT", "GOOGL"]
}
PUT/api/v1/watchlists/{id}/symbols

Add symbols to watchlist.

Backtesting Endpoints

POST/api/v1/backtesting/run

Run a backtest.

Request Body:

{
  "strategy_id": "uuid-here",
  "symbol": "AAPL",
  "start_date": "2024-01-01",
  "end_date": "2024-12-31",
  "initial_capital": 100000,
  "timeframe": "1d"
}
GET/api/v1/backtesting/results/{backtest_id}

Get backtest results and metrics.

Paper Trading Endpoints

POST/api/v1/paper/orders

Place a paper trading order.

Request Body:

{
  "portfolio_id": "uuid-here",
  "symbol": "AAPL",
  "side": "buy",
  "order_type": "market",
  "quantity": 100
}
GET/api/v1/paper/portfolios/{id}/positions

Get current positions in paper portfolio.

Standard Response Formats

Success Response

{
  "success": true,
  "data": { ... },
  "message": "Operation successful",
  "timestamp": "2026-01-22T15:30:00Z"
}

Error Response

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid symbol",
    "details": { "symbol": "Must be valid ticker" }
  },
  "timestamp": "2026-01-22T15:30:00Z"
}