Spaces:
Running
Running
File size: 5,560 Bytes
caf8c54 8f760dd caf8c54 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
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')
```
## Multi-Ticker Usage
### Initialization
```python
import yfinance as yf
tickers = yf.Tickers('MSFT AAPL GOOG')
```
### Download Historical Data
Get historical market data for multiple tickers:
```python
# Method 1: Using Tickers object
tickers = yf.Tickers('MSFT AAPL GOOG')
data = tickers.download(period='1mo')
# Method 2: Using download function directly
data = yf.download(['MSFT', 'AAPL', 'GOOG'], period='1mo')
```
Returns:
```python
DataFrame with columns: [('Close', 'AAPL'), ('Close', 'GOOG'), ('Close', 'MSFT'), ('Dividends', 'AAPL'), ('Dividends', 'GOOG'), ('Dividends', 'MSFT'), ('High', 'AAPL'), ('High', 'GOOG'), ('High', 'MSFT'), ('Low', 'AAPL'), ('Low', 'GOOG'), ('Low', 'MSFT'), ('Open', 'AAPL'), ('Open', 'GOOG'), ('Open', 'MSFT'), ('Stock Splits', 'AAPL'), ('Stock Splits', 'GOOG'), ('Stock Splits', 'MSFT'), ('Volume', 'AAPL'), ('Volume', 'GOOG'), ('Volume', 'MSFT')]
Shape: (21, 21)
```
### News
Get news for multiple tickers:
```python
tickers = yf.Tickers('MSFT AAPL GOOG')
news = tickers.news()
```
Returns:
```python
- MSFT: list
- AAPL: list
- GOOG: list
```
### Accessing Individual Tickers
Access individual ticker data from a multi-ticker object:
```python
tickers = yf.Tickers('MSFT AAPL GOOG')
msft_info = tickers.tickers['MSFT'].info
aapl_history = tickers.tickers['AAPL'].history(period='1mo')
```
## 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
```
### History
```python
ticker.history(period='1mo')
```
Returns:
```python
DataFrame with columns: ['Open', 'High', 'Low', 'Close', 'Volume', 'Dividends', 'Stock Splits']
Shape: (21, 7)
```
### 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
""" |