The Bill Gates Personal Wealth Clock, described in the “Sites that are really programs” chapter of my 1990s book on web development, is broken because the attempt to grab a price from Yahoo Finance now results in “It has come to our attention that this service is being used in violation of the Yahoo Terms of Service. As such, the service is being discontinued. For all future markets and equities data research, please refer to finance.yahoo.com.” (they paid Marissa Mayer that they couldn’t afford to respond to a few quote requests per day anymore?)
What’s a good source for getting stock quotes in a simple format designed to be read by a computer program? I would want at least MSFT and BTC-USD.
https://metacpan.org/pod/Finance::Quote
It looks at various sources but for Yahoo they recently swapped in AlphaVantage, whatever that is.
Bobby: Thanks. I will look at the source code for that and hope to find a reasonably simple site.
Here’s the Finance section of a list of public JSON APIs: https://github.com/toddmotto/public-apis#finance
I used to Yahoo Finance for many years to download prices for a handful stocks a couple of times a week, and I was very disappointed to see it shut down. I could not find anything else as good.
The simplest solution I found was to create an online Google spreadsheet in Google Drive/Docs, and use the built-in function =GOOGLEFINANCE(“AAPL”). It automatically recalculates using the AAPL stock price. You can download as a CSV, and then use the values in a local spreadsheet or whatever you like.
It is not as nice as Yahoo Finance because you have to manually open the worksheet to get a recalc.
Brokerage accounts typically have a way to download portfolio values, but they seemed like more trouble to me, especially if I want values of stocks I do not own.
I’m a fan of brokerage.tradier.com because they give you a real API to work with if you open an account with them. Feels to me like any free service is destined to go away in the long run.
I’ve had good luck with the Investor’s Exchange API. Free, and simple to access. Python code snippet available on request.
I was also using Yahoo’s API when they pulled the plug, and this was a pretty similar replacement (JSON instead of CSV).
As a further solution using a google spreadsheet, you can publish the spreadsheet to the web and get a url that returns the data in the spreadsheet in various formats, including CSV. Choose “File –> Publish to the web…” You could then use that for your application’s endpoint to fetch the quote.
Here’s a sample I made that returns “MSFT” and the current price in CSV format.
https://docs.google.com/spreadsheets/d/e/2PACX-1vTC20z0ykT1wAFfTnb043zoGH86gKCxFQ58p02J2P5vhMzqssfLTP17CiQlw7lEJm4v_D7J0Jgyt-2F/pub?gid=0&single=true&output=csv
Cboe has public trade and book data:
http://markets.cboe.com/us/equities/market_statistics/book_viewer/
Quandl offers API based access to tons of financial data in easy to use format. I have been using it for last several years.
Some of the datasets are free e.g.
https://www.quandl.com/databases/WIKIP