Screen stocks based on a set of criteria. This can be useful to find companies that match a specific criteria or your analysis. Further filtering can be done by utilising the Finance Toolkit and calculating the relevant ratios to filter by. This can be:

  • Market capitalization (market_cap_higher, market_cap_lower)
  • Price (price_higher, price_lower)
  • Beta (beta_higher, beta_lower)
  • Volume (volume_higher, volume_lower)
  • Dividend (dividend_higher, dividend_lower)
  • Classification (sector, industry, country, exchange, is_etf)

The result is capped at limit companies, 1000 by default. Getting back exactly that many means the list was truncated, which is warned about in the log; narrow the criteria or raise the limit to see the remainder.

Also known as: filter stocks, financial criteria screener.

Stock Screener in Python

get_stock_screener is part of the Discovery module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_stock_screener as shown below.

from financetoolkit import Discovery

discovery = Discovery(api_key="FINANCIAL_MODELING_PREP_KEY")

discovery.get_stock_screener(
    market_cap_higher=1000000,
    market_cap_lower=200000000000,
    price_higher=100,
    price_lower=200,
    beta_higher=1,
    beta_lower=1.5,
    volume_higher=100000,
    volume_lower=2000000,
    dividend_higher=1,
    dividend_lower=2,
    is_etf=False
)

Which returns:

Symbol Name Market Cap Sector Industry Beta Price Dividend Volume Exchange Exchange Code Country
NKE NIKE, Inc. 163403295604 Consumer Cyclical Footwear & Accessories 1.079 107.36 1.48 1045865 New York Stock Exchange NYSE US
SAF.PA Safran SA 66234006559 Industrials Aerospace & Defense 1.339 160.16 1.35 119394 Paris EURONEXT FR
ROST Ross Stores, Inc. 46724188589 Consumer Cyclical Apparel Retail 1.026 138.785 1.34 169879 NASDAQ Global Select NASDAQ US
HES Hess Corporation 44694706090 Energy Oil & Gas E&P 1.464 145.51 1.75 123147 New York Stock Exchange NYSE US

Parameters

get_stock_screener accepts the following parameters:

  • market_cap_higher (int): The minimum market capitalization of the stock, in the currency of the listing rather than in millions.
  • market_cap_lower (int): The maximum market capitalization of the stock.
  • price_higher (int): The minimum price of the stock.
  • price_lower (int): The maximum price of the stock.
  • beta_higher (int): The minimum beta of the stock.
  • beta_lower (int): The maximum beta of the stock.
  • volume_higher (int): The minimum volume of the stock, in shares traded.
  • volume_lower (int): The maximum volume of the stock.
  • dividend_higher (int): The minimum dividend of the stock, as an amount per share over the last annual period rather than as a yield.
  • dividend_lower (int): The maximum dividend of the stock.
  • sector (str | None): The sector to restrict the screen to, e.g. “Energy”.
  • industry (str | None): The industry to restrict the screen to, e.g. “Biotechnology”.
  • country (str | None): The two-letter country code to restrict the screen to, e.g. “US”.
  • exchange (str | None): The exchange code to restrict the screen to, e.g. “NASDAQ”.
  • is_etf (bool | None): Whether to restrict the screen to ETFs or to exclude them.
  • limit (int): The maximum number of companies to return. Defaults to 1000.
Share