At some time ago, I built a private dashboard for my brother.
A screenshot of the dashboard
I made some major changes to it today.
So far, it only supports the S&P 500 index. The list of the stocks tickers from the S&P 500 are fetched from Wikipedia using this snippet of code:
table = pd.read_html(
"https://en.wikipedia.org/wiki/List_of_S%26P_500_companies",
match="Symbol",
)[0]
tickers = table["Symbol"].to_list()
I need to be able to fetch all stocks tickers from all US major exchanges. At the moment, I am trying out polygon.io, but I have still yet to figure out if its free tier has generous enough of a free tier to support this.
Screenshot of polygon.io's All-Tickers API
Another potential route that I have found is with sec.gov/file/company-tickers. But I was encountering some issues when trying to download that JSON file programmatically.
Screenshot of sec.gov/file/company-tickers
I came across this reddit post on r/algotrading
. And the following APIs were mentioned. I will list them here for future reference:
- polygon.io
- alpaca.markets
- marketstack
- yfinance (a wrapper around the Yahoo Finance API which I am using right now)
- eodhistoricaldata.com
- alphavantage.co
- tiingo.com
- stockdata.org
- fmpcloud.io