Stock quotes API? [closed] Stock quotes API? [closed] wordpress wordpress

Stock quotes API? [closed]


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 format

The s parameter is the stock symbol. You can specify multiple by separating them with +

quotes.csv?s=GOOG+YHOO‎

The f parameter is the data format code, which I found documented from this Python script (which is also how I discovered the API..):

code   descriptionl1     pricec1     changev      volumea2     avg_daily_volumex      stock_exchangej1     market_capb4     book_valuej4     ebitdad      dividend_per_sharey      dividend_yielde      earnings_per_sharek      52_week_highj      52_week_lowm3     50day_moving_avgm4     200day_moving_avgr      price_earnings_ratior5     price_earnings_growth_ratiop5     price_sales_ratiop6     price_book_ratios7     short_ratio

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:

=GoogleFinance("GOOG"; "price")

..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)