为AI代理提供实时机构期权流向情报和动量分析。从OptionWhales API获取实时期权流向数据,包括当前...
Fetches real-time institutional options flow data from the OptionWhales API to detect whale trades, momentum shifts, and abnormal activity across US equities.
Set your API key:
bash
export OPTIONWHALES_API_KEY="your_key_here"
bash
# Market-wide flow (top 20 by momentum)
python scripts/optionflow.py flow
# Top momentum stocks
python scripts/optionflow.py momentum
# Abnormal trades (potential insider activity)
python scripts/optionflow.py abnormal
# Specific ticker deep dive
python scripts/optionflow.py ticker AAPL
python scripts/optionflow.py ticker TSLA
python scripts/optionflow.py ticker NVDA
The JSON output can be piped to other tools:
bash
python scripts/optionflow.py flow | grep "BULLISH" | head -5
Use in automated alerting by setting up cron jobs or integrating with notification systems.
Data refreshes every few minutes. For real-time streaming, consider the WebSocket API which is available on OptionWhales Pro plans. The current script focuses on REST API polling which is suitable for most use cases without requiring WebSocket infrastructure.