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?)
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.
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.
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)
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With