TradingView Screener

raw JSON →
3.2.0 verified Sat May 09 auth: no python

A Python library for creating stock screeners using the TradingView API. Current version 3.2.0 supports Python >=3.9. Release cadence is irregular, with multiple feature releases in 2024-2025.

pip install tradingview-screener
error ModuleNotFoundError: No module named 'tradingview_screener'
cause Library not installed. Common when using in a new environment.
fix
Run: pip install tradingview-screener
error AttributeError: 'Query' object has no attribute 'scan'
cause The 'scan()' method was removed in v3.0.0.
fix
Use 'query.get_scanner_data()' instead.
error ImportError: cannot import name 'column' from 'tradingview_screener'
cause The old lowercase 'column' name was removed in v3.0.0.
fix
Use: from tradingview_screener import Column
breaking In v3.0.0, the import path for Column changed from 'tradingview_screener.column' to 'tradingview_screener.Column'. The lowercase 'column' is no longer valid.
fix Use: from tradingview_screener import Column
deprecated The 'scan()' method was deprecated in v2.x and removed in v3.0.0. Use 'get_scanner_data()' instead.
fix Replace query.scan() with query.get_scanner_data()
gotcha API rate limits apply. Excessive requests may get your IP temporarily blocked. The library does not handle retries automatically.
fix Add delays between queries or use a backoff strategy.
gotcha The 'get_scanner_data()' returns a tuple (count, DataFrame). The count is the total number of results, which may differ from the length of the DataFrame if you set limit.
fix Use 'len(df)' for actual rows returned; 'count' is total available.

Basic usage: create a query, add filters with Column, scan and get DataFrame.

from tradingview_screener import Query, col

# Create a query to scan US stocks with price > 100 and volume > 1M
query = Query()
query = query.select('name', 'close', 'volume', 'market_cap_basic')
query = query.where(
    col('close').above(100),
    col('volume').above(1_000_000)
)
query = query.order_by('market_cap_basic', ascending=False)

count, df = query.get_scanner_data()
print(f"Found {count} stocks")
print(df.head())