跳到正文
Skillpedia
分析与电子表格260k · #498

stocks

它能做什么

它借助雅虎财经查询实时报价、公司代码、价格历史以及并排对比结果,也能查询加密货币价格。适合想快速获取只读市场信息的人。

适用场景

  • ✓你想了解某只股票或某种加密货币当前价格的时候。
  • ✓你想并排对比多个股票代码的时候。
  • ✓你想查看某只股票在一段时间内价格表现的时候。

技能链接

https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/finance/stocks/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/finance/stocks/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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_cap and pe_ratio may return null on quote when Yahoo's crumb session isn't established. Set ALPHA_VANTAGE_KEY to 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 等工具进行筛选。

详情

作者的原始描述

Stock quotes, history, search, compare, crypto via Yahoo.

repo: NousResearch/hermes-agent

热度

GitHub 星标
260k
排名
#498
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能