Numbers Stock Data

How do you write a script to add real time stock data to Numbers?

MacBook Air 13″, macOS 13.4

Posted on Jul 13, 2023 1:40 PM

Reply
2 replies

Jul 13, 2023 4:39 PM in response to SGru

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


Jul 13, 2023 2:04 PM in response to SGru

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

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Numbers Stock Data

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.