当前位置: 首页 > Skill >

Stocks and Financial Data Pull Crypto Finance Cryptocurrency Price Earnings Dividends

Stocks and Financial Data Pull Crypto Finance Cryptocurrency Price Earnings Dividends

Stocks and Financial Data Pull Crypto Finance Cryptocurrency Price Earnings Dividends

股票和加密货币数据获取技能。通过Yahoo Finance提供56+金融数据工具,自动获取股票价格、基本面、盈利、股息、期权等数据。

4.2.1 2026.11.27 849
获取Skill文件查看使用说明
作 者:陆言 许可证: 更新时间:2026.11.27
本文目录展开

Stocks Skill

56+ financial tools via Yahoo Finance. Prices, fundamentals, earnings, options, crypto, forex, commodities, news.

Github Open-Souce

Please star Github if you like the skill.

https://github.com/lkcair/yfinance-ai

Also available on OpenWebUI.

Also try SEC Data Pull

https://github.com/lkcair/sec-finance-ai

Available on OpenClaw as "openclaw skills install sec"

Also open-source.

Setup

Run from the skill directory:

python3 -m venv .venv
.venv/bin/python3 -m pip install -r requirements.txt

Windows: use .venvScriptspython3 instead of .venv/bin/python3.

AGNOSTIC OS / One-shot Design ( Goals )

  • This skill is designed to be agnostic to OS and execution environment.
  • It loads only essential context on first use and uses a single-shot interaction pattern for reliability.
  • Basic usage pattern provided and All Functions list in SKILL.md body.

Quotation / Command Execution Reliability (common pitfall)

  • If a command invocation uses complex shell quoting, it may fail in various environments. Use a here-doc style or a tiny helper script to avoid escaping issues.
  • Crucially, ensure you are executing Python scripts using the interpreter from the skill's virtual environment. Simply calling python3 might not use the correct interpreter if the venv is not activated, leading to ModuleNotFoundError.
  • Always use the full path to the venv's Python interpreter for execution, e.g.: /home/openclaw/.openclaw/venv/stocks/bin/python3
  • Ensure that all necessary packages (like pydantic for yfinance-ai) are installed within this specific venv using its associated pip command: /home/openclaw/.openclaw/venv/stocks/bin/pip install <package_name>
  • Example robust pattern using a here-doc:
/home/openclaw/.openclaw/venv/stocks/bin/python3 - << 'PY'
import asyncio, sys
sys.path.insert(0, '.')
from yfinance_ai import Tools

t = Tools()
async def main():
    r = await t.get_key_ratios(ticker='UNH')
    print(r)
asyncio.run(main())
PY
  • If complex inline scripts are problematic, wrap the call in a small Python script file in the workspace (e.g., in scripts/) and execute that script using the venv's Python interpreter.

Agent Quick-Start

After setup, copy the template below into your agent's TOOLS.md (or whichever file your framework injects into every session). This is the single most important step — if the agent can see the invocation pattern, it will work every time.

Replace SKILL_DIR with the absolute path to this skill's directory (e.g. where scripts/ and .venv/ live).

# Stocks Skill

## Usage

```bash
cd SKILL_DIR/scripts && SKILL_DIR/.venv/bin/python3 -c "
import asyncio, sys
sys.path.insert(0, '.')
from yfinance_ai import Tools
t = Tools()
async def main():
    result = await t.METHOD(ARGS)
    print(result)
asyncio.run(main())
" 2>/dev/null
```

Replace METHOD(ARGS) with any call below. Suppress stderr (2>/dev/null) to hide warnings.

## Common Calls

| Need | Method |
|---|---|
| Stock price | `get_stock_price(ticker='AAPL')` |
| Key ratios (P/E, ROE, margins) | `get_key_ratios(ticker='AAPL')` |
| Company overview | `get_company_overview(ticker='AAPL')` |
| Full deep-dive | `get_complete_analysis(ticker='AAPL')` |
| Compare stocks | `compare_stocks(tickers='AAPL,MSFT,GOOGL')` |
| Crypto | `get_crypto_price(symbol='BTC')` |
| Forex | `get_forex_rate(pair='EURUSD')` |
| Commodities | `get_commodity_price(commodity='gold')` |
| News | `get_stock_news(ticker='AAPL')` |
| Market indices | `get_market_indices()` |
| Dividends | `get_dividends(ticker='AAPL')` |
| Earnings | `get_earnings_history(ticker='AAPL')` |
| Analyst recs | `get_analyst_recommendations(ticker='AAPL')` |
| Options chain | `get_options_chain(ticker='SPY')` |
| Market open/closed | `get_market_status()` |

## Routing

- Price / quote → `get_stock_price`
- Ratios / valuation → `get_key_ratios`
- "Tell me about" → `get_company_overview`
- Deep dive → `get_complete_analysis`
- Compare → `compare_stocks`
- Crypto → `get_crypto_price`
- Forex → `get_forex_rate`
- Commodities → `get_commodity_price`
- News → `get_stock_news`

All Functions

By Categories:

  • Quotes: get_stock_price, get_stock_quote, get_fast_info, get_historical_data
  • Company: get_company_info, get_company_overview, get_company_officers
  • Financials: get_income_statement, get_balance_sheet, get_cash_flow, get_key_ratios, get_financial_summary
  • Earnings: get_earnings_history, get_earnings_dates, get_analyst_estimates, get_eps_trend
  • Analyst: get_analyst_recommendations, get_analyst_price_targets, get_upgrades_downgrades
  • Ownership: get_institutional_holders, get_insider_transactions, get_major_holders
  • Dividends: get_dividends, get_stock_splits, get_corporate_actions
  • Options: get_options_chain, get_options_expirations
  • Market: get_market_indices, get_sector_performance, get_market_status
  • Crypto/Forex/Commodities: get_crypto_price, get_forex_rate, get_commodity_price
  • Compare: compare_stocks, get_peer_comparison, get_historical_comparison
  • News: get_stock_news, get_sec_filings
  • Utility: search_ticker, validate_ticker, run_self_test

Notes

  • Data from Yahoo Finance. Slight real-time delays possible.
  • All functions are async — the asyncio.run() wrapper handles this.
  • Works on Linux, macOS, and Windows (adjust venv path for Windows).

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
Skill 文件
  • SKILL.md
    • Stocks Skill
    • Github Open-Souce
    • Also try SEC Data Pull
    • Setup
    • AGNOSTIC OS / One-shot Design ( Goals )
    • Quotation / Command Execution Reliability (common pitfall)
    • Agent Quick-Start
    • All Functions
    • Notes
  • 项目或源文件

相关 Skill

更多
Hk Stock Radar Hk Stock Radar 港股行情与舆情监控工具。当用户询问「港股怎么样」「恒生指数」「港股大盘」「港股涨跌」「HK股」「港股行情监控」「南向资金」时使用。支持东方财富港股API、新浪财经港股接口、Yahoo Finance获取实时行情,以及Google News RSS和X/Twitter舆情监控。📢微信公众号:PM熊叔(打造一人公司...
0602-tosr2-06 0602-tosr2-06 使用 Yahoo Finance 数据分析股票和加密货币,支持投资组合管理、关注列表与提醒、股息分析、八维股票评分等功能...
Futures Radar Futures Radar 监控期货与大宗商品行情;支持原油、黄金、白银、天然气、铜等品种;实时数据来源 Yahoo Finance chart API;微信公众号:PM熊叔(打造一人公司的投研团队)
大宗商品解读(二郎神) 大宗商品解读(二郎神) Expert in interpreting financial research reports across stocks, funds, futures, forex, options, treasury bonds, and commodities. Activates when users need to decode research reports, analyze financial data logic, translate industry jargon, or distinguish facts from opinions in market analysis.
super-stock-analysis super-stock-analysis 使用 Yahoo Finance 数据分析股票和加密货币,支持投资组合管理、关注列表与提醒、股息分析、八维股票评分等功能...