3 Replies - 557 Views - Last Post: 18 August 2012 - 04:14 PM Rate Topic: -----

#1 superkb10  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 298
  • Joined: 27-November 11

Getting stock prices

Posted 17 August 2012 - 08:39 PM

Hey guys, I'm writing a program that basically just looks up stock prices. Right now, I have it working by downloading the html source from Yahoo Finance, and then using Regex to get the price from whatever stock I'm looking for. So I have two questions, first, is this a legal thing to do? Display stock prices by getting it from some other website? And second, is there another way? Because it takes some time to download the source, and I'm wondering how the website itself would do it. Do they connect to some kind of server on the Stock Exchange? Does anyone know how they do it? Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: Getting stock prices

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,472
  • Joined: 05-May 12

Re: Getting stock prices

Posted 17 August 2012 - 09:02 PM

Why page scrape the HTML when Yahoo Finance offers an API?
http://developer.yahoo.com/finance/

And I'll let you try to interpret their usage policy: http://info.yahoo.co...n/ydn-3955.html

And .NET offers some wonderful goodies for dealing with RSS feeds: http://msdn.microsof...yndication.aspx
Was This Post Helpful? 0
  • +
  • -

#3 superkb10  Icon User is offline

  • D.I.C Regular

Reputation: 29
  • View blog
  • Posts: 298
  • Joined: 27-November 11

Re: Getting stock prices

Posted 18 August 2012 - 10:19 AM

Oh, okay, so I can't use their APIs for profit basically. That works, but I'd still like to know, how I would go about getting a stock price without having to go through a third party like Yahoo. But rather, directly from the stock exchange.
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,472
  • Joined: 05-May 12

Re: Getting stock prices

Posted 18 August 2012 - 04:14 PM

You contact the stock exchange and setup a contract to get a data feed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1