A high-performance Python library for extracting real-time financial data, technical indicators, and social insights from TradingView.
- 🕯️ Candle + Indicators: Stream live OHLCV candles with built-in or custom Pine indicators via
CandleStreamer. Find available indicator IDs withCandleStreamer.get_available_indicators(). - ⚡ Real-time Pricing: Persistent WebSocket connection for millisecond-accurate price updates via
stream_realtime_priceinCandleStreamer. - 📊 Analyst Forecasts: Capture analyst price targets, EPS, and revenue estimates for stocks via
ForecastStreamer.
- 🧩 Technical Analysis: Access RSI, MACD, EMAs, and 100+ other indicators via
Technicals. - 🏛️ Fundamentals: Comprehensive financial statements, ratios, and balance sheets via
Fundamentals. - ⛓️ Options Data: Retrieve full option chains, Greeks, IV, and theoretical prices via
Options. - 📅 Events Calendar: Track Earnings, Dividends, IPOs, and Economic events via
Calendar. - 🌲 Pine Scripts: Manage Pine Scripts (validate/create/edit/delete) via
Pine.
- 🔎 Screener: Run advanced market scans with custom filters across 50+ countries via
Screener. - 🏁 Market Movers: Track top gainers, losers, and most active stocks via
Market Movers. - 🌍 Global Markets: Discover symbols across exchanges and asset classes via
Markets.
- 💡 Trading Ideas: Scrape community-driven trading setups and technical ideas via
Ideas. - 🧠 Heads-up (Minds): Access real-time discussions and community posts via
Minds. - 📰 News Feed: Integrated news stream with granular filters by symbol or region via
News.
from tv_scraper import CandleStreamer
# Initialize the streamer
streamer = CandleStreamer()
# 1. Fetch historical/real-time candles and indicators
result = streamer.get_candles(
exchange="BINANCE",
symbol="BTCUSDT",
timeframe="1m",
numb_candles=5,
indicators=[("STD;RSI", "14")]
)
if result["status"] == "success":
print("Candles:", result["data"]["ohlcv"])
# 2. Or, stream real-time price and indicators continuously
price_stream = streamer.stream_realtime_price(
exchange="BINANCE",
symbol="BTCUSDT",
indicators=[("STD;RSI", "14")]
)
for tick in price_stream:
print(f"Price: {tick['price']}, RSI: {tick['indicators'].get('STD;RSI', {}).get('0')}")For complete documentation, installation guides, and API references, visit:
We welcome contributions! Please see our Contributing Guide for details.
- 🐛 Bug Reports: Open an issue
- 💡 Feature Requests: Start a discussion
Licensed under the MIT License.