stocks
它能做什么
它借助雅虎财经查询实时报价、公司代码、价格历史以及并排对比结果,也能查询加密货币价格。适合想快速获取只读市场信息的人。
适用场景
- ✓你想了解某只股票或某种加密货币当前价格的时候。
- ✓你想并排对比多个股票代码的时候。
- ✓你想查看某只股票在一段时间内价格表现的时候。
技能链接
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/finance/stocks/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“苹果公司现在的股价是多少?过去六个月它的走势如何?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体运行一个小型 Python 脚本,读取雅虎财经数据,并以 JSON 格式返回结果。无需 API 密钥,但可以选择填入 Alpha Vantage 密钥,用来补充缺失的字段。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Stocks Skill
Read-only market data via Yahoo Finance. Five commands: quote, search,
history, compare, crypto. Python stdlib only — no API key, no pip
installs. Yahoo's endpoint is unofficial and may rate-limit or change.
When to Use
- User asks for a current stock price (AAPL, TSLA, MSFT, ...)
- User wants to look up a ticker by company name
- User wants OHLCV history or performance over a date range
- User wants to compare several tickers side by side
- User asks for a crypto price (BTC, ETH, SOL, ...)
Prerequisites
Python 3.8+ stdlib only. Optional: set ALPHA_VANTAGE_KEY to enrich
market_cap, pe_ratio, and 52-week levels when Yahoo's crumb-protected
fields come back null. Free key: https://www.alphavantage.co/support/#api-key
How to Run
Invoke through the terminal tool. Once installed:
SCRIPT=~/.hermes/skills/finance/stocks/scripts/stocks_client.py
python $SCRIPT quote AAPL
All output is JSON on stdout — pipe through jq if you want to slice it.
Quick Reference
python $SCRIPT quote AAPL
python $SCRIPT quote AAPL MSFT GOOGL TSLA
python $SCRIPT search "Tesla"
python $SCRIPT history NVDA --range 6mo
python $SCRIPT compare AAPL MSFT GOOGL
python $SCRIPT crypto BTC ETH SOL
Commands
quote SYMBOL [SYMBOL2 ...]
Current price, change, change%, volume, 52-week high/low.
search QUERY
Find tickers by company name. Returns top 5: symbol, name, exchange, type.
history SYMBOL [--range RANGE]
Daily OHLCV plus stats (min, max, avg, total return %). Ranges: 1mo,
3mo, 6mo, 1y, 5y. Default: 1mo.
compare SYMBOL1 SYMBOL2 [...]
Side-by-side: price, change%, 52-week performance.
crypto SYMBOL [SYMBOL2 ...]
Crypto prices. Pass BTC (the script appends -USD automatically).
Pitfalls
- Yahoo Finance's API is unofficial. Endpoints can change or rate-limit without notice — if requests start failing, that's why.
market_capandpe_ratiomay return null onquotewhen Yahoo's crumb session isn't established. SetALPHA_VANTAGE_KEYto backfill.- Add a small delay between bulk requests to avoid rate-limiting.
- This is read-only — no order placement, no account integration.
Verification
python ~/.hermes/skills/finance/stocks/scripts/stocks_client.py quote AAPL
Returns a JSON object with symbol: "AAPL" and a numeric price field.
常见问题
这些数据是官方的吗?
技能说明雅虎的接口并非官方提供,可能会限制访问频率,或随时发生变化。
我需要 API 密钥吗?
不需要。当雅虎没有返回市值等字段时,可以选择使用 Alpha Vantage 密钥来补充。
输出是什么格式?
所有输出都是 JSON,你可以用 jq 等工具进行筛选。
详情
热度
- GitHub 星标
- 260k
- 排名
- #498
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-merge-conflict-arbiter
260k以中立第三方的身份,解决两个智能体分支之间的 git 合并冲突,为代码仓库生成一个合并结果。
antigravity-cli
260k指导你安装、更新和排查 Antigravity 命令行工具,包括其插件、登录和沙盒。
blackbox
260k让你的智能体把编程任务交给 Blackbox AI 命令行工具,它会运行多个 AI 模型并挑选最佳结果。
dynamic-workflow
260k教你的智能体把大量相似的工作保存为脚本批量运行,使只有经过验证的结果才返回主对话。