Finance::QuoteOptions is a Perl extension for retrieving options pricing and series information from the web.
SYNOPSIS
use Finance::QuoteOptions;
my $q=Finance::QuoteOptions->new('DIA');
die 'Retrieve Failed' unless $q->retrieve;
#Expiration dates in ISO format (YYYYMMDD)
my @expirations = @{$q->expirations};
#Calls/Puts for next expiration, sorted by strike price
my @calls = @{$q->calls(0)};
my @puts = @{$q->puts(0)};
#Data from an individual option
my $strike = ${$q->option('XYZAB')}{strike};
my $symbol = ${$q->option('XYZAB')}{symbol};
my $bid = ${$q->option('XYZAB')}{bid};
my $ask = ${$q->option('XYZAB')}{ask};
A 'screen-scraper' utility using WWW::Mechanize and HTML::TokeParser to retrieve and parse options information from either Yahoo Finance or the Chicago Board Options Exchange (CBOE) web site. The CBOE probably has better data but Yahoo is much faster. By default, Yahoo Finance is used as the source.
The Yahoo address used, using DIA as an example, is: http://finance.yahoo.com/q/op?s=DIA
The CBOE address used is: http://www.cboe.com/DelayedQuote/QuoteTable.aspx
CBOE Blacklist Warning
The CBOE site has two interfaces for retrieving option information: a page where you can download a CSV file and a web page that displays an HTML table. While the CSV file would be so simple to process, there's a big warning not to do any kind of automated retrieval of that information. So I wrote this module to use the web page.
Unfortunately, although I could find no such warning on the web portion of the CBOE site, you will still get blacklisted using the web portion. After a couple of weeks of using this code and tens of thousands of queries, I got blacklisted.
So if you're doing many queries, use Yahoo has your source. Yahoo is much faster anyway.
Product's homepage
Requirements:
· Perl