How to retrieve current stock market prices?

So I had an idea for a stock market game that goes off the real time stock market values (Yes I know it has already been done). Before i start planning, is there even a way for Unity to retrieve the stock market values in real time?

Ah, finally, a question we game developers frequently come across and can quickly and successfully answer! http://lmgtfy.com/?q=c%23+get+stock+market+prices Yep!

2 Answers

2

Sure, if they’re available online, that is. :slight_smile:

Unity has all the required technology at its disposal to contact any website and make any TCP connection to any host, so, what you need to know is the location and format of the data, and the transfer protocol. Most convenient would be if the stock data was returned from some web service you know of, but in the very worst case, you could find a website that displays it, send a request to that URL through a socket and then manually parse the HTML string it returns.

Sure - you just need a web page or web service that provides share prices, then retrieve and parse that information in Unity using the WWW class.