Building a Stock Screener for Analyst Ratings with FinancialModelingPrep APIs (Python)
Sample data sourced with FinancialModelingPrep API
Stock screeners by analyst ratings is a costly premium feature on many stock recommendation websites like Yahoo Finance or StockTargetAdvisor.com that you can easily build yourself. Selecting stocks by analyst sentiment has many benefits such as using them as starting point for stock analysis, risk management for portfolio adjustment by identifying overvalued stocks or as a criteria for coarse universe selection.
In this post we are going to build a stock screener in Python that fetches analyst ratings from FinancialModelingPrep (FMP) and sorts stocks by most bullish ratings.
This story is solely for general information purposes, and should not be relied upon for trading recommendations or financial advice. Source code and information is provided for educational purposes only, and should not be relied upon to make an investment decision. Please review my full cautionary guidance before continuing.
What is FinancialModelingPrep?
FinancialModelingPrep (FMP) is a financial data service provider for live and historical data with one of the most extensive API suites available for retail traders. The APIs range from stock prices, financial statements (income statements, balance sheets, cash flow statements), company fundamentals, market data, financial ratios, and many specialized data sets. The main types of assets covered are equities, crypto and FOREX.
The main features of this platforms are:
Comprehensive financial information for equities, crypto and FOREX
Access to financial calendars like earnings, dividends, stock splits and IPO calendar
Access to group trading information like insider trading, senate trading
Affordable tired plans for retail traders
Easy REST API integration using API keys
Historical market data ideas for backtesting strategies
Detailed documentation including integration examples.
Useful links:
Why consider analyst ratings?
A stock rating by a number of financial analysts is no guarantee that the stock price is actually going to go up or down in the future. However, analyst ratings can provide a collective insights from a number of financial experts that might be beneficial for several reasons, such as:
Ratings are based on in-depth research from financial experts which may consider a variety of sources of information such as growth potential, momentum, fundamentals, news, strategic moves, industry role and potential for disruption.
Considering ratings from a variety of analysis provides a diverse range of opinions which may offer a more comprehensive evaluation of the potential of a stock.
Analyst ratings are used by traders and investors as a gauge of the stocks potential so a consensus rating by a large pool analysts could result in trading activity that follows these recommendations.
Stocks that are frequently subject to analyst recommendations are often covered in financial news stories and may attract more attention by investors.