Welcome to Finviz Finance in Python’s documentation!

It is a Finviz Finance information downloader.

Installation (python >= v3.5)

> virtualenv -p python3 virtualenvironment
> source virtualenvironment/bin/activate
> pip install finvizfinance

Quote Examples

import pandas as pd
from finvizfinance.quote import finvizfinance

stock = finvizfinance('tsla')

Example downloading chart:

stock.TickerCharts(out_dir='asset')

Example getting individual ticker information

stock_fundament = stock.ticker_fundament()
stock_description = stock.ticker_description()
outer_ratings_df = stock.ticker_outer_ratings()
news_df = stock.ticker_news()
inside_trader_df = stock.ticker_inside_trader()

Screener Example

from finvizfinance.screener.overview import Overview
foverview = Overview()
filters_dict = {'Exchange':'AMEX','Sector':'Basic Materials'}
foverview.set_filter(filters_dict=filters_dict)
df = foverview.screener_view()
df.head()

News Example

from finvizfinance.news import News
fnews = News()
all_news = fnews.get_news()
# all_news['news'].head()
# all_news['blogs'].head()

Insider Example

from finvizfinance.insider import Insider
finsider = Insider(option='top owner trade')
finsider.get_insider().head()

Contents

Quote

Getting individual ticker information.

class finvizfinance.quote.Quote

quote Getting current price of the ticker

get_current(ticker)

Getting current price of the ticker.

Returns:price of the ticker
Return type:price(float)
class finvizfinance.quote.Statements

Getting statements of ticker

get_statements(ticker, statement='I', timeframe='A')

Getting statements of ticker.

Parameters:
  • ticker (str) – ticker string
  • statement (str) – I(Income Statement), B(Balace Sheet), C(Cash Flow)
  • timeframe (str) – A(Annual), Q(Quarter)
Returns:

statements table

Return type:

df(pandas.DataFrame)

class finvizfinance.quote.finvizfinance(ticker, verbose=0, ticker_fundament_table_index=6)

Getting information from the individual ticker.

Parameters:
  • ticker (str) – ticker string
  • verbose (int) – choice of visual the progress. 1 for visualize progress.
  • ticker_fundament_table_index (int) – table index of the stock fundamental. change only if change on finviz side.
ticker_charts(timeframe='daily', charttype='advanced', out_dir='', urlonly=False)

Download ticker charts.

Parameters:
  • timeframe (str) – choice of timeframe (daily, weekly, monthly).
  • charttype (str) – choice of type of chart (candle, line, advanced).
  • out_dir (str) – output image directory. default none.
  • urlonly (bool) – choice of downloading charts, default: downloading chart
Returns:

url for the chart

Return type:

charturl(str)

ticker_description()

Get ticker description.

Returns:ticker description.
Return type:description(str)
ticker_full_info()

Get all the ticker information.

Returns:insider information table
Return type:df(pandas.DataFrame)
ticker_fundament(raw=True)

Get ticker fundament.

Parameters:raw (boolean) – if True, the data is raw.
Returns:ticker fundament.
Return type:fundament(dict)
ticker_inside_trader()

Get insider information table.

Returns:insider information table
Return type:df(pandas.DataFrame)
ticker_news()

Get news information table.

Returns:news information table
Return type:df(pandas.DataFrame)
ticker_outer_ratings()

Get outer ratings table.

Returns:outer ratings table
Return type:df(pandas.DataFrame)
ticker_signal()

Get all the trading signals from finviz.

Returns:get all the ticker signals as list.
Return type:ticker_signals(list)

Screener

Getting screener information.

Overview

class finvizfinance.screener.overview.Overview(screener_table_index=21)

Getting information from the finviz screener overview page. :Parameters: screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

compare(ticker, compare_list, order='ticker', verbose=1)

Get screener table of similar property (Sector, Industry, Country)

Parameters:
  • ticker (str) – the ticker to compare
  • compare_list (list) – choice of compare property (Sector, Industry, Country) or combination.
  • order (str) – sort the table by the choice of order
  • verbose (int) – choice of visual the progress. 1 for visualize progress
Returns:

screener information table

Return type:

df(pandas.DataFrame)

get_filter_options(screen_filter)

Get filters options.

Parameters:screen_filter (str) – screen filter for checking options
Returns:all the available filters
Return type:filter_options(list)
get_filters()

Get filters.

Returns:all the available filters
Return type:filters(list)
get_orders()

Get orders.

Returns:all the available orders
Return type:orders(list)
get_signal()

Get signals.

Returns:all the available trading signals
Return type:signals(list)
screener_view(order='ticker', limit=-1, select_page=None, verbose=1, ascend=True)

Get screener table.

Parameters:
  • order (str) – sort the table by the choice of order.
  • limit (int) – set the top k rows of the screener.
  • select_page (int) – set the page of the screener.
  • verbose (int) – choice of visual the progress. 1 for visualize progress.
  • ascend (bool) – if True, the order is ascending.
Returns:

screener information table

Return type:

df(pandas.DataFrame)

set_filter(signal='', filters_dict={}, ticker='')

Update the settings.

Parameters:
  • signal (str) – ticker signal
  • filters_dict (dict) – dictionary of filters
  • ticker (str) – ticker string

Valuation

class finvizfinance.screener.valuation.Valuation(screener_table_index=21)

Valuation inherit from overview module. Getting information from the finviz screener valuation page.

Parameters:screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

Financial

class finvizfinance.screener.financial.Financial(screener_table_index=21)

Financial inherit from overview module. Getting information from the finviz screener financial page.

Parameters:screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

Ownership

class finvizfinance.screener.ownership.Ownership(screener_table_index=21)

Ownership inherit from overview module. Getting information from the finviz screener ownership page.

Parameters:screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

Technical

class finvizfinance.screener.technical.Technical(screener_table_index=21)

Technical inherit from overview module. Getting information from the finviz screener technical page.

Parameters:screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

Custom

class finvizfinance.screener.custom.Custom(screener_table_index=21)

Custom inherit from overview module. Getting information from the finviz screener custom page.

Parameters:screener_table_index (int) – table index of the stock screener. change only if change on finviz side.
get_columns()

Get information about the columns

Returns:return the index and column name.
Return type:columns(dict)
screener_view(order='ticker', limit=-1, select_page=None, verbose=1, ascend=True, columns=[0, 1, 2, 3, 4, 5, 6, 7, 65, 66, 67])

Get screener table.

Parameters:
  • order (str) – sort the table by the choice of order.
  • limit (int) – set the top k rows of the screener.
  • select_page (int) – set the page of the screener.
  • verbose (int) – choice of visual the progress. 1 for visualize progress.
  • ascend (bool) – if True, the order is ascending.
  • columns (list) – columns of your choice. Default index: 0,1,2,3,4,5,6,7,65,66,67.
Returns:

screener information table

Return type:

df(pandas.DataFrame)

Tickers

class finvizfinance.screener.ticker.Ticker(screener_table_index=21)

Financial inherit from overview module. Getting information from the finviz screener ticker page.

Parameters:screener_table_index (int) – table index of the stock screener. change only if change on finviz side.
screener_view(limit=-1, verbose=1)

Get screener table.

Parameters:verbose (int) – choice of visual the progress. 1 for visualize progress.
Returns:get all the tickers as list.
Return type:tickers(list)

Group

Getting group information.

Overview

class finvizfinance.group.overview.Overview(screener_table_index=7)

Getting information from the finviz group overview page. :Parameters: screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

get_group()

Get groups.

Returns:all the available groups.
Return type:groups(list)
get_orders()

Get orders.

Returns:all the available orders.
Return type:orders(list)
screener_view(group='Sector', order='Name')

Get screener table.

Parameters:
  • group (str) – choice of group option.
  • order (str) – sort the table by the choice of order.
Returns:

group information table.

Return type:

df(pandas.DataFrame)

Valuation

class finvizfinance.group.valuation.Valuation(screener_table_index=7)

Valuation inherit from overview module. Getting information from the finviz group valuation page. :Parameters: screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

Performance

class finvizfinance.group.performance.Performance(screener_table_index=7)

Performance inherit from overview module. Getting information from the finviz group performance page. :Parameters: screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

Spectrum

class finvizfinance.group.spectrum.Spectrum

Spectrum inherit from overview module. Getting information from the finviz group spectrum page.

screener_view(group='Sector', order='Name', out_dir='')

Get screener table.

Parameters:
  • group (str) – choice of group option.
  • order (str) – sort the table by the choice of order.

News

Getting trading news.

class finvizfinance.news.News(news_table_index=8)

Getting information from the finviz news page. :Parameters: news_table_index (int) – table index of the news page. change only if change on finviz side.

get_news()

Get insider information table.

Retrieves table information from finviz finance news.

Returns:news table
Return type:news(dict)

Insider

Getting trading insider.

class finvizfinance.insider.Insider(option='latest', insider_table_index=6)

Getting information from the finviz insider page.

Parameters:
  • option (str) – choose a option (latest, latest buys, latest sales, top week, top week buys, top week sales, top owner trade, top owner buys, top owner sales, insider_id)
  • ticker_fundament_table_index (int) – table index of the insider. change only if change on finviz side.
get_insider()

Get insider information table.

Returns:insider information table
Return type:df(pandas.DataFrame)

Forex

Getting foreign exchange information.

class finvizfinance.forex.Forex(screener_table_index=5)

Getting information from the finviz forex page. :Parameters: screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

chart(forex, timeframe='D', urlonly=False)

Get forex chart.

Parameters:
  • forex (str) – foreign exchange name
  • timeframe (str) – choice of timeframe(5M, H, D, W, M)
  • urlonly (bool) – choice of downloading charts, default: downloading chart
Returns:

url for the chart

Return type:

charturl(str)

performance(change='percent')

Get forex performance table.

Parameters:change (str) – choose an option of change(percent, PIPS)
Returns:forex performance table
Return type:df(pandas.DataFrame)

Crypto

Getting crypto currency information.

class finvizfinance.crypto.Crypto(screener_table_index=5)

Getting information from the finviz crypto page. :Parameters: screener_table_index (int) – table index of the stock screener. change only if change on finviz side.

chart(crypto, timeframe='D', urlonly=False)

Get crypto chart.

Parameters:
  • crypto (str) – crypto currency
  • timeframe (str) – choice of timeframe(5M, H, D, W, M)
  • urlonly (bool) – choice of downloading charts, default: downloading chart
Returns:

url for the chart

Return type:

charturl(str)

performance()

Get crypto performance table.

Returns:crypto performance table
Return type:df(pandas.DataFrame)

Future

Getting future information.

class finvizfinance.future.Future

Getting information from the finviz future page.

performance(timeframe='D')

Get forex performance table.

Parameters:timeframe (str) – choice of timeframe(D, W, M, Q, HY, Y)
Returns:forex performance table
Return type:df(pandas.DataFrame)

Earnings

Getting earning dates information.

class finvizfinance.earnings.Earnings(period='This Week')

Partition dataframe of ticker information of period of earning dates(This Week, Next Week, Previous Week, This Month) into dates

Parameters:period (str) – choose an option of period(This Week, Next Week, Previous Week, This Month).
output_csv(output_dir='earning_days')

Output dataframes to csv files.

Parameters:output_dir (str) – name of the output directory.
output_excel(output_file='earning_days.xlsx')

Output dataframes to single Excel file.

Parameters:output_file (str) – name of the output excel file.
partition_days(mode='financial')

Partition dataframe to separate dataframes according to the dates.

Parameters:mode (str) – choose an option of period(financial, overview, valuation, ownership, performance, technical).

Calendar

Getting economic calendar information.

class finvizfinance.calendar.Calendar

Getting information from the finviz calendar page.

calendar()

Get economic calendar table.

Returns:economic calendar table
Return type:df(pandas.DataFrame)

Indices and tables