
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
TradingView-API
Advanced tools
Python implementation for anonymous access to TradingView market data via WebSocket and symbol search
A Python client for the TradingView WebSocket API, providing real-time market data and symbol search functionality.
If you like this project, consider buying me a coffee 😊
pip install tradingview-api
from TradingView import SymbolSearch
# Create search client
search = SymbolSearch()
# Search for symbols
results = search.search_symbol("AAPL")
for result in results:
print(f"{result['symbol']}: {result['description']}")
from TradingView import TradingViewClient
# Create client
client = TradingViewClient()
# Set up event handlers
def on_connect():
print("Connected!")
def on_login():
print("Logged in!")
client.on_connect = on_connect
client.on_login = on_login
# Connect
client.connect()
from TradingView import TradingViewClient, ChartSession
# Create client and connect
client = TradingViewClient()
client.connect()
# Create chart session
session = ChartSession(client, "NASDAQ:AAPL")
# Subscribe to market data
session.subscribe()
# Handle updates
def on_update(data):
print(f"Market data: {data}")
session.on_update = on_update
The package includes comprehensive examples in the examples/ folder:
# Run specific examples
python examples/example1_symbol_search.py
python examples/example2_basic_client.py
python examples/example3_websocket_with_ping.py
python examples/example4_chart_session.py
python examples/example5_multiple_symbols.py
python examples/example6_chart_types.py
example1_symbol_search.py): Demonstrates symbol search functionalityexample2_basic_client.py): Basic WebSocket connection and authenticationexample3_websocket_with_ping.py): Connection with automatic ping/pongexample4_chart_session.py): Real-time market data subscriptionexample5_multiple_symbols.py): Subscribe to multiple symbols simultaneouslysearch_symbol(query: str) -> List[Dict]Search for trading symbols.
Parameters:
query (str): Search query (e.g., "AAPL", "BTC")Returns:
symbol: Symbol identifierdescription: Symbol descriptionexchange: Exchange nametype: Symbol typecurrency: Currency codeconnect()Connect to TradingView WebSocket.
disconnect()Disconnect from TradingView WebSocket.
is_connected() -> boolCheck if connected to TradingView.
on_connect: Called when connectedon_login: Called when logged inon_data: Called when data is receivedon_error: Called when an error occurson_close: Called when connection closes__init__(client: TradingViewClient, symbol: str)Create a new chart session.
Parameters:
client: TradingViewClient instancesymbol: Symbol to subscribe to (e.g., "NASDAQ:AAPL")subscribe()Subscribe to market data for the symbol.
unsubscribe()Unsubscribe from market data.
on_update: Called when market data is receivedon_error: Called when an error occursgit clone https://github.com/kaash04/TradingView-API-Python.git
cd TradingView-Python
pip install -e .
# Run individual examples
python examples/example1_symbol_search.py
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
FAQs
Python implementation for anonymous access to TradingView market data via WebSocket and symbol search
We found that TradingView-API demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.