Best Sources of Financial Data to Use with Python

In my previous post, we looked at the most useful Python libraries to perform financial analysis. In this post, we keep learning about available resources to support our financial analysis in Python. To be more precise, we are going to discuss what are the best sources of financial data to use with Python. Below are my top 7 resources:

  1. SEC – Free
  2. Financialmodelingprep – Fremium
  3. AlphaVantage – Freemium
  4. Yahoo Finance – Free
  5. Finviz – Free
  6. DBNomics – Free
  7. TradingView – Freemium
SEC is the main source of financial data
SEC is the main source of financial data

1. SEC – Securities and Exchange Commision

The SEC is the regulatory body ensuring that companies communicate promptly and in a faithful manner. It protects the integrity of the capital markets. All public companies must report their financial statements and other material information to the SEC. The SEC makes all the information available to the public.

Therefore, as financial analysts, we benefit from SEC services and resources. For instance, we can use the SEC Edgar database to retrieve multiple financial data points such as annual reports or proxy statements.

Below are a couple of examples on how can we use Python to retrieve financial data from the SEC:

2. Financialmodelingprep

Financialmodelingprep is another great source of financial data. It is an API which makes very easy for us to retrieve financial data like historical prices, financial statements, financial ratios and so on. It offers a free tier for which we can make up to 250 requests free a day. However, for more advance requests a subscription is required.

You may be wondering why not to retrieve all financial information from SEC directly? While in SEC we have all information available, it requires an advance knowledge on coding and web site parsing experience. It is not easy to scrape SEC reports due to the lack of standardisation of the filings. In addition, the SEC may change the structure of the site making our scraping code obsolete. By using a financial API instead, we can get financial data very easily and within seconds.

3. Alphavantage

Alphavantage is another great API containing a variety of financial data. It offers a free API and the option to subscribe for more advance requests. Alphavantage offers multiple technical indicators so it is recommended for technical analysis with Python.

4. Yahoo Finance

Probably Yahoo Finance is the most known source of financial data in the internet. You may be surprised that I only rank it in the 4th place. The reason for it is the lack of a functional API to retrieve the data as well as the difficulty to scrape the page using conventional scraping libraries such as Beautiful Soup.

Nevertheless, it is worth mentioning that there are Python libraries out there which help extracting financial data from Yahoo Finance using Python. I covered this on my post on extracting financial data from Yahoo finance.

Yahoo Finance - Best sources of Financial Data for Python
Yahoo Finance – Best sources of Financial Data for Python

5. Finviz

Finviz is another great source of financial data. I particularly like the screener functionality it offers. For instance, we can set some filtering criteria like market capitalisation bigger than $10 billion and dividend yield of 5%. Then, Finviz screener will return all companies meeting this criteria. Although it does not offer an API, I have a post showing how the Finviz screener can be scraped using Python.

I also like the financial visuals and charts it offers.

Finviz another great source of financial data
Finviz another great source of financial data

6. DBNomics

Apart from financial data, when looking or analysing a company, we also need to pay attention to the economic factors surrounding the industry where the company operates. DBNomics is an amazing database offering thousands of economical datasets such as interest rates, unemployment rates and so on.

It offers a free API that is very easy to use with Python. Therefore, DBNomics is super useful to look at macro trends and the current cycle of the economy.

7. TradingView

TradingView is a social network offering top chart and analysis tools to analyse financial data. Its charts are very handy for financial analysis. Although TradingView does not offer an API for Python, it is a good practice to look at the charts after performing a fundamental analysis. Specially to know when to open and close a position in a company.

While it offers a lot of free functionalities, TradingView offers a premium tier which gives access to more advance tools.

Best sources of financial data trading view
Best sources of financial data trading view

Wrapping Up

These are my top 7 sources of financial data to use with Python. When analysing a company, we should be able to find all needed financial data from these sources. I have covered most of them in my blog so feel free to have a look at my other posts.

Looking forward to read in the comment section of this post which sources of financial data you use.