# Yfinance

Yfinance global market data interface, retrieve OHLCV and research data for US, HK...

- Repository: https://github.com/HKUDS/Vibe-Trading (37375 stars)
- Category: Writing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add HKUDS/Vibe-Trading --skill yfinance -g -a claude-code -y`
Codex: `npx skills add HKUDS/Vibe-Trading --skill yfinance -g -a codex -y`
Cursor: `npx skills add HKUDS/Vibe-Trading --skill yfinance -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/Vibe-Trading --skill yfinance -g -a gemini-cli -y`

## Description

yfinance global market data interface, retrieve OHLCV and research data for US, HK, and Canadian stocks, ETFs, and indices via Yahoo Finance. Free, no API key required.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# yfinance

## Overview

yfinance is an open-source Python wrapper for Yahoo Finance, providing global market data (US, HK, and Canadian stocks, ETFs, indices) including historical and real-time quotes. **Completely free, no registration or API key required.**

The project has a built-in yfinance DataLoader (`backtest/loaders/yfinance_loader.py`). When backtesting, set `source: "yfinance"` or `source: "auto"` to invoke it automatically.

For OHLCV bars in agent/swarm work, prefer the `get_market_data` tool when it is available. It routes through the project loader layer, normalizes symbols, removes malformed OHLC rows, and returns strict JSON. Use direct `yfinance` calls mainly for data outside OHLCV coverage such as company info, financial statements, options, holders, and insider transactions.

## Deep Yahoo Interfaces (references/)

Beyond the `yfinance` package, the project ships a built-in **Yahoo public-API
client** (`backtest.loaders.yahoo_client`) and two read-only agent tools that
sit on top of it. These reach Yahoo's own unauthenticated JSON endpoints
directly via `requests` (no `yfinance` install needed), share one throttled
HTTP gate (Yahoo rate-limits by source IP), and handle the cookie+crumb
handshake automatically. Each interface has its own reference doc, read the
one you need rather than loading them all:

The rest: https://github.com/HKUDS/Vibe-Trading/blob/HEAD/agent/src/skills/yfinance/SKILL.md
