I’m trying to put together a simple RSS widget (for my wordpress blog) that will show a list of stocks, or markets, and their current prices.
I cant seem to find an API for this data anywhere – can anyone suggest such a thing (perhaps as an RSS feed?)
Yahoo have an (undocumented) Stock Quotes API as part of their Finance API
Basically, http://download.finance.yahoo.com/d/quotes.csv?s=GOOG&f=ll will return the price for
GOOG
stock in CVS formatThe
s
parameter is the stock symbol. You can specify multiple by separating them with+
The
f
parameter is the data format code, which I found documented from this Python script (which is also how I discovered the API..):They are all documented on this page
The data is returned as a comma separated file, which should be utterly trivial to parse in any language
You can also use Google’s Finance API to get Stock Quotes in a slightly round-a-bout way
Basically you create a Google Spreadsheet, and use the GoogleFinance function:
..then use the Spreadsheet API to access that value
I found this via [“Introducing the Google Finance API”](http://googlified.com/introducing-the-google-finance-api/
), and “How to get a real-time stock quote using Google API” describes this is more detail, including a simple bash shell-script to access the data (I think it could be simplified by making the spreadsheet publicly accessible)
There are already a few WordPress plugins; among others:
http://wordpress.org/extend/plugins/stock-quote-sidebar/
http://andy.hillhome.org/blog/code/stockquotesidebar/
http://wordpress.org/extend/plugins/stocks-watchlist/