Investment Analysis — Finance Database
In this article, we will explore APIs and open-source finance databases to help us perform investment analysis.
This article is part of the Investment Analysis series.
The source code is available in this repository.
In the previous article, we use the
yfinance libraries to prepare a dataset for investment analysis. Using the libraries, we prepare a dataset of around 4000 stocks traded in the US market. We will explore alternatives to get more data for analysis.
There are 2 options we will explore.
- Use the Fundamental Analysis library and the FinancialModellingPrep’s APIs
- Use the open-source Finance Database which is a database of 300.000+ symbols containing Equities, ETFs, Funds, Indices, Currencies, Cryptocurrencies, and Money Markets.
Fundamental Analysis Library
- Sign up for the free plan of FinancialModellingPrep’s API, and obtain an API key
- Install the Fundamental Analysis library
pip install fundamentalanalysis
List of Companies and Exchanges
Using the library, we can get a list of companies.
There are around 44k companies from multiple exchanges.
We can filter the list using the
exchangeShortName column. E.g, we can get the companies listed in the US market.
Lastly, we can save the dataset to an Excel file.