API Reference#
This page documents the yfinance-pl API.
Ticker Class#
The main class for fetching stock data.
import yfinance_pl as yf
ticker = yf.Ticker("AAPL")
Price History#
Method/Property |
Return Type |
Description |
|---|---|---|
|
|
Historical price data ( |
Parameters for history():
period: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, maxinterval: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mostart: Start date (YYYY-MM-DD)end: End date (YYYY-MM-DD)
Company Info#
Property |
Return Type |
Description |
|---|---|---|
|
|
Full company information |
|
|
Quick access to key metrics |
|
|
Upcoming events (earnings dates, etc.) |
Dividends & Corporate Actions#
Property |
Return Type |
Description |
|---|---|---|
|
|
Dividend history |
|
|
Stock split history |
|
|
Combined dividends and splits |
|
|
Capital gains (for funds/ETFs) |
Financial Statements#
Property |
Return Type |
Description |
|---|---|---|
|
|
Annual income statement |
|
|
Quarterly income statement |
|
|
Annual balance sheet |
|
|
Quarterly balance sheet |
|
|
Annual cash flow statement |
|
|
Quarterly cash flow statement |
|
|
Earnings summary |
Analyst Recommendations#
Property |
Return Type |
Description |
|---|---|---|
|
|
Analyst recommendations summary |
|
|
Rating changes history |
Options (US stocks only)#
Property/Method |
Return Type |
Description |
|---|---|---|
|
|
Available expiration dates |
|
|
Option chain for expiration date |
The option_chain() method returns an OptionChain named tuple:
chain = ticker.option_chain("2024-01-19")
chain.calls # pl.DataFrame
chain.puts # pl.DataFrame
Other#
Method |
Return Type |
Description |
|---|---|---|
|
|
ISIN identifier |
OptionChain#
Named tuple returned by option_chain().
from yfinance_pl import OptionChain
# OptionChain has two attributes:
# - calls: pl.DataFrame
# - puts: pl.DataFrame