Stock quotes API?

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

Related posts

Leave a Reply

2 comments

  1. 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   description
    
    l1     price
    c1     change
    v      volume
    a2     avg_daily_volume
    x      stock_exchange
    j1     market_cap
    b4     book_value
    j4     ebitda
    d      dividend_per_share
    y      dividend_yield
    e      earnings_per_share
    k      52_week_high
    j      52_week_low
    m3     50day_moving_avg
    m4     200day_moving_avg
    r      price_earnings_ratio
    r5     price_earnings_growth_ratio
    p5     price_sales_ratio
    p6     price_book_ratio
    s7     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)