.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "YahooQuote 3pm" .TH YahooQuote 3pm "2015-04-29" "perl v5.20.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Finance::YahooQuote \- Get stock quotes from Yahoo! Finance .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 11 \& use Finance::YahooQuote; \& # setting TIMEOUT and PROXY is optional \& $Finance::YahooQuote::TIMEOUT = 60; \& $Finance::YahooQuote::PROXY = "http://some.where.net:8080"; \& @quote = getonequote $symbol; # Get a quote for a single symbol \& @quotes = getquote @symbols; # Get quotes for a bunch of symbols \& useExtendedQueryFormat(); # switch to extended query format \& useRealtimeQueryFormat(); # switch to real\-time query format \& @quotes = getquote @symbols; # Get quotes for a bunch of symbols \& @quotes = getcustomquote(["DELL","IBM"], # using custom format \& ["Name","Book Value"]); # note array refs .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module gets stock quotes from Yahoo! Finance. The \fBgetonequote\fR function will return a quote for a single stock symbol, while the \&\fBgetquote\fR function will return a quote for each of the stock symbols passed to it. \fBgetcustomquote\fR allows to specify a format other than the default to take advantage of the extended range of available information. .PP The download operation is efficient: only one request is made even if several symbols are requested at once. The return value of \&\fBgetonequote\fR is an array, with the following elements: .PP .Vb 10 \& 0 Symbol \& 1 Company Name \& 2 Last Price \& 3 Last Trade Date \& 4 Last Trade Time \& 5 Change \& 6 Percent Change \& 7 Volume \& 8 Average Daily Vol \& 9 Bid \& 10 Ask \& 11 Previous Close \& 12 Today\*(Aqs Open \& 13 Day\*(Aqs Range \& 14 52\-Week Range \& 15 Earnings per Share \& 16 P/E Ratio \& 17 Dividend Pay Date \& 18 Dividend per Share \& 19 Dividend Yield \& 20 Market Capitalization \& 21 Stock Exchange .Ve .PP If the extended format has been selected, the following fields are also retrieved: .PP .Vb 10 \& 22 Short ratio \& 23 1yr Target Price \& 24 EPS Est. Current Yr \& 25 EPS Est. Next Year \& 26 EPS Est. Next Quarter \& 27 Price/EPS Est. Current Yr \& 28 Price/EPS Est. Next Yr \& 29 PEG Ratio \& 30 Book Value \& 31 Price/Book \& 32 Price/Sales \& 33 EBITDA \& 34 50\-day Moving Avg \& 35 200\-day Moving Avg .Ve .PP If the real-time format has been selected, the following fields are also retrieved: .PP .Vb 7 \& 36 Ask (real\-time) \& 37 Bid (real\-time) \& 38 Change in Percent (real\-time) \& 39 Last trade with time (real\-time) \& 40 Change (real\-time) \& 41 Day range (real\-time) \& 42 Market\-cap (real\-time) .Ve .PP The \fBgetquote\fR function returns an array of pointers to arrays with the above structure. .PP The \fBgetonequote\fR function returns just one quote, rather than an array. It returns a simple array of values for the given symbol. .PP The \fBsetQueryString\fR permits to supply a new query string that will be used for subsequent data requests. .PP The \fBuseExtendedQueryFormat\fR and \fBuseRealtimeQueryFormat\fR are simpler interfaces which append symbols to the default quote string, as detailed above. .PP The \fBgetcustomquote\fR returns an array of quotes corresponding to values for the symbols supplied in the first array reference, and the custom fields supplied in the second array reference. Here the custom fields correspond to the 'named' fields of the list below. .PP Beyond stock quotes, \fBFinance::YahooQuote\fR can also obtain quotes for currencies (from the Philadephia exchange \*(-- however Yahoo! appears to have stopped to support the currency symbols in a reliable manner), \s-1US\s0 mutual funds, options on \s-1US\s0 stocks, several precious metals and quite possibly more; see the Yahoo! Finance website for full information. \fBFinance::YahooQuote\fR can be used for stocks from the \&\s-1USA,\s0 Canada, various European exchanges, various Asian exchanges (Singapore, Taiwan, HongKong, Kuala Lumpur, ...) Australia and New Zealand. It should work for other markets supported by Yahoo. .PP You may optionally override the default \s-1LWP\s0 timeout of 180 seconds by setting \&\f(CW$Finance::YahooQuote::TIMEOUT\fR to your preferred value. .PP You may also provide a proxy (for the required http connection) by using the variable \f(CW$Finance::YahooQuote::PROXY\fR. Furthermore, authentication-based proxies can be used by setting the proxy user and password via the variables \&\f(CW$Finance::YahooQuote::PROXYUSER\fR and \f(CW$Finance::YahooQuote::PROXYPASSWD\fR. .PP Two example scripts are provided to help with the mapping a stock symbols as well as with Yahoo! Finance server codes. The regression tests scripts in the \fBt/\fR subdirectory of the source distribution also contain simple examples. .SS "The available custom fields" .IX Subsection "The available custom fields" The following list contains all the available data fields at Yahoo! along with the corresponding format string entry: .PP .Vb 10 \& Symbol s \& Name n \& Last Trade (With Time) l \& Last Trade (Price Only) l1 \& Last Trade Date d1 \& Last Trade Time t1 \& Last Trade Size k3 \& Change and Percent Change c \& Change c1 \& Change in Percent p2 \& Ticker Trend t7 \& Volume v \& Average Daily Volume a2 \& More Info i \& Trade Links t6 \& Bid b \& Bid Size b6 \& Ask a \& Ask Size a5 \& Previous Close p \& Open o \& Day\*(Aqs Range m \& 52\-week Range w \& Change From 52\-wk Low j5 \& Pct Chg From 52\-wk Low j6 \& Change From 52\-wk High k4 \& Pct Chg From 52\-wk High k5 \& Earnings/Share e \& P/E Ratio r \& Short Ratio s7 \& Dividend Pay Date r1 \& Ex\-Dividend Date q \& Dividend/Share d \& Dividend Yield y \& Float Shares f6 \& Market Capitalization j1 \& 1yr Target Price t8 \& EPS Est. Current Yr e7 \& EPS Est. Next Year e8 \& EPS Est. Next Quarter e9 \& Price/EPS Est. Current Yr r6 \& Price/EPS Est. Next Yr r7 \& PEG Ratio r5 \& Book Value b4 \& Price/Book p6 \& Price/Sales p5 \& EBITDA j4 \& 50\-day Moving Avg m3 \& Change From 50\-day Moving Avg m7 \& Pct Chg From 50\-day Moving Avg m8 \& 200\-day Moving Avg m4 \& Change From 200\-day Moving Avg m5 \& Pct Chg From 200\-day Moving Avg m6 \& Shares Owned s1 \& Price Paid p1 \& Commission c3 \& Holdings Value v1 \& Day\*(Aqs Value Change w1, \& Holdings Gain Percent g1 \& Holdings Gain g4 \& Trade Date d2 \& Annualized Gain g3 \& High Limit l2 \& Low Limit l3 \& Notes n4 \& Last Trade (Real\-time) with Time k1 \& Bid (Real\-time) b3 \& Ask (Real\-time) b2 \& Change Percent (Real\-time) k2 \& Change (Real\-time) c6 \& Holdings Value (Real\-time) v7 \& Day\*(Aqs Value Change (Real\-time) w4 \& Holdings Gain Pct (Real\-time) g5 \& Holdings Gain (Real\-time) g6 \& Day\*(Aqs Range (Real\-time) m2 \& Market Cap (Real\-time) j3 \& P/E (Real\-time) r2 \& After Hours Change (Real\-time) c8 \& Order Book (Real\-time) i5 \& Stock Exchange x .Ve .SH "FAQs" .IX Header "FAQs" .SS "How can one figure out the format string?" .IX Subsection "How can one figure out the format string?" Provided a My Yahoo! (http://my.yahoo.com) account, go to the following \s-1URL:\s0 .PP .Vb 1 \& http://edit.my.yahoo.com/config/edit_pfview?.vk=v1 .Ve .PP Viewing the source of this page, you will come across the section that defines the menus that let you select which elements go into a particular view. The