Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stock quotes API? [closed]

Tags:

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

like image 482
mrpatg Avatar asked Jul 19 '09 12:07

mrpatg


People also ask

Is there a free to use API I can use to get stock quotes and financial info?

So you can still use Yahoo Finance to get free stock market data. Yahoo's API was the gold standard for stock-data APIs employed by both individual and enterprise-level users. Yahoo Finance provides access to more than 5 years of daily OHLC price data. And it's free and reliable.

Is there free stock API?

About Finnhub Stock API With the sole mission of democratizing financial data, we are proud to offer a FREE realtime API for stocks, forex and cryptocurrency. With this API, you can access realtime market data from stock exchanges, 10 forex brokers, and 15+ crypto exchanges.


2 Answers

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)

like image 54
dbr Avatar answered Oct 11 '22 20:10

dbr


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/

like image 34
markratledge Avatar answered Oct 11 '22 19:10

markratledge