Getting real-time market/stock quotes in C#/Java
Asked Answered
C

11

27

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

Cyclostome answered 29/12, 2009 at 15:2 Comment(3)
I am doing something similar including option prices. I know you can get pay access, but a web service with pricing would be priceless if free. :)Guildhall
I know this doesn't answer your question, but this may help you anyway: Since you're building a "filter" for stocks, you may need company fundamental information (revenue, profit, number of employees, industry codes, etc) - a great place to get all of that is the Mergent Fundamentals API - mergent.com/serviusFoliated
For a ready made solution check the following link codecanyon.net/item/livecurrent-stock-price-/17489243 . DLL and sample code file provided,very easy to integrate in web as well as desktop applications.Dauphine
F
29

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

Five answered 29/12, 2009 at 15:8 Comment(5)
Yahoo offers there data for free check out jarloo.com/tutorials/get-yahoo-finance-api-data-via-yql to learn YQL and how to download Yahoo Finance data.Russell
what you say is true, I just wanted to add that if you are forced to do html parsing, using jsoup and xpath will make that task a lot easier. Sometimes the data you need just isn't available any other way.Marable
This Google page seems to have nothing but an empty promise. Where is the Web service?Knapsack
For a ready made solution check the following link codecanyon.net/item/livecurrent-stock-price-/17489243 . DLL and sample code file provided,very easy to integrate in web as well as desktop applications.Dauphine
@Russell Yahoo has just discontinued the service.Banjo
R
10

You can get csv data from yahoo.

This page has more information.

Reversioner answered 29/12, 2009 at 15:7 Comment(1)
This page has been removed because of infringement on Yahoo Terms of ServiceArundinaceous
B
4

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.

Boogie answered 13/11, 2017 at 2:12 Comment(2)
Can I use this to fetch quotes of NSE listed stocks as well?Aalborg
IEX supports a number of different exchanges; there is an API to fetch the full list.Boogie
C
3

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.

Cauthen answered 29/12, 2009 at 15:7 Comment(0)
F
1

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

Florescence answered 29/12, 2009 at 15:8 Comment(1)
Discontinued service nowBanjo
W
1

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.

Willing answered 29/12, 2009 at 15:17 Comment(0)
M
1

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

Click here

Micro answered 5/1, 2010 at 15:40 Comment(0)
A
1

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

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

Adolescent answered 19/4, 2012 at 13:28 Comment(0)
H
0

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

Hibbler answered 29/12, 2009 at 22:22 Comment(0)
E
0

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

You can export the data and use it in your software

Ewan answered 24/4, 2012 at 10:46 Comment(0)
F
0

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#

Flunky answered 3/4, 2015 at 0:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.