{
    "mode": "perldoc",
    "parameter": "Finance::YahooQuote",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Finance%3A%3AYahooQuote/json",
    "generated": "2026-06-09T12:09:12Z",
    "synopsis": "use Finance::YahooQuote;\n# setting TIMEOUT and PROXY is optional\n$Finance::YahooQuote::TIMEOUT = 60;\n$Finance::YahooQuote::PROXY = \"http://some.where.net:8080\";\n@quote = getonequote $symbol; # Get a quote for a single symbol\n@quotes = getquote @symbols;  # Get quotes for a bunch of symbols\nuseExtendedQueryFormat();     # switch to extended query format\nuseRealtimeQueryFormat();     # switch to real-time query format\n@quotes = getquote @symbols;  # Get quotes for a bunch of symbols\n@quotes = getcustomquote([\"DELL\",\"IBM\"], # using custom format\n[\"Name\",\"Book Value\"]); # note array refs",
    "sections": {
        "NAME": {
            "content": "Finance::YahooQuote - Get stock quotes from Yahoo! Finance\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Finance::YahooQuote;\n# setting TIMEOUT and PROXY is optional\n$Finance::YahooQuote::TIMEOUT = 60;\n$Finance::YahooQuote::PROXY = \"http://some.where.net:8080\";\n@quote = getonequote $symbol; # Get a quote for a single symbol\n@quotes = getquote @symbols;  # Get quotes for a bunch of symbols\nuseExtendedQueryFormat();     # switch to extended query format\nuseRealtimeQueryFormat();     # switch to real-time query format\n@quotes = getquote @symbols;  # Get quotes for a bunch of symbols\n@quotes = getcustomquote([\"DELL\",\"IBM\"], # using custom format\n[\"Name\",\"Book Value\"]); # note array refs\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module gets stock quotes from Yahoo! Finance. The getonequote function will return a quote\nfor a single stock symbol, while the getquote function will return a quote for each of the stock\nsymbols passed to it. getcustomquote allows to specify a format other than the default to take\nadvantage of the extended range of available information.\n\nThe download operation is efficient: only one request is made even if several symbols are\nrequested at once. The return value of getonequote is an array, with the following elements:\n\n0 Symbol\n1 Company Name\n2 Last Price\n3 Last Trade Date\n4 Last Trade Time\n5 Change\n6 Percent Change\n7 Volume\n8 Average Daily Vol\n9 Bid\n10 Ask\n11 Previous Close\n12 Today's Open\n13 Day's Range\n14 52-Week Range\n15 Earnings per Share\n16 P/E Ratio\n17 Dividend Pay Date\n18 Dividend per Share\n19 Dividend Yield\n20 Market Capitalization\n21 Stock Exchange\n\nIf the extended format has been selected, the following fields are also retrieved:\n\n22 Short ratio\n23 1yr Target Price\n24 EPS Est. Current Yr\n25 EPS Est. Next Year\n26 EPS Est. Next Quarter\n27 Price/EPS Est. Current Yr\n28 Price/EPS Est. Next Yr\n29 PEG Ratio\n30 Book Value\n31 Price/Book\n32 Price/Sales\n33 EBITDA\n34 50-day Moving Avg\n35 200-day Moving Avg\n\nIf the real-time format has been selected, the following fields are also retrieved:\n\n36 Ask (real-time)\n37 Bid (real-time)\n38 Change in Percent (real-time)\n39 Last trade with time (real-time)\n40 Change (real-time)\n41 Day range (real-time)\n42 Market-cap (real-time)\n\nThe getquote function returns an array of pointers to arrays with the above structure.\n\nThe getonequote function returns just one quote, rather than an array. It returns a simple array\nof values for the given symbol.\n\nThe setQueryString permits to supply a new query string that will be used for subsequent data\nrequests.\n\nThe useExtendedQueryFormat and useRealtimeQueryFormat are simpler interfaces which append\nsymbols to the default quote string, as detailed above.\n\nThe getcustomquote returns an array of quotes corresponding to values for the symbols supplied\nin the first array reference, and the custom fields supplied in the second array reference. Here\nthe custom fields correspond to the 'named' fields of the list below.\n\nBeyond stock quotes, Finance::YahooQuote can also obtain quotes for currencies (from the\nPhiladephia exchange -- however Yahoo! appears to have stopped to support the currency symbols\nin a reliable manner), US mutual funds, options on US stocks, several precious metals and quite\npossibly more; see the Yahoo! Finance website for full information. Finance::YahooQuote can be\nused for stocks from the USA, Canada, various European exchanges, various Asian exchanges\n(Singapore, Taiwan, HongKong, Kuala Lumpur, ...) Australia and New Zealand. It should work for\nother markets supported by Yahoo.\n\nYou may optionally override the default LWP timeout of 180 seconds by setting\n$Finance::YahooQuote::TIMEOUT to your preferred value.\n\nYou may also provide a proxy (for the required http connection) by using the variable\n$Finance::YahooQuote::PROXY. Furthermore, authentication-based proxies can be used by setting\nthe proxy user and password via the variables $Finance::YahooQuote::PROXYUSER and\n$Finance::YahooQuote::PROXYPASSWD.\n\nTwo example scripts are provided to help with the mapping a stock symbols as well as with Yahoo!\nFinance server codes. The regression tests scripts in the t/ subdirectory of the source\ndistribution also contain simple examples.\n",
            "subsections": [
                {
                    "name": "The available custom fields",
                    "content": "The following list contains all the available data fields at Yahoo! along with the corresponding\nformat string entry:\n\nSymbol                            s\nName                              n\nLast Trade (With Time)            l\nLast Trade (Price Only)           l1\nLast Trade Date                   d1\nLast Trade Time                   t1\nLast Trade Size                   k3\nChange and Percent Change         c\nChange                            c1\nChange in Percent                 p2\nTicker Trend                      t7\nVolume                            v\nAverage Daily Volume              a2\nMore Info                         i\nTrade Links                       t6\nBid                               b\nBid Size                          b6\nAsk                               a\nAsk Size                          a5\nPrevious Close                    p\nOpen                              o\nDay's Range                       m\n52-week Range                     w\nChange From 52-wk Low             j5\nPct Chg From 52-wk Low            j6\nChange From 52-wk High            k4\nPct Chg From 52-wk High           k5\nEarnings/Share                    e\nP/E Ratio                         r\nShort Ratio                       s7\nDividend Pay Date                 r1\nEx-Dividend Date                  q\nDividend/Share                    d\nDividend Yield                    y\nFloat Shares                      f6\nMarket Capitalization             j1\n1yr Target Price                  t8\nEPS Est. Current Yr               e7\nEPS Est. Next Year                e8\nEPS Est. Next Quarter             e9\nPrice/EPS Est. Current Yr         r6\nPrice/EPS Est. Next Yr            r7\nPEG Ratio                         r5\nBook Value                        b4\nPrice/Book                        p6\nPrice/Sales                       p5\nEBITDA                            j4\n50-day Moving Avg                 m3\nChange From 50-day Moving Avg     m7\nPct Chg From 50-day Moving Avg    m8\n200-day Moving Avg                m4\nChange From 200-day Moving Avg    m5\nPct Chg From 200-day Moving Avg   m6\nShares Owned                      s1\nPrice Paid                        p1\nCommission                        c3\nHoldings Value                    v1\nDay's Value Change                w1,\nHoldings Gain Percent             g1\nHoldings Gain                     g4\nTrade Date                        d2\nAnnualized Gain                   g3\nHigh Limit                        l2\nLow Limit                         l3\nNotes                             n4\nLast Trade (Real-time) with Time  k1\nBid (Real-time)                   b3\nAsk (Real-time)                   b2\nChange Percent (Real-time)        k2\nChange (Real-time)                c6\nHoldings Value (Real-time)        v7\nDay's Value Change (Real-time)    w4\nHoldings Gain Pct (Real-time)     g5\nHoldings Gain (Real-time)         g6\nDay's Range (Real-time)           m2\nMarket Cap (Real-time)            j3\nP/E (Real-time)                   r2\nAfter Hours Change (Real-time)    c8\nOrder Book (Real-time)            i5\nStock Exchange                    x\n\nFAQs\nHow can one figure out the format string?\nProvided a My Yahoo! (http://my.yahoo.com) account, go to the following URL:\n\nhttp://edit.my.yahoo.com/config/editpfview?.vk=v1\n\nViewing the source of this page, you will come across the section that defines the menus that\nlet you select which elements go into a particular view. The <option> values are the strings\nthat pick up the information described in the menu item. For example, Symbol refers to the\nstring \"s\" and name refers to the string \"l\". Using \"sl\" as the format string, we would get the\nsymbol followed by the name of the security.\n\nThe example script *examineserver.sh* shows this in some more detail and downloads example .csv\nfiles using GNU wget.\n\nWhat about different stock symbols for the same corporation?\nThis can be issue. For the first few years, Yahoo! Finance's servers appeared to be cover their\nrespective local markets. E.g., the UK-based servers provided quotes for Europe, the Australian\none for the Australia and New Zealand and so on. Hence, one needed to branch and bound code and\nmap symbols to their region's servers.\n\nIt now appears that this is no longer required, which is good news as it simplifies coding.\nHowever, some old symbols are no longer supported -- yet other, and supported, codes exist for\nthe same company. For example, German stocks used to quoted in terms or their cusip-like 'WKN'.\nThe main server does not support these, but does support newer, acronym-based symbols. The\nexample script examineserver.sh helps in finding the mapping as e.g. from 555750.F to DTEGN.F\nfor Deutsche Telekom.\n"
                }
            ]
        },
        "COPYRIGHT": {
            "content": "Copyright 1998 - 2002 Dj Padzensky Copyright 2002 - 2007 Dirk Eddelbuettel\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the\nGNU General Public License as published by the Free Software Foundation; either version 2 of the\nLicense, or (at your option) any later version.\n\nThe information that you obtain with this library may be copyrighted by Yahoo! Inc., and is\ngoverned by their usage license. See http://www.yahoo.com/docs/info/gendisclaimer.html for more\ninformation.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Dj Padzensky (\"djpadz@padz.net\"), PadzNet, Inc., wrote the original version. Dirk Eddelbuettel\n(\"edd@debian.org\") provided several extensions based on DJ's original work and is the current\nmaintainer.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "The Finance::YahooQuote home pages are found at http://www.padz.net/~djpadz/YahooQuote/ and\nhttp://dirk.eddelbuettel.com/code/yahooquote.html.\n\nThe smtm (Show Me The Money) program uses Finance::YahooQuote for a customisable stock/portfolio\nticker and chart display, see http://dirk.eddelbuettel.com/code/smtm.html for more. The\nbeancounter program uses it to store quotes in a SQL database, see\nhttp://dirk.eddelbuettel.com/code/beancounter.html.\n",
            "subsections": []
        }
    },
    "summary": "Finance::YahooQuote - Get stock quotes from Yahoo! Finance",
    "flags": [],
    "examples": [],
    "see_also": []
}