finviz is compatible with Python 3.5+ only
What is Finviz?
Finviz.com aims to make market information accessible and provides a lot of data in visual snapshots, allowing traders and investors to quickly find the stock, future or forex pair they are looking for. The site provides advanced screeners, market maps, analysis, comparative tools and charts.
Any quotes data displayed on finviz.com is delayed by 15 minutes for NASDAQ, and 20 minutes for NYSE and AMEX. This API should NOT be used for live trading, it's main purpuse is financial analysis, research and data scraping.
pip install finviz
from finviz.screener import Screener
filters = ['exch_nasd', 'idx_sp500'] # Shows companies in NASDAQ which are in the S&P500
stocks = Screener(filters=filters, order='price') # Get the first 50 results sorted by price ascending
# Export the screener results to .csv
stocks.to_csv()
# Create a SQLite database
stocks.to_sqlite()
# Print the table into the console
print(stocks)
stocks.get_charts(period='m', chart_type='c', size='l', ta=False) # Monthly, Candles, Large, No Technical Analysis
# period='d' > daily
# period='w' > weekly
# period='m' > monthly
# chart_type='c' > candle
# chart_type='l' > lines
# size='m' > small
# size='l' > large
# ta=True > display technical analysis
# ta=False > ignore technical analysis
You can read the rest of the documentation inside the docstrings.
