Have you ever faced the challenge to effectively collect data on stock quotes and present it in a way that suits your needs?
Probably you will agree that this can be quite a time-consuming activity, particularly if you want to monitor the performance of certain stocks on a regular basics. This problem is addressed by some broker portals who offer free web based services to retrieve stock data using web queries via an API. Probably the most renowned portal offering a free API is Yahoo!Finance. Of particular interest are the csv export services. CSV stands for "comma separated values" and means that different stock related key figures (such as closing quote, trading volume, opening quote) are returned in pure text format. Data in this format can easily be processed by online scripts such as e.g. PHP scripts. The following section will describe the possibilities of the Yahoo!Finance API in detail.
Determine real-time stock quotes
In it's free version, the Yahoo!Finance interface provides quotes with a delay of 15 minutes (from NASDAQ) and up to 60 minutes from other stock exchanges. However, for most applications this should be sufficient. Yahoo! offers quotes from different stock exchanges. The selection of the stock exchange takes place in the URL as a suffix to the ticker symbol (e.g. VOW3.DE).The Yahoo!Finance API retrieves quotes via the following url http://finance.yahoo.com/d/quotes.csv? followed by three parameters:
| Param | Description |
| s= | the stock's ticker symbol. A combination of ticker symbols is also possible separated by the plus sign (e.g. s=VOW+MSFT). The values (separated by commas) are returned in a separate line by symbol. |
| f= | the format codes are provided with parameter "f". A lot of different format codes exist which you will find in the list at the bottom of the page. |
| e= | export type (optional). You should always add "e.csv" to indicate "comma separated values". |

