Version 1.2 released of YahooFinanceAPI – new option constants

Today (March 12th, 2010) I released Version 1.2 of my YahooFinanceAPI PHP Wrapper Library. This version adds constants defining the Stock Options available from Yahoo Finance. A minor change to be sure, but one that can come in handy to those new to Stock Quotes and the available options.

All the constants are defined in the YahooFinance_Options class and are to be utilized when setting the options to be returned and when getting their values out of the returned stock quotes.

Setting the Options

$api->addOption( YahooFinance_Options::SYMBOL );
$api->addOption( YahooFinance_Options::PREVIOUS_CLOSE);
$api->addOption( YahooFinance_Options::OPEN );
$api->addOption( YahooFinance_Options::LAST_TRADE );

Getting the Stock Option value

$quote->get( YahooFinance_Options::SYMBOL );
$quote->get( YahooFinance_Options::PREVIOUS_CLOSE );
$quote->get( YahooFinance_Options::OPEN );
$quote->get( YahooFinance_Options::LAST_TRADE );

To see full sample code as well as staying up-to-date on changes to the library then please visit the PHP Wrapper Library for Yahoo Finance Stock Quotes API page that is maintained with the latest version for download and usage examples.

Comments & Questions

Add Your Comment