Yahoo! Finance is a free and easy to use on-line financial service which was used by more than 18 million people in May 2008 alone (according to the Internet analysis company comScore). This article will look at how anyone can obtain stock quotes from the Yahoo! Finance web site, and how to load those stock quotes into applications such as Microsoft Excel and OpenOffice.org Calc.
Obtaining Yahoo! Finance Stock Quotes for a Company
For anyone with Internet access the easiest way to obtain stock quotes is to go directly to the Yahoo! Finance web site at
http://finance.yahoo.com. Once there the user can get the current stock quote of any company in one of two ways:
- enter the Yahoo! acronym for the company into the Yahoo! Finance text box and then click on "GET QUOTES"
- start typing the company name into the Yahoo! Finance text box - it will then display a list of all possible company matches
For instance if micro is typed into the box then the suggestions will include:
- MSFT Microsoft Corporation NASDAQ
- JAVA Sun Microsystems Inc NASDAQ
- AMD Advanced Micro Devices Inc. NYSE
It's then just a matter of selecting the correct company and the user will see that Microsoft (for instance) is currently up 0.19% at 26.30.
Obtaining Yahoo! Finance Stock Quotes for Multiple Companies
Examining the stock quote for an individual company is very informative, but if there are a number of companies to be viewed then this can be rather time consuming; therefore it's useful to know that it is possible to view the stock quotes of more than one company at the same time - and that's by entering the acronym for each company into the Yahoo! Finance text box and separating them using commas, for example:
This time, as well as seeing the Microsoft stock quotes, the user would see that Red Hat is down 4.19% at 14.65 while Novell is up 1.19% at 5.00.
Accessing the Yahoo! Finance Stock Quotes Directly
Having seen how to access stock quotes using the Yahoo! Finance web interface, it's worth noting that the current stock quotes can also be accessed directly by entering the correct URL into a web browser, for example:
Loading Yahoo! Finance Stock Quotes into Microsoft Excel or OpenOffice.org Calc
Users of Microsoft Excel or OpenOffice.org Calc can load the Yahoo! Finance stock quotes in one of three ways:
- click on the "Download to Spreadsheet" link (displayed below the requested companies' stock quotes)
- enter the URL for the CSV file that the "Download to Spreadsheet" link points to, for example:where f stands for the fields to be displayed (in this case: s - symbol; l1 - last price; c1 - change; d1 = last date)http://download.finance.yahoo.com/d/quotes.csv?s=RHT,MSFT,NOVL&f=sl1c1d1&e=.csv
- run a macro to load the data automatically
A Microsoft Excel Macro for Loading Yahoo! Finance Stock Quotes
The code for a Microsoft Excel that will download the Yahoo! Finance stock quotes is fairly simple, consisting of two subroutines; one to define the companies and fields, the other to format the URL to be used:
An OpenOffice.org Calc Macro for Loading Yahoo! Finance Stock Quotes
The OpenOffice.org Calc code is slightly more complex than the Microsoft Excel code - the getStocks subroutine would be identical, but the downloadStocks subroutine would not (although it does the same job):
Conclusion
Yahoo! Finance stock quotes provide an easy to access and free data source; and the ability to either view the information on-line or to download it for future use make it an invaluable tool.
Additional Reading
An Introduction to Google Finance
Accessing Yahoo! Finance from PHP