Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  FINANCE::QUOTEHIST (3)

.ds Aq ’


Finance::QuoteHist - Perl module for fetching historical stock quotes.



  use Finance::QuoteHist;
  $q = Finance::QuoteHist->new
      symbols    => [qw(IBM UPS AMZN)],
      start_date => 01/01/2009, # or 1 year ago, see Date::Manip
      end_date   => today,

  # Quotes
  foreach $row ($q->quotes()) {
    ($symbol, $date, $open, $high, $low, $close, $volume) = @$row;

  # Splits
  foreach $row ($q->splits()) {
     ($symbol, $date, $post, $pre) = @$row;

  # Dividends
  foreach $row ($q->dividends()) {
     ($symbol, $date, $dividend) = @$row;

  # Culprit
  $fetch_class = $q->quote_source(IBM);


Finance::QuoteHist is a top level interface for fetching historical stock quotes from the web.

It is actually a front end to modules based on Finance::QuoteHist::Generic, the main difference being that it has a default lineup of web sites from which to attempt quote retrieval. If the prospect of mixing data from multiple sites seems scary to you, then use one of the site-specific modules directly.

Unless otherwise defined via the lineup attribute, this module will select a lineup for you, the default being:


Once instantiated, this module behaves identically to the first module in the lineup, sharing all of that module’s methods.

Most queries will likely be handled by the first module in the lineup. If the site is down for some reason, or perhaps that site does not provide quotes for defunct ticker symbols, then the other sites in the lineup will be attempted.

See Finance::QuoteHist::Generic(3) for gory details on all of the parameters and methods this module accepts. The basic interface is noted below.


The basic user interface consists of several methods, as seen in the example above. Those methods are:
quotes() Returns a list of rows (or a reference to an array containing those rows, if in scalar context). Each row contains the <B>SymbolB>, <B>DateB>, <B>OpenB>, <B>HighB>, <B>LowB>, <B>CloseB>, and <B>VolumeB> for that date. Optionally, if non-adjusted values were requested, their will be an extra element at the end of the row for the <B>AdjustedB> closing price.
dividends() Returns a list of rows (or a reference to an array containing those rows, if in scalar context). Each row contains the <B>DateB> and amount of the <B>DividendB>, in that order.
splits() Returns a list of rows (or a reference to an array containing those rows, if in scalar context). Each row contains the <B>DateB>, <B>PostB> split shares, and <B>PreB> split shares, in that order.
source($ticker, $target) Each of these methods displays which site-specific class actually retrieved the information, if any, for a particular ticker symbol and target such as ’quote’ (default), ’dividend’, or ’split’.


The data returned from these modules is in no way guaranteed, nor are the developers responsible in any way for how this data (or lack thereof) is used. The interface is based on URLs and page layouts that might change at any time. Even though these modules are designed to be adaptive under these circumstances, they will at some point probably be unable to retrieve data unless fixed or provided with new parameters. Furthermore, the data from these web sites is usually not even guaranteed by the web sites themselves, and oftentimes is acquired elsewhere. See the documentation for each site-specific module for more information regarding the disclaimer for that site.


Matthew P. Sisk, <>


Copyright (c) 2000-2014 Matthew P. Sisk. All rights reserved. All wrongs revenged. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Finance::QuoteHist::Generic(3), Finance::QuoteHist::Yahoo(3), Finance::QuoteHist::QuoteMedia(3), perl(1).
Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 FINANCE::QUOTEHIST (3) 2015-08-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.