I need a web page that will supply end-of-day prices (mutual funds, ETFs, indexes), and ideally a recent history of closing prices, that I can access programmatically. By that I mean access the web page from within my program, not from a web browser. Any suggestions?
I used to rely on bigcharts.marketwatch.com, but that recently went away. I've also tried seekingalpha.com, nasdaq.com, and marketwatch.com, and finance.yahoo.com. For getting the webpage I've used the command line utilities curl, wget, httrack, single-file, and invoke-webrequest (on powershell). But no combination yields data identical to what is displayed in a web browser, very frustrating.
Thanks for any suggestions!
Comments
Here is one example from
Alpha Vantage
You sign up on their website for a free API key. Then you make a simple HTTP request to a URL they provide, including the ticker symbol and your key. There is a limit on calls per day on free tier.
curl "https://www.alphavantage.co/query?function=TIME_SERIES_DAILY_ADJUSTED&symbol=VTI&apikey=YOUR_KEY&outputsize=full&datatype=csv"
Financial Modeling Prep (FMP) - free tier gets you 250 calls a day, which should be enough. If you want more it’s $240 a year.
This call gets from/to prices.
curl -s "https://financialmodelingprep.com/api/v3/historical-price-full/VTI?from=2024-01-01&to=2024-12-31&apikey=YOUR_API_KEY"
At days end... this can be as late as 8 pm for some mutual funds... I open the portfolio, select the "basic" tab, highlight the column of tickers, copy and paste into a spreadsheet.
Format the spreadsheet to your liking.
Seems to work well for my needs.