yf_docs = """ # YFinance UPDATED API DOCUMENTATION # Always refer the following updated documentation for writing python code to call yf api ## Single Ticker Usage ```python import yfinance as yf ticker = yf.Ticker('MSFT') data = ticker.history(period='6mo') data.columns, data.shape ``` Returns: ```python (Index(['Open', 'High', 'Low', 'Close', 'Volume', 'Dividends', 'Stock Splits'], dtype='object'), (126, 7)) ``` ## Multi-Ticker Usage # Get historical market data for multiple tickers: ```python tickers = yf.Tickers('MSFT AAPL') data = tickers.history(period='6mo') data.columns,data.shape ``` Returns: ```python (MultiIndex([( 'Close', 'AAPL'), ( 'Close', 'MSFT'), ( 'Dividends', 'AAPL'), ( 'Dividends', 'MSFT'), ( 'High', 'AAPL'), ( 'High', 'MSFT'), ( 'Low', 'AAPL'), ( 'Low', 'MSFT'), ( 'Open', 'AAPL'), ( 'Open', 'MSFT'), ('Stock Splits', 'AAPL'), ('Stock Splits', 'MSFT'), ( 'Volume', 'AAPL'), ( 'Volume', 'MSFT')], names=['Price', 'Ticker']), (126, 14)) ``` ### News Get news for multiple tickers: ```python tickers = yf.Tickers('MSFT AAPL GOOG') news = tickers.news() ``` Returns: ```python - MSFT: list - AAPL: list - GOOG: list ``` ## Single Ticker Methods ### Info ```python ticker.info ``` Returns: ```python - address1: str - city: str - state: str - zip: str - country: str - phone: str - website: str - industry: str - industryKey: str - industryDisp: str - sector: str - sectorKey: str - sectorDisp: str - longBusinessSummary: str - fullTimeEmployees: int - companyOfficers: list - auditRisk: int - boardRisk: int - compensationRisk: int - shareHolderRightsRisk: int - overallRisk: int - governanceEpochDate: int - compensationAsOfEpochDate: int - irWebsite: str - maxAge: int - priceHint: int - previousClose: float - open: float - dayLow: float - dayHigh: float - regularMarketPreviousClose: float - regularMarketOpen: float - regularMarketDayLow: float - regularMarketDayHigh: float - dividendRate: float - dividendYield: float - exDividendDate: int - payoutRatio: float - fiveYearAvgDividendYield: float - beta: float - trailingPE: float - forwardPE: float - volume: int - regularMarketVolume: int - averageVolume: int - averageVolume10days: int - averageDailyVolume10Day: int - bid: float - ask: float - bidSize: int - askSize: int - marketCap: int - fiftyTwoWeekLow: float - fiftyTwoWeekHigh: float - priceToSalesTrailing12Months: float - fiftyDayAverage: float - twoHundredDayAverage: float - currency: str - enterpriseValue: int - profitMargins: float - floatShares: int - sharesOutstanding: int - sharesShort: int - sharesShortPriorMonth: int - sharesShortPreviousMonthDate: int - dateShortInterest: int - sharesPercentSharesOut: float - heldPercentInsiders: float - heldPercentInstitutions: float - shortRatio: float - shortPercentOfFloat: float - impliedSharesOutstanding: int - bookValue: float - priceToBook: float - lastFiscalYearEnd: int - nextFiscalYearEnd: int - mostRecentQuarter: int - earningsQuarterlyGrowth: float - netIncomeToCommon: int - trailingEps: float - forwardEps: float - lastSplitFactor: str - lastSplitDate: int - enterpriseToRevenue: float - enterpriseToEbitda: float - 52WeekChange: float - SandP52WeekChange: float - lastDividendValue: float - lastDividendDate: int - exchange: str - quoteType: str - symbol: str - underlyingSymbol: str - shortName: str - longName: str - firstTradeDateEpochUtc: int - timeZoneFullName: str - timeZoneShortName: str - uuid: str - messageBoardId: str - gmtOffSetMilliseconds: int - currentPrice: float - targetHighPrice: float - targetLowPrice: float - targetMeanPrice: float - targetMedianPrice: float - recommendationMean: float - recommendationKey: str - numberOfAnalystOpinions: int - totalCash: int - totalCashPerShare: float - ebitda: int - totalDebt: int - quickRatio: float - currentRatio: float - totalRevenue: int - debtToEquity: float - revenuePerShare: float - returnOnAssets: float - returnOnEquity: float - grossProfits: int - freeCashflow: int - operatingCashflow: int - earningsGrowth: float - revenueGrowth: float - grossMargins: float - ebitdaMargins: float - operatingMargins: float - financialCurrency: str - trailingPegRatio: float ``` ### Financial Statements #### Income Statement ```python ticker.income_stmt ``` Returns: ```python DataFrame with columns: [Timestamp('2024-06-30 00:00:00'), Timestamp('2023-06-30 00:00:00'), Timestamp('2022-06-30 00:00:00'), Timestamp('2021-06-30 00:00:00')] Shape: (47, 4) ``` ## Common Parameters ### Period Options - `1d`: 1 day - `5d`: 5 days - `1mo`: 1 month - `3mo`: 3 months - `6mo`: 6 months - `1y`: 1 year - `2y`: 2 years - `5y`: 5 years - `10y`: 10 years - `ytd`: Year to date - `max`: Maximum available data ### Interval Options - `1m`: 1 minute - `2m`: 2 minutes - `5m`: 5 minutes - `15m`: 15 minutes - `30m`: 30 minutes - `60m`: 60 minutes - `90m`: 90 minutes - `1h`: 1 hour - `1d`: 1 day - `5d`: 5 days - `1wk`: 1 week - `1mo`: 1 month - `3mo`: 3 months """