A good machine-readable free source of stock quotes?

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.

9 thoughts on “A good machine-readable free source of stock quotes?

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

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

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

Comments are closed.