yfinance

Download historical OHLCV and fundamental datasets from Yahoo Finance.

Updated May 5, 2026
One-click install
npx skills add https://github.com/wudye/traderAssistHK --skill yfinance-wudye
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: yfinance
Source: https://github.com/wudye/traderAssistHK/tree/main/backend/src/skills/yfinance
Command: npx skills add https://github.com/wudye/traderAssistHK --skill yfinance-wudye

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

yfinance eliminates the time-consuming effort of manually gathering market data by providing a single interface to download historical prices and fundamental datasets from Yahoo Finance across US and HK-listed instruments.

Core Features & Use Cases

  • Historical OHLCV (multi-interval): Retrieve daily and minute-level bars (with Yahoo Finance-imposed limits) for stocks, ETFs, indices, and FX pairs.
  • Fundamentals and corporate actions: Pull company info, financial statements, dividends, splits, and corporate actions for analysis and model features.
  • Holdings and transactions: Access institutional holders, major holders summaries, and insider transactions to support valuation and sentiment research.
  • Use Case: Backtest a strategy on a mix of US and HK tickers by specifying source: "yfinance" (or "auto") and letting the loader handle ticker normalization.

Quick Start

Install yfinance and pandas, then download historical daily bars by running the yfinance Python snippet to fetch AAPL from 2025-01-01 to 2026-01-01 and print the first rows.

Frequently Asked Questions about yfinance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I download historical OHLCV data for backtesting US and HK stocks?

You download historical OHLCV data by specifying source: "yfinance" in the loader, which automatically normalizes tickers like AAPL.US to AAPL and pads HK tickers like 700.HK to 0700.HK to fetch daily or minute-level bars from Yahoo Finance.

Can I retrieve financial statements and institutional holdings from Yahoo Finance?

Yes, you can retrieve financial statements, institutional holders, major holders, and insider transactions by configuring the YAML frontmatter to access the fundamentals and holdings functions provided by the yfinance interface.

Does the yfinance loader support ETFs, major indices, and FX pairs for market data retrieval?

The yfinance loader supports downloading historical market data for US stocks, HK stocks, ETFs, major indices, and FX pairs, allowing you to gather multi-interval OHLCV bars for global instruments.

How do I track corporate actions like dividends and stock splits for fundamental analysis?

You track corporate actions by using the loader to pull company info, dividends, splits, and corporate actions from Yahoo Finance, providing the necessary datasets for analysis and model features.

What are the limitations of fetching minute-level OHLCV bars using Yahoo Finance?

Fetching minute-level OHLCV bars is subject to Yahoo Finance-imposed limits, meaning historical intraday data availability is restricted and you may encounter constraints on how far back you can query minute-level bars.

Do I need pandas to fetch historical market data from Yahoo Finance?

Yes, you need pandas installed to fetch historical market data, as the quick start requires installing both yfinance and pandas to run the Python snippet that downloads daily bars and prints the first rows.