See this answer first: https://quant.stackexchange.com/a/1862/38968
NASDAQ makes this information available via FTP and they update it every night. Log into ftp.nasdaqtrader.com anonymously. Look in the directory SymbolDirectory. You'll notice two files: nasdaqlisted.txt and otherlisted.txt. These two files will give you the entire list of tradeable symbols, where they are listed, their name/description, and an indicator as to whether they are an ETF.
Given this list, which you can pull each night, you can then query Yahoo to obtain the necessary data to calculate your statistics.
Also: New York's Stock Exchange provides a search-function:
https://www.nyse.com/listings_directory/stock
.. and this page seems to have a lot as well - it has Nikola/NKLA at least ;)
https://www.advfn.com/nasdaq/nasdaq.asp?companies=N
Answer from Morten Jensen on Stack OverflowPython get all stock Tickers - Stack Overflow
Where can I find a comprehensive list of all U.S. stock market tickers?
List of stock tickers from yahoo
finance - Download all stock symbol list of a market - Stack Overflow
Videos
See this answer first: https://quant.stackexchange.com/a/1862/38968
NASDAQ makes this information available via FTP and they update it every night. Log into ftp.nasdaqtrader.com anonymously. Look in the directory SymbolDirectory. You'll notice two files: nasdaqlisted.txt and otherlisted.txt. These two files will give you the entire list of tradeable symbols, where they are listed, their name/description, and an indicator as to whether they are an ETF.
Given this list, which you can pull each night, you can then query Yahoo to obtain the necessary data to calculate your statistics.
Also: New York's Stock Exchange provides a search-function:
https://www.nyse.com/listings_directory/stock
.. and this page seems to have a lot as well - it has Nikola/NKLA at least ;)
https://www.advfn.com/nasdaq/nasdaq.asp?companies=N
Another solution would be to load this data as CSV.
Get the CSV from:
https://plextock.com/us-symbols?utm_source=so
Hello everyone,
I'm in search of a complete list of all tickers for companies listed on the U.S. stock market. Does anyone know of a reliable resource or subreddit where I can find this? Or perhaps any of you have an up-to-date database you'd be willing to share?
Any assistance would be greatly appreciated. Thanks in advance!
Hello there,
newbie here and my question is as follows: Is there a way to get an (relatively) exhaustive list of all stock tickers for which I can download data from yahoo finance? I use this python package to download data from yahoo https://pypi.org/project/yahoo-historical/ so it would be beneficial if the format of the tickers would work with this package, but I am also happy about other suggestions. Given my inexperience, I am pretty sure that there are better solutions out there
Background:
Currently, I am working on a small private project in which I want to enhance my hand-built stock portfolio based on a small number of stocks (<10), based on portfolio optimization and ML predictions about their future performance. In order to find such stocks, I want to try out a large number of stocks and find those that minimize risk when incorporated in my portfolio.
The final selection would then still be performed manually, meaning that I only want to use the indications from the optimization/predictions as a helping measure. Hence, this is not a real algotrading problem, but I still thought that this would be the right subreddit to ask this question - any input is appreciated!:)
Exchanges will usually publish an up-to-date list of securities on their web pages. For example, these pages offer CSV downloads:
- http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NASDAQ&render=download
- http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NYSE&render=download
- http://www.asx.com.au/asx/research/ASXListedCompanies.csv
NASDAQ Updated their site, so you will have to modify the URLS:
NASDAQ
- https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=download
AMEX
- https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=amex&render=download
NYSE
- https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nyse&render=download
Depending on your requirement, you could create the map of these URLs by exchange in your own code.
There does not seem to be a straight-forward way provided by Google or Yahoo finance portals to download the full list of tickers. One possible 'brute force' way to get it is to query their APIs for every possible combinations of letters and save only those that return valid results. As silly as it may seem there are people who actually do it (ie. check this: http://investexcel.net/all-yahoo-finance-stock-tickers/).
You can download lists of symbols from exchanges directly or 3rd party websites as suggested by @Eugene S and @Capn Sparrow, however if you intend to use it to fetch data from Google or Yahoo, you have to sometimes use prefixes or suffixes to make sure that you're getting the correct data. This is because some symbols may repeat between exchanges, so Google and Yahoo prepend or append exchange codes to the tickers in order to distinguish between them. Here's an example:
Company: Vodafone
------------------
LSE symbol: VOD
in Google: LON:VOD
in Yahoo: VOD.L
NASDAQ symbol: VOD
in Google: NASDAQ:VOD
in Yahoo: VOD
NASDAQ makes this information available via FTP and they update it every night. Log into ftp.nasdaqtrader.com anonymously. Look in the directory SymbolDirectory. You'll notice two files: nasdaqlisted.txt and otherlisted.txt. These two files will give you the entire list of tradeable symbols, where they are listed, their name/description, and an indicator as to whether they are an ETF.
Given this list, which you can pull each night, you can then query Yahoo to obtain the necessary data to calculate your statistics.
UPDATE: More information about these files and their fields can be found here.
Slightly ugly bash one-liner for a sorted JSON array:
echo "[\"$(echo -n "$(echo -en "$(curl -s --compressed 'ftp://ftp.nasdaqtrader.com/SymbolDirectory/nasdaqlisted.txt' | tail -n+2 | head -n-1 | perl -pe 's/ //g' | tr '|' ' ' | awk '{printf $1" "} {print $4}')\n$(curl -s --compressed 'ftp://ftp.nasdaqtrader.com/SymbolDirectory/otherlisted.txt' | tail -n+2 | head -n-1 | perl -pe 's/ //g' | tr '|' ' ' | awk '{printf $1" "} {print $7}')" | grep -v 'Y$' | awk '{print $1}' | grep -v '[^a-zA-Z]' | sort)" | perl -pe 's/\n/","/g')\"]"
EDIT: Filtered out test stocks