Market data · active

yfinance

An open-source Python library that retrieves market data through Yahoo Finance's publicly available interfaces.

What it covers

yfinance wraps ticker history, corporate actions, financial statements, options, funds, search, screening, and other Yahoo Finance data in a Pythonic interface. It is a library, not a vendor contract or stable paid data feed.

Request shape

import yfinance as yf

history = yf.download("AAPL", period="1mo", auto_adjust=True)
print(history.tail())

Pin the package version for reproducible work and expect upstream response behavior to evolve.

For yf.download() in the reviewed 1.7.0 source, auto_adjust=True and multi_level_index=True are defaults. Project documentation explains that Close is already adjusted for splits and dividends in that mode; auto_adjust=False retains a separate Adj Close alongside Yahoo OHLC that is already split-adjusted. For a single ticker, multi_level_index=False produces flat columns. Read the missing Adj Close and MultiIndex integration case for explicit options and verification steps (source review: 2026-10-20).

Key functions (unofficial library, not a REST API)

Function Description
Ticker.history() OHLCV price history
Ticker.info Company metadata dict
Ticker.dividends Dividend payment series
Ticker.splits Stock split series
Ticker.financials Income statement
Ticker.balance_sheet Balance sheet
Ticker.cashflow Cash flow statement
Ticker.earnings_dates Earnings dates
download() Bulk download multiple tickers

Decision notes

Use yfinance for personal research and prototyping where its stated terms fit. For production redistribution, uptime commitments, deterministic schemas, or licensed display rights, evaluate a contracted market-data provider instead.

Python example: ticker info and dividends

import yfinance as yf

ticker = yf.Ticker("SCHD")

# Basic info — shortName/longName may be missing for some tickers
info = ticker.info
name = info.get("shortName") or info.get("longName") or ticker.ticker
print(name)

# Dividend history as a DataFrame
divs = ticker.dividends
print(divs.tail(3))

# Recent price history
hist = ticker.history(period="1mo")
print(hist[["Close"]].tail(3))

Note: yfinance scrapes Yahoo Finance and is not an official API. Rate limits are undocumented and can change. For production use with SLAs, prefer a licensed provider.

Integration surface

Versioning
Package releases provide versioning, but there is no contracted hosted-API version surface.
Resource groups
Ticker, Download, Search, Screeners, WebSocket helpers
Pagination
Wrapper-specific; there is no uniform public pagination contract.
Errors
Python exceptions and upstream response changes must be handled by the application.
Webhooks
No webhook interface is provided by the package.
Official SDKs
Python package

Practical integration cases

한국어 연동 사례