![]() This produces the following output: Revenue Net Income # Print all Revenue and Net Income for Microsoft (ticker MSFT). # The data is automatically downloaded if you don't have it already.ĭf = sf.load_income(variant='annual', market='us') # Load the annual Income Statements for all companies in USA. # The dir will be created if it does not already exist. # Set the local directory where data-files are stored. ![]() ![]() # See for what data is free and how to buy more. # otherwise you will get the data you have paid for. # If the API-key is 'free' then you will get the free data, Then you copy-paste the following into a Jupyter Notebook or Python source-file: import simfin as sf You install the SimFin python package by typing this command in a terminal window (preferably in its own environement, see their full instructions): pip install simfin The basic example below is copied from their github page. They have also made several tutorials on how to use their data with other libraries such as statsmodels, scikit-learn, TensorFlow, etc. I found the easiest to be the new SimFin Python API which lets you download stock-prices and fundamental data, save it to disk, and load it into Pandas DataFrames with only a few lines of code. Then, you can find your API key on Quandl account settings page. To get your API key, sign up for a free Quandl account. Quandl requires NumPy (v1.8 or above) and pandas (v0.14 or above) to work. # Import the quandl packageĭata = quandl.get("WIKI/KO", start_date="", end_date="", To get the data, you need to get the free API key from quandl and replace the in the below code with your API key. Recently it is stopped being maintained but however, it is a good free source to backtest your strategies. Wiki is one of the free source available on quandl to get the data for the 3000+ US equities. The method to get data from yfinance library is shown below. You can get the data either using pandas datareader or can get using yfinance library. ![]() Yahoo Finance is one of the free sources to get stock data. ![]()
0 Comments
Leave a Reply. |