tags:

views:

2297

answers:

10

Hey,

I would like to make an program that acts like a big filter for stocks. To do so, I need to have real-time (or delayed) quotes from the market. I started getting stock quotes by requesting pages from yahoo, accordingand parsing the html to the ticker, and parsing the html. I was wondering how to do this requesting and parsing html. Is there some way I can request only the stock quotes and its info? I know some applications do this, and I am very curious how they do it, because requesting web pages and parsing them is very time-consuming.

Thanks, Dave

+1  A: 

Afaik, this kind of data is available via subscription based models, Xignite is one that comes to mind. To my knowledge, NASDAQ and the NYSE do not provide any freely usable API's.

RandomNoob
+5  A: 

You can get csv data from yahoo.

This page has more information.

Mongus Pong
A: 

There is actually a yahoo web service that will return CSV file of stock quotes. So no HTML parsing needed

Lemurik
+9  A: 

Parsing the output of the webpage is a chump's game. It is always changing and unless you're willing to heavily invest in some sort of very resilient parser you're going to spend your life twiddling with it. Use a web service, google offers one http://googleblog.blogspot.com/2007/01/real-time-quotes-for-free.html

stimms
A "chump's game", I like that.
GregS
A: 

In the financial services industry, most banks will have a real time feed provided by Reuters or Bloomberg, but this, obviously, will cost a lot of money. If you Google for "stock price feed" or "market data feed" you will get some options, some free, some paid for.

I would also recommend using a Complex Event Processing engine such as Esper for doing this sort of real time processing, it will be substantially easier than writing the whole application stack from scratch.

John Channing
A: 

Try to look at this channel9 presentation. It is a F# introduction but from 27:00 the presenter, Luca Bolognesi, creates an application that does some of the work you are asking for (in F# but very inspirational - to me at least).

Moberg
A: 

For downloading yahoo finance stock quotes in C# or VB.NET you can use the "Yahoo! Finance Managed" library.

Click here

Maas
A: 

What about if you're using php??? I know that i could use a .csv file and get quotes from yahoo and i have even seen some examples of this, but not being a programmer i am having a ton of difficulties with writing the proper code for my needs. I would also like to have flex on the front end of this application so it kind of makes it even more complex for me since i have just gotten myself into this world of Rias and i guess i would like to keep learning no matter how frustrating it gets.

If i'm correct, these are the things that i would need:

PHP script that opens up a connection with the mysql server and retrieves the .csv file from yahoo and saves it over the existing. (If possible with not too much scripting to save the .csv file to a new fle for example csv_01.csv it would be great because than i would leave myself some space so that i can have charts later on but i have no idea if that would be way more complex than just overwriting the existing file). If i could do this on an interval of lets say 15minutes in the back end than i could probably get the logic in place for connecting to a mysql server through amfphp and displaying it back in Flex.

I feel like i am asking too much already so if anyone can help me i would really really appreciate it and any suggestions are welcome and i thank you in advance.

Haris
A: 

I am having similar problem, thanks for all the replies

sean717