API to fetch stock data fundamentals from finanzen.net
Finanzen-Fundamentals is a Python package that can be used to retrieve fundamentals of stocks. The data is fetched from finanzen.net, a German language financial news site. Note that the api is English but all data will be returned in German.
The package will be hosted on PyPi very soon, so that you can install it via pip. If you choose to download the source code, make sure that you have the following dependencies installed:
You can install both of them by running:
pip install requests BeautifulSoup.
After you successfully installed the package, you can include it in your projects by importing it.
You can retrieve the fundamentals of a single stock by running:
bmw_fundamentals = get_fundamentals("bmw")
This will fetch the fundamentals of BMW and save it into a dictionary called bmw_fundamentals. bmw_fundamentals will have the following keys:
- Key Ratios
- Income Statement
- Balance Sheet
The values for those keys will be variables, holding a year:value dictionary. If no data can be found, the value will be None. You can also fetch estimates for expected values by using:
bmw_estimates = stocks.get_estimates("bmw")
This will save estimates for the most important key metrics if available. The resulting dictionary will hold variable names as keys and a year:value dictionary as values.
Note that we use stock names not stock symbols when fetching data. You can search for stock names by using
stocks.search_stock("bmw", limit = 3)
This will print the three most matching stock names for your search. You can increase the limit to 30. If you don't give a parameter, all available data will be printed (up to 30).
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size finanzen_fundamentals-0.0.1-py3-none-any.whl (5.5 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size finanzen-fundamentals-0.0.1.tar.gz (3.7 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for finanzen_fundamentals-0.0.1-py3-none-any.whl
Hashes for finanzen-fundamentals-0.0.1.tar.gz