yfinance
यह क्या करती है
यह स्किल Yahoo Finance से शेयरों, ETF और इंडेक्स का कीमत इतिहास और कंपनी डेटा लाती है। यह उन विश्लेषकों और छात्रों के लिए है जिन्हें मुफ़्त बाज़ार डेटा चाहिए।
कब इस्तेमाल करें
- ✓जब आपको किसी अमेरिकी, हॉन्गकॉन्ग या कनाडाई शेयर का रोज़ का कीमत इतिहास चाहिए।
- ✓जब आपको Yahoo Finance से कंपनी जानकारी, वित्तीय विवरण या ऑप्शन चेन चाहिए।
- ✓जब आपको पेड खाता बनाए बिना बैकटेस्ट के लिए मुफ़्त बाज़ार डेटा चाहिए।
Skill का लिंक
https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/yfinance/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“Microsoft के पाँच साल के दैनिक भाव और नवीनतम त्रैमासिक वित्तीय विवरण लाइए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह Python रैपर या अंतर्निहित लोडर के ज़रिए Yahoo Finance डेटा इस्तेमाल करती है, और कोई साइन-अप नहीं चाहिए। सामान्य कीमत डेटा के लिए यह एक मानक लोडर से गुज़रती है, जो गलत पंक्तियाँ साफ़ करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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:
| Doc | Covers |
|---|---|
| yahoo_client.get_chart | Direct v8 OHLCV bars (range or epoch window) |
| yahoo_client.get_quote_summary | v10 quoteSummary modules (key stats, financials, ownership) |
| yahoo_client.get_options | v7 option chain (expirations + calls/puts) |
| yahoo_client.search | v1 instrument search by ticker/name |
| get_options_chain tool | Agent tool: US options ladder envelope |
| get_stock_profile tool | Agent tool: company profile/estimates/ownership envelope |
Path convention: every link above is written relative to this document (
references/...), the form GitHub resolves when the file is opened in a browser.read_fileresolves the same string against the skill that owns it, so the agent and a human reader reach one file. Reuse the relative form for any new reference docs, and keep reference paths unique across skills: a path two skills both carry is reported as ambiguous rather than guessed.
The Yahoo client uses the project ticker convention (AAPL.US → AAPL,
00700.HK → 0700.HK, TD.TO and PNG.V pass through); see the
Ticker Format Conversion table below — the same
rules apply across all of the interfaces above.
Quick Start
Preferred OHLCV tool call:
{
"codes": ["AAPL.US", "700.HK", "TD.TO", "PNG.V"],
"start_date": "2025-01-01",
"end_date": "2026-01-01",
"source": "yfinance",
"interval": "1D"
}
If you must write a Python script for OHLCV, use the DataLoader instead of raw yf.download:
from backtest.loaders.registry import get_loader_cls_with_fallback
loader = get_loader_cls_with_fallback("yfinance")()
data = loader.fetch(
["AAPL.US", "700.HK", "TD.TO", "PNG.V"],
"2025-01-01",
"2026-01-01",
interval="1D",
)
for symbol, df in data.items():
print(symbol, df.tail())
Ticker Format Conversion
The project uses a unified ticker format. The DataLoader automatically converts to yfinance format:
| Project Format | yfinance Format | Market |
|---|---|---|
AAPL.US |
AAPL |
US stock |
MSFT.US |
MSFT |
US stock |
700.HK |
0700.HK |
HK stock |
9988.HK |
9988.HK |
HK stock |
TD.TO |
TD.TO |
Toronto Stock Exchange stock |
PNG.V |
PNG.V |
TSX Venture stock |
SPY.US |
SPY |
US ETF |
Rules:
- US stocks: strip the
.USsuffix → use the raw ticker - HK stocks: keep
.HK, pad the number to 4 digits (700→0700) - Canadian stocks: keep
.TO(TSX) or.V(TSXV) unchanged
Supported Data Types
1. Historical OHLCV
Prefer get_market_data for OHLCV whenever the tool is available:
{
"codes": ["AAPL.US", "MSFT.US", "GOOGL.US"],
"start_date": "2025-01-01",
"end_date": "2026-01-01",
"source": "yfinance",
"interval": "1D",
"max_rows": 250
}
For script-
अक्सर पूछे जाने वाले सवाल
क्या इसे API key चाहिए?
नहीं। Yahoo Finance का डेटा मुफ़्त है, और स्किल को कोई पंजीकरण या key नहीं चाहिए।
यह कौन-से बाज़ार कवर करती है?
अमेरिकी, हॉन्गकॉन्ग और कनाडाई शेयर, ETF और इंडेक्स।
क्या Yahoo का डेटा हमेशा पूरा होता है?
मुफ़्त स्रोतों में अंतर या गलतियाँ हो सकती हैं, इसलिए भरोसा करने से पहले डेटा जाँचें।
जानकारी
लेखक का मूल विवरण
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.
repo: HKUDS/Vibe-Trading
लोकप्रियता
- GitHub स्टार
- 37k
- रैंकिंग में स्थान
- #7568
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
vibe-trading
37kयह आपके एजेंट को वित्त शोध का पूरा टूलकिट देती है, जिसमें बैकटेस्ट, फ़ैक्टर एनालिसिस, ऑप्शन प्राइसिंग और कई बाज़ारों का डेटा शामिल है।
adr-hshare
37kयह आपके एजेंट को दिखाती है कि कई बाज़ारों में लिस्टेड एक चीनी कंपनी के भाव की तुलना कैसे करें, जैसे अमेरिकी ADR और हॉन्गकॉन्ग शेयर।
akshare
37kयह आपके एजेंट को चीनी और वैश्विक शेयरों, फ़्यूचर्स, फ़ॉरेक्स और आर्थिक संकेतकों का मुफ़्त बाज़ार डेटा लेने देती है, बिना API key के।
alpha-zoo
37kयह आपके एजेंट को बने-बनाए स्टॉक फ़ैक्टरों की लाइब्रेरी देखने और चुने हुए बाज़ार पर उनके पूरे समूह के रिटर्न की भविष्यवाणी की क्षमता जाँचने देती है।
मिलती-जुलती skills
tavily
394kयह आपके एजेंट को Tavily से वेब पर खोजने और खास वेब पेजों से टेक्स्ट निकालने देती है, गहराई, डोमेन और तारीख के विकल्पों के साथ।
blogwatcher
394kयह आपके एजेंट को ब्लॉग और RSS या Atom फ़ीड फ़ॉलो करने, उनमें नए लेख जांचने और जो लेख आपने पढ़ लिए हों उन्हें चिह्नित करने देती है।
data-scraper-agent
280kएजेंट को किसी भी public स्रोत से अपने-आप डेटा इकट्ठा करने में मदद करता है। इसे schedule किया जा सकता है, जानकारी को और बेहतर बनाया जा सकता है और नतीजे सेव किए जा सकते हैं। ऑनलाइन डेटा पर नज़र रखने के लिए उपयोगी है।