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!
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!
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).
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.
haha yeah, my program is in C++. Thats why I dont want to use the API
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.
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).
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