Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download all stock symbol list of a market [closed]

I need to download in some way a list of all stock symbol of specified market.

I've found in this link ho can I do it someway.

It uses following link in order to retrieve stock list that statisfies some parameters:

https://www.google.com/finance?start=0&num=3000&q=%5B(exchange%20%3D%3D%20%22NASDAQ%22)%20%26%20(last_price%20%3E%200.1)%20%26%20(last_price%20%3C%201500)%5D&restype=company&noIL=1

I've modified the query removing contraints

https://www.google.com/finance?q=%5B%28exchange+%3D%3D+%22NASDAQ%22%29%5D

Now I have all stock list but in a web page that I must navigate.

Is there a way to obtain the full list in some standard format, like xml, json or whatever?

like image 396
Jepessen Avatar asked Aug 16 '14 09:08

Jepessen


People also ask

How do I get a complete list of ticker symbols in Yahoo Finance?

yahoo doesn't offer it, but you can get one by looking through the document. write statements on nyse.com's list and finding the . js file where they just happen to store the list of companies starting with the given letter as a js array literal.

How many stock market symbols are there?

Surprisingly, however, data from Benzinga shows a grand total of 5,866. This discrepancy occurs because some companies may have multiple ticker symbols, as does Apollo in the example above. These alternate ticker symbols differentiate the various shares a company may have issued.


2 Answers

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.

like image 58
Capn Sparrow Avatar answered Oct 07 '22 14:10

Capn Sparrow


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 
like image 21
mac13k Avatar answered Oct 07 '22 14:10

mac13k