Suresh
Suresh

Reputation: 21

Is there easy way to retrieve Google Finance data?

Once in a day we want to download google finance data for 6100+ stock symbols. Right now we are going to this url and getting the data for all stock symbols. http://www.google.com/finance?q=NYSE:AA&fstype=ii

Getting the data like this use lots of bandwidth and slowness on the server.

Is there better way to get the data from Google.

There is Google Finance API, but it is not available in PHP

Upvotes: 2

Views: 5288

Answers (2)

Phoenix
Phoenix

Reputation: 4536

The Google Finance API is available for use by all web scripting languages. All the API is is a description of and instructions on how to utilize their REST service. You use something like cURL in PHP to call to their REST service and retrieve the results output by it in XML format, and then parse the XML to display, store, whatever the information retreived.

Note that even though they don't have an example for PHP like they do for many of their APIs, their APIs still all use the same sort of system, so the examples provided for something like the Google Spreadsheets Data API or the Google Documents List API would be valid for getting a starting point on the Google Finance API. The difference between them would be the parameters passed, the data returned, and the url which you would be calling with the parameters to get the data.

Upvotes: 2

kvista
kvista

Reputation: 5059

If you can live without the data coming from Google, have you looked at the Yahoo Finance API? It's pretty flexible and allows the downloading of multiple symbols at once (though you may not necessarily want to do all 6100 at once).

For example, you can do:

http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yr

More detail on how to use the API is nicely written up at:

http://www.gummy-stuff.org/Yahoo-data.htm

Upvotes: 1

Related Questions