AgentSkillsCN

openbb

通过 OpenBB SDK 获取股市数据。查询股票报价、财务数据、各类比率、股息、盈利情况、业绩预期、持股信息、技术分析及估值信息。当用户询问股票行情、股票代码(如 AAPL、MSFT 等)、股价走势、财务比率、市盈率、股息派发、分析师目标价,或相关股权研究时,可选用此技能。

SKILL.md
--- frontmatter
name: openbb
description: "Stock market data via OpenBB SDK. Get quotes, financials, ratios, dividends, earnings, estimates, ownership, technicals, and valuations. Use when user asks about stocks, tickers (AAPL, MSFT, etc.), stock prices, financial ratios, P/E, dividends, analyst targets, or equity research."
metadata: {"openclaw":{"emoji":"📈","requires":{"bins":["jq"],"env":[]}}}

OpenBB Stock Data Skill 📈

Fetch stock market data using OpenBB SDK CLI wrappers. All output is JSON.

Quick Reference

CommandDescriptionExample
openbb-quoteCurrent price, OHLCV (multi-ticker)openbb-quote AAPL
openbb-get-quoteCurrent price (single ticker)openbb-get-quote AAPL
openbb-ratiosP/E, margins, ROE, debtopenbb-ratios MSFT
openbb-financialsIncome/cash flow statementsopenbb-financials GOOGL income 5
openbb-growth-profileRevenue/earnings growthopenbb-growth-profile NVDA
openbb-dividendYield, history, safetyopenbb-dividend JNJ
openbb-estimatesAnalyst targets, recommendationsopenbb-estimates TSLA
openbb-earningsNext earnings + EPS historyopenbb-earnings AMZN
openbb-qualityQuality score (0-10)openbb-quality META
openbb-valuationFair value estimatesopenbb-valuation NFLX
openbb-volatilityBeta, Sharpe, drawdownopenbb-volatility AMD
openbb-technicalsSMA 50/200, cross signalsopenbb-technicals SPY
openbb-historicalPrice returns (1y/3y/5y)openbb-historical AAPL 1y
openbb-metricsKey valuation multiplesopenbb-metrics COST
openbb-ev-ntmEV/NTM revenueopenbb-ev-ntm CRM
openbb-profileCompany infoopenbb-profile DIS
openbb-ownershipInstitutional ownershipopenbb-ownership AAPL

Usage Patterns

Single Stock Query

bash
# Get current quote
<skill>/scripts/openbb-quote AAPL

# Get key ratios
<skill>/scripts/openbb-ratios AAPL

Multiple Tickers

bash
# openbb-quote supports multiple tickers
<skill>/scripts/openbb-quote AAPL MSFT GOOGL

Specify Provider

bash
# Default is yfinance (free), can specify fmp/intrinio
<skill>/scripts/openbb-quote AAPL fmp

Financial Statements

bash
# Income statement, 5 years
<skill>/scripts/openbb-financials AAPL income 5

# Cash flow statement, 3 years  
<skill>/scripts/openbb-financials AAPL cash 3

Data Providers

yfinance (Default - Free, No API Key)

All tools use yfinance by default. Works for quotes, financials, ratios, dividends, estimates, technicals.

FMP (Optional - Enhanced Data)

Some tools benefit from FMP for additional data:

ToolWithout FMPWith FMP
openbb-earningsNext earnings date only+ Historical EPS with beat/miss
openbb-ownershipFalls back to intrinio/secFull institutional data
openbb-estimatesyfinance consensusEnhanced estimates

Setup FMP (optional):

  1. Sign up at financialmodelingprep.com
  2. Set environment variable: export FMP_API_KEY="your_key"

See FMP pricing for tier details.

Output Formatting

All scripts output JSON. When presenting to users:

For chat channels: Summarize key metrics in natural language, e.g.:

AAPL is trading at $259.48 (+0.46%). P/E: 32.9, Dividend yield: 0.4%. Analysts rate it a BUY with average target $291 (+12% upside).

For detailed analysis: Format as markdown table or structured list.

Common Workflows

Quick Stock Check

User: "How's Apple doing?"

bash
<skill>/scripts/openbb-quote AAPL
<skill>/scripts/openbb-ratios AAPL

Dividend Analysis

User: "Is JNJ a good dividend stock?"

bash
<skill>/scripts/openbb-dividend JNJ
<skill>/scripts/openbb-financials JNJ cash 3  # Check FCF coverage

Earnings Preview

User: "When does GOOGL report earnings?"

bash
<skill>/scripts/openbb-earnings GOOGL
<skill>/scripts/openbb-estimates GOOGL

Valuation Check

User: "Is NVDA overvalued?"

bash
<skill>/scripts/openbb-valuation NVDA
<skill>/scripts/openbb-ratios NVDA
<skill>/scripts/openbb-growth-profile NVDA

Requirements

  • Python 3.11+ with OpenBB SDK (pip install openbb)
  • jq (used by openbb-quote for multi-ticker support)
  • NixOS: Scripts handle LD_LIBRARY_PATH automatically

Troubleshooting

"No such file" errors: Ensure OpenBB venv exists at /home/art/.local/venvs/openbb/

Empty results: Some endpoints need paid FMP subscription. Check the "Data Providers" section.

Timeout: Some queries are slow on first run (SDK initialization). Retry usually works.