@ -34,6 +34,13 @@ Stock Oracle is a comprehensive investment analysis API that leverages SEC EDGAR
- **Error Handling** : Detailed error categorization and reporting
- **Error Handling** : Detailed error categorization and reporting
- **Migration Support** : Database transfer capabilities
- **Migration Support** : Database transfer capabilities
### Attention Subsystem (NEW! 🆕)
- **Event-Centric Features** : Wikipedia pageviews + GDELT news coverage for backtesting
- **Spike Detection** : Daily pageview spike ratio and z-score vs. rolling baseline
- **GDELT Integration** : News article count from GDELT GKG (global knowledge graph)
- **Entity Resolution** : Ticker → canonical Wikipedia entity mapping
- **On-Demand Collection** : Collect data per event date without full precomputation
### Alpaca Market Data (NEW! 🆕)
### Alpaca Market Data (NEW! 🆕)
- **Official REST API** : Alpaca Market Data v2 with proper authentication
- **Official REST API** : Alpaca Market Data v2 with proper authentication
- **OHLCV + VWAP** : Daily/intraday bars with volume-weighted average price
- **OHLCV + VWAP** : Daily/intraday bars with volume-weighted average price
@ -580,19 +587,24 @@ curl "http://localhost:18001/api/v1/fred/stats/usage" # Monitor API usage (
# Get latest holdings for QQQ
# Get latest holdings for QQQ
curl "http://localhost:18001/api/v1/etf/holdings/QQQ"
curl "http://localhost:18001/api/v1/etf/holdings/QQQ"
# Get holdings for specific date
# Get holdings for specific date (returns closest prior NPORT-P filing)
curl "http://localhost:18001/api/v1/etf/holdings/QQQM?as_of_date=2024-01-01 "
curl "http://localhost:18001/api/v1/etf/holdings/SPY?as_of_date=2021-06-30 "
# Without detailed holdings (metadata only)
# Without detailed holdings (metadata only)
curl "http://localhost:18001/api/v1/etf/holdings/SPY?include_holdings=false"
curl "http://localhost:18001/api/v1/etf/holdings/SPY?include_holdings=false"
# Bypass Redis cache to force fresh fetch
curl "http://localhost:18001/api/v1/etf/holdings/SPY?as_of_date=2021-06-30& force_refresh=true"
```
```
#### Key Features
#### Key Features
- **Automatic CIK Lookup** : No need to know CIK numbers - just use ticker symbols
- **Automatic CIK Lookup** : No need to know CIK numbers - just use ticker symbols
- **Historical Data Support** : Access NPORT filings from 2019 onwards
- **Historical Data Support** : Access NPORT filings from 2019 onwards
- **Accurate Date Matching** : Returns the closest NPORT-P filing ≤ `as_of_date` within 365-day window
- **Stale Cache Prevention** : DB snapshots >120 days from requested date trigger fresh SEC fetch
- **Date Validation** : Automatically checks if ETF existed on requested date
- **Date Validation** : Automatically checks if ETF existed on requested date
- **Availability Info** : Returns available date ranges when data not found
- **Availability Info** : Returns available date ranges when data not found
- **Fast Performance** : < 0.1s response time with launch date caching
- **Fast Performance** : < 0.1s response time for cached results ; Redis-backed 1-hour cache
#### Response with Availability Information
#### Response with Availability Information
```json
```json
@ -758,9 +770,16 @@ curl "http://localhost:18001/api/v1/news/NVDA/social-only?days_back=3&max_social
- `GET /api/v1/fred/stats/usage` - API usage statistics and daily limit monitoring
- `GET /api/v1/fred/stats/usage` - API usage statistics and daily limit monitoring
#### ETF Holdings
#### ETF Holdings
- `GET /api/v1/etf/holdings/{ticker}` - Get ETF holdings with date support
- `GET /api/v1/etf/holdings/{ticker}` - Get ETF holdings with date support (closest NPORT-P filing)
- `POST /api/v1/etf/admin/refresh-maps` - Refresh ETF CIK mappings
- `POST /api/v1/etf/admin/refresh-maps` - Refresh ETF CIK mappings
#### Attention (Backtesting Features)
- `GET /api/v1/attention/event/{ticker}` - Event-date attention features (Wikipedia pageviews + GDELT coverage)
- `GET /api/v1/attention/entity/{ticker}` - Canonical entity info for ticker
- `POST /api/v1/attention/admin/resolve/{ticker}` - Resolve ticker → canonical entity
- `POST /api/v1/attention/admin/collect/wiki/{ticker}` - Collect Wikipedia pageview data
- `POST /api/v1/attention/admin/collect/gdelt/{ticker}` - Collect GDELT news article data
#### Financial Data
#### Financial Data
- `GET /api/v1/financial/data/{ticker}` - Simple financial data with query parameters
- `GET /api/v1/financial/data/{ticker}` - Simple financial data with query parameters
- `POST /api/v1/financial/data` - Detailed financial data request
- `POST /api/v1/financial/data` - Detailed financial data request