I am working on a site that needs a page for each stock on the stock exchange. I've been looking for API's like Yahoo Finance API, but they all require that you place in a stock name. I can use that later in the application, but I need to try and pull a master list of stocks and create dynamic pages from it. I also need some type of stock chart api which I also cannot find. I unfortunately don't have money to finance a monthly payment or a $1000 lifetime payment like Highstock has. Thanks for your help.
-
You may want to see this question. It has a C# answer, but writing something similar in Ruby may work. As to the question if there's anything already written, I couldn't find anything by Googling :) http://stackoverflow.com/questions/5246843/how-to-get-a-complete-list-of-ticker-symbols-from-yahoo-finance – Anthony Atkinson Mar 09 '14 at 15:35
-
1You may want to also consider making something that doesn't import all stock symbols at once, but each time one that has not been imported is encountered, it goes out to the Yahoo API and imports it. That way you don't have any pages for symbols that haven't been used before. – Anthony Atkinson Mar 09 '14 at 15:37
-
that's a good point I should look into a method like that. – Taylor Mitchell Mar 09 '14 at 15:44
3 Answers
This really belongs on softwarerecs.stackexchange.com, but to answer your question,
as a general rule of thumb for myself, when I don't have an API available, I look to see if the data exists out there in machine-parseable format (CSV, JSON, XML if I'm really unfortunate, etc..).
For example, recently I needed a geocoding database, but I could not find a service that would meet my needs for both speed and price, so I downloaded 200,000+ cities and wrote my own service that does exactly what I need.
And if your really cool, you will make it open source/open API like I did - GeocodeForFree.com
Here is a link to download all stocks in the NASDAQ index in CSV format, I think you know what to do from here
http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NASDAQ
Good luck!

- 7,856
- 10
- 40
- 79
-
That's exactly what I need. I have to figure out a way to create URLs from a column in the CSV file. Thanks. I'm very new to doing something like this. – Taylor Mitchell Mar 09 '14 at 16:21
-
-
actually I found an excellent tutorial that has code that I can edit to parse the csv file for the information. It also teaches a little bit of angular.js! And I will keep asking. This project has taught me a lot. In case anyone wants the tutorial...[link](http://alexpotrykus.com/blog/2013/12/17/angularjs-with-rails-4-part-1/) – Taylor Mitchell Mar 09 '14 at 22:01
I use a ready list of Yahoo tickers, provided by Samir Khan here: http://investexcel.net/all-yahoo-finance-stock-tickers/ Samir collects it, using brute force algorithm, which builds random combinations of characters and check each for Yahoo's response

- 280
- 2
- 15
You could also use Stocks.js. It provides an easy API to get the stock quotes from nearly any company. It also provides some technical indicators and sector performances. An example of usage:
// Let's get the stock data of Tesla Inc. for the last 10 minutes
var result = await stocks.timeSeries({
symbol: 'TSLA',
interval: '1min',
amount: 10
});
It is completely free, you only need to request an API key which takes 1 minute.

- 6,489
- 5
- 30
- 73