I read about the YQL, but I didn't understand how can I get some simple data (like company ticker, market cap, stock price, etc.), for ALL COMPANIES?
And an additional question, how can I get all Yahoo Finance tables and theirs fields that can be queried by YQL?
To your first question, you can't really do any query through YQL to get data for all companies. It's more oriented towards obtaining data for a smaller query. (I.e., it's not going to give you a full data dump of the whole Yahoo! Finance database.)
To your second question, here's how you can get started exploring the Yahoo! Finance tables in YQL:
- Start at the YQL Console
- In the upper left corner, make sure Show Community Tables is checked
- Type
finance
in the search field - You'll see all the Yahoo Finance tables (about 15)
Then you can try some example queries like the following:
select * from yahoo.finance.quote where symbol in ("YHOO","AAPL","GOOG","MSFT")
Update 2016-04-04: Here's a current screenshot showing the location of the Show Community Tables checkbox which must be clicked to see these finance tables:
As from the answer from BrianC use the YQL console. But after selecting the "Show Community Tables" go to the bottom of the tables list and expand yahoo where you find plenty of yahoo.finance tables:
Stock Quotes:
- yahoo.finance.quotes
- yahoo.finance.historicaldata
Fundamental analysis:
- yahoo.finance.keystats
- yahoo.finance.balancesheet
- yahoo.finance.incomestatement
- yahoo.finance.analystestimates
- yahoo.finance.dividendhistory
Technical analysis:
- yahoo.finance.historicaldata
- yahoo.finance.quotes
- yahoo.finance.quant
- yahoo.finance.option*
General financial information:
- yahoo.finance.industry
- yahoo.finance.sectors
- yahoo.finance.isin
- yahoo.finance.quoteslist
- yahoo.finance.xchange
2/Nov/2017: Yahoo finance has apparently killed this API, for more info and alternative resources see https://news.ycombinator.com/item?id=15616880
Example to recieve it through a request:
a) http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.historical
OR
b) http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes
Since Yahoo Finances API was disabled, I found Alpha Vantage API
This a stock query sample that I'm using with Excel's Power Query:
https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=15min&outputsize=full&apikey=demo
来源:https://stackoverflow.com/questions/14795726/getting-data-from-yahoo-finance