Numbers Stock Data
How do you write a script to add real time stock data to Numbers?
MacBook Air 13″, macOS 13.4
How do you write a script to add real time stock data to Numbers?
MacBook Air 13″, macOS 13.4
I used to have AppleScripts to retrieve data from Yahoo! Finance and place it in Numbers. However, Yahoo! was acquired by another company several years ago, and that company shut down the API that made the data accessible to scripts. (You can, of course, still get previous day closing prices via the STOCK function in Numbers)
In general there is a cost for "real time" stock data. If you need that then you may be better off using portfolio tracking provided by your broker rather than trying to reinvent that in Numbers.
One semi-automated approach that can work is to set up a Google sheet to retrieve "near real time" prices for a list of stocks, then copy and paste that into a Numbers table.
But in general Numbers and other spreadsheet apps aren't a full substitute for dedicated portfolio management software.
SG
Using Python
Add a function to Get the stock data from a trading url api,
Using a ticker symbol as input and return the real-time stock data for that symbol.
Add another function to take a ticker symbol and a cell reference as input and get the real time data for the ticker ref.
Update cell value with returned value
Call the main function.
It would be better to check at the right forums for Scripts. Easiest option for now would be to hop on to Chat GPT or Bard, You will get a better code. Cheers
Numbers Stock Data