📊 API Overview
🏥 System Health & Performance
📋 Available Tickers
🔄 Refresh Schedule
🔍 Ticker Data Explorer
Defaults to today if not specified
Number of records to return. Ignored if start_date is provided
Specifying start_date will ignore limit parameter
Defaults: cache/ma/redis/snap ON, ema OFF
⚡ Quick Examples
Base Intervals
Minute Aggregations
Day Aggregations
Cryptocurrency Markets
Global Markets (Yahoo)
📊 Analysis API
Top/Bottom Performers
Defaults to latest data
Returns performers for each trading hour (5 hours total)
📊 Sector Analysis & Momentum
Analyzing sectors...
Sector Strength (Average of MA20 & MA50 Scores)
How it works: Each sector's score is the average of all stocks' MA20 and MA50 positions. Positive (green) = trading above moving averages (bullish), Negative (red) = below averages (bearish). Larger bars indicate stronger trends.
📊 Volume Profile Analysis
Defaults to today if not specified
Leave empty for single day analysis
Number of price levels (2-100, default: 10 for readability)
Default: 70% of volume
⚠️ Note: Volume Profile analysis requires minute-level (1m) data. Best used for intraday analysis. Historical analysis limited by minute data availability.
Relative Rotation Graph (RRG)
Default: VNINDEX
WMA smoothing period (4-50, default: 10)
Number of historical trail points (0 = no trails, 1-120)
Exclude tickers below this volume (default: 100000)
Compute RRG at this date (default: today)
How RRG works: RS-Ratio ≥ 100 means outperforming the benchmark. RS-Momentum ≥ 100 means relative strength is improving. Leading (top-right) = outperforming + improving. Weakening (bottom-right) = outperforming but losing steam. Lagging (bottom-left) = underperforming + deteriorating. Improving (top-left) = underperforming but recovering.
📚 API Reference
/tickers
Retrieve historical price data with 20 technical indicators.
symbol - Ticker symbol(s) (optional, repeatable: symbol=VCB&symbol=FPT)interval - Time interval (optional, default: 1D)start_date - Start date YYYY-MM-DD (optional, overrides limit)end_date - End date YYYY-MM-DD (optional, defaults to today)limit - Number of records from end_date (optional, ignored if start_date provided)format - Response format: json, csv (default: json)legacy - Divide stock prices by 1000 (optional, default: false)cache - Use 60s cache (optional, default: true)400 - Invalid date format or parameters404 - Ticker not found500 - Server error (JSON: {"error": "message"})/tickers/group
List all available ticker symbols grouped by data availability.
/health
Check API health status and performance metrics.
/analysis/top-performers
Get top/bottom performing stocks with hourly breakdown option.
date - Analysis date YYYY-MM-DD (optional, defaults to latest)sort_by - Sort metric (optional, default: close_changed)direction - Sort direction: asc, desc (optional, default: desc)limit - Number of results (optional, default: 10, max: 100)sector - Filter by sector name (optional, e.g., VN30, NGAN_HANG)min_volume - Minimum trading volume (optional, default: 10000)with_hour - Include hourly breakdown (optional, default: false)/analysis/ma-scores-by-sector
Moving average analysis grouped by stock sectors with filtering options.
date - Analysis date YYYY-MM-DD (optional, defaults to latest)ma_period - MA period: 10, 20, 50, 100, 200 (optional, default: 20)min_score - Minimum MA score threshold (optional, default: 0.0)above_threshold_only - Only stocks above threshold (optional, default: false)top_per_sector - Max stocks per sector (optional, default: 10, max: 50)/analysis/rrg
Relative Rotation Graph: plot tickers by RS-Ratio vs RS-Momentum against a benchmark.
benchmark - Benchmark ticker (optional, default: VNINDEX)algorithm - Algorithm: jdk (optional, default: jdk)period - WMA smoothing period 4-50 (optional, default: 10)trails - Number of trail points 0-120 (optional, default: 10, clamped to 1-120 when > 0)min_volume - Exclude tickers with volume below this value (optional, default: 1000)mode - Data source: vn, crypto, yahoo, all (optional, default: vn)/raw/*
Legacy GitHub proxy for backward compatibility.
/explorer
Serves the API Explorer UI (this page).
/public/*
Static assets for the Explorer UI (CSS, JS, images).
⚙️ Technical Details
- Cache TTL: 60 seconds for all endpoints
- Memory Cache: Last 1 year of daily data (4GB limit)
- Disk Cache: Hourly/minute data with LRU eviction (500MB limit)
- Cache Control: Use
cache=falseto force refresh - Response Time: Typically 50-200ms with cache, 500ms-2s without
- VCI API Rate: ~30 requests/minute (upstream limit)
- CORS: Enabled for subdomains and localhost
- No Authentication: Public API (rate-limited by design)
- Request Size: No hard limit, practical limit ~100MB
- Retry Logic: Exponential backoff, max 5 retries
- Aggregated Intervals: Computed on-demand from base data
- 5m/15m/30m: Derived from 1m data (OHLCV aggregation)
- 4h: Derived from 1h data (OHLCV aggregation)
- 1W/2W/1M: Derived from 1D data (weekly/monthly aggregation)
- Processing Time: 100-500ms for aggregated intervals
- Indicators: 20 technical indicators calculated during sync
- 400 Bad Request: Invalid parameters, date format errors
- 404 Not Found: Ticker symbol not available
- 429 Too Many Requests: Upstream rate limit exceeded
- 500 Server Error: Internal processing errors
- Error Format: JSON: {"error": "descriptive message"}
- Market Hours: 9:00-15:00 ICT (UTC+7) Monday-Friday
- Daily Sync: Every 15s (trading), 5min (off-hours)
- Hourly/Minute Sync: Every 5min (trading), 30min (off-hours)
- Weekends: Reduced sync frequency
- Time Zone: All timestamps in ICT (Vietnam time)
💡 Tips & Best Practices
- CSV format is faster for large datasets
- Use start_date to limit data range
- Disk cache improves repeat queries
- Check /health for data freshness
- 1m data has limited history
- Use 1D for long-term analysis
- CORS enabled for subdomains
- JSON format for web apps
- CSV format for data science tools
- Check ticker availability first
- Verify date format (YYYY-MM-DD)
- Ensure interval matches data