Thread: Get stock quotes from google

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    4

    Get stock quotes from google

    I am trying to pull stock information from google finance. For example, I would like to be able to save the current price and the 52 week high as variables in my code. Anyone have an idea of how to do this? Thanks!

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Google has an finance retrieving API - I'm not sure how it works but imagine it's javascript-driven. Yahoo has a fairly well documented interface for doing this programatically (via a standard C program, for example).

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    4
    Yeah, I know that I can get data from Yahoo using a http address but I would like to use google because their quotes are real-time and yahoo's are delayed up to 20 min. I looked into using google's API but I would rather not have to move data from JAVA to C++ if at all possible.

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Quote Originally Posted by rtbcoop View Post
    Yeah, I know that I can get data from Yahoo using a http address but I would like to use google because their quotes are real-time and yahoo's are delayed up to 20 min. I looked into using google's API but I would rather not have to move data from JAVA to C++ if at all possible.
    You do realize that this is a C++ - not Java - board?

  5. #5
    Registered User
    Join Date
    Sep 2009
    Posts
    4
    haha yeah, my program is in C++. Thats why I dont want to use the API

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    I see. Well, it sounded like you were writing a Java program and didn't want to port it to C++. Anyway, if there's a way to do it from a standalone Java program, there's a good chance it can be done from C++. But even if it's a JavaScript API, you could probably find a way to get the data from a C++ program. Level of difficulty varies, of course.

  7. #7
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Well, looking at the API, it appears that a fair bit of work is going on under the hood just to get the data (authentication and whatnot). I'd say your best bet would be some other route (eg: some other provider).

  8. #8
    Registered User
    Join Date
    Sep 2009
    Posts
    4
    After talking to some friends that are programmers, it looks like the best way to do this is to have the C code call the HTML file online and then just parse the data, typecasting the string as a double

  9. #9
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by rtbcoop View Post
    After talking to some friends that are programmers, it looks like the best way to do this is to have the C code call the HTML file online and then just parse the data, typecasting the string as a double
    Of course, after doing that you shouldn't forget to throw your phase scrambler into overdrive and reverse the polarity of the deflector dish
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Niche Question: real time stock quotes
    By keira in forum C Programming
    Replies: 0
    Last Post: 03-08-2008, 11:06 AM
  2. Retail Outlet Managment System - the 4th
    By Presidentofusa in forum C Programming
    Replies: 3
    Last Post: 11-10-2007, 10:44 PM
  3. Moving Average Question
    By GCNDoug in forum C Programming
    Replies: 4
    Last Post: 04-23-2007, 11:05 PM
  4. Stock Quotes
    By jmd15 in forum Networking/Device Communication
    Replies: 4
    Last Post: 08-31-2006, 04:35 PM

Tags for this Thread