Question

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

Was it helpful?

Solution

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

OTHER TIPS

You can get csv data from yahoo.

This page has more information.

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.

The Google and Yahoo API's have both gone away. However, Investor's Exchange offers an API that's very easy to use for quote data.

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

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.

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

Click here

this internally uses yahoo stock api. i hope this one helps you out.

https://github.com/bhattumang7/gold-silver-share-price-api-india

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).

Here is a list of websites that provide free intraday data.

You can export the data and use it in your software

Using Fidelity.com & inspecting the element for the selling price you can manipulate the URL to search any stock from inside your program.

Using Visual Studio Community 2013 C#

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top