finvizfinance

raw JSON →
1.3.0 verified Mon Apr 27 auth: no python

A Python library to download financial data from Finviz, including stock screeners, quotes, news, insider trades, and ETF holders. Current version 1.3.0, requires Python >=3.9. Released under MIT license with moderate release cadence (major updates every few months).

pip install finvizfinance
error No module named 'finvizfinance'
cause Library not installed or wrong Python environment.
fix
Run pip install finvizfinance in the correct environment.
error AttributeError: module 'finvizfinance' has no attribute 'FinvizFinance'
cause Importing the class incorrectly or using a very old version (pre-0.14).
fix
Use from finvizfinance import FinvizFinance if you need the legacy class, or better import specific submodules like from finvizfinance.quote import Quote.
error KeyError: 'Rating'
cause Trying to access a key that doesn't exist in the returned dict (e.g., for a ticker with no ratings).
fix
Check if the dict contains the expected keys using .get('Rating', 'N/A') or verify the data structure first.
breaking v1.0.0 changed the internal structure: `finvizfinance` objects now return dicts instead of pandas DataFrames in some methods. Code relying on DataFrame methods may break.
fix Check return types: use `type(result)` and adjust code to handle dicts or use `pd.DataFrame(result)` if pandas needed.
gotcha Finviz may block automated requests if rate-limited. The library uses a simple sleep between requests, but heavy use can lead to IP bans or CAPTCHAs.
fix Use proxies, add delays between requests, and avoid scraping at high frequency. Consider rotating user agents.
gotcha The `ticker_outer_rating` method may return an empty list or missing data for some tickers (e.g., ETFs or less-covered stocks). This is not an error but reflects Finviz's limited coverage.
fix Always check if the result is non-empty before indexing. Handle empty results gracefully.
deprecated The `ticker_outer_rating` method was renamed from an older `outer_rating` method in v0.14.x. The old name may still work but is deprecated.
fix Use `ticker_outer_rating` instead of `outer_rating`.

Fetches outer rating (broker ratings) for a stock ticker. No API key required.

from finvizfinance.quote import Quote

# Get fundamental data for a ticker
finviz = Quote()
# Replace 'AAPL' with any stock symbol
data = finviz.ticker_outer_rating('AAPL')
print(data)