Yahoo Finance CLI

This skill should be used when the user asks to "get stock prices", "check stock quotes", "look up earnings", "get financial data", "find trending stocks", or needs stock market data from Yahoo Finance.

MIT-0 · Free to use, modify, and redistribute. No attribution required.
8 · 5.7k · 34 current installs · 36 all-time installs
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description request stock and finance data from Yahoo Finance and the SKILL.md only asks for the yahoo-finance2 CLI ('yf') and jq for JSON processing — these are directly relevant.
Instruction Scope
Runtime instructions only describe running the yf CLI, piping JSON to jq, and troubleshooting a cookie file (~/.yf2-cookies.json). The instructions do not read unrelated files, access unrelated env vars, or send data to unexpected endpoints.
Install Mechanism
Install steps are npm install of the public 'yahoo-finance2' package and brew install jq, plus linking a global binary into /usr/local/bin. This is expected for a CLI-based skill but carries the usual npm hygiene concerns (review package source, trustworthiness, and privileges required for global install / linking).
Credentials
The skill declares no required env vars or credentials. The only persisted artifact is a cookie file in the user's home (~/.yf2-cookies.json), which is reasonable for a CLI that manages cookies for web requests.
Persistence & Privilege
The skill is instruction-only, not always-enabled, and requests no credentials. However, disableModelInvocation is not set (default model-invocable), so the agent could invoke the skill autonomously if the platform allows model-initiated skill calls — this is normal but worth noting.
Assessment
This skill appears to do what it says: run the yahoo-finance2 CLI and parse JSON with jq. Before installing, review the yahoo-finance2 npm package (its npm page and source) to ensure you trust it, and prefer local-user npm installs (avoid sudo/global installs) if you want less system impact. Be aware the CLI stores cookies in ~/.yf2-cookies.json — inspect or remove that file if you have privacy concerns. Finally, if you don't want the agent to call the skill autonomously, check your platform's skill invocation settings (disable model invocation) before enabling it.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk97e78fqaycgrcvda1zj8255358042mb

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

Binsjq, yf

Install

Install jq (Homebrew)
Bins: jq
Install Yahoo Finance CLI (npm)
Bins: yahoo-finance
npm i -g yahoo-finance2

SKILL.md

Yahoo Finance CLI

A Node.js CLI for fetching comprehensive stock data from Yahoo Finance using the yahoo-finance2 library.

Requirements

  • Node.js
  • yahoo-finance2 installed globally or available as yf
  • jq

Install

brew install jq
npm install yahoo-finance2
sudo ln -s /opt/homebrew/bin/yahoo-finance /usr/local/bin/yf

Usage

The tool is available as yf. It outputs JSON, which can be piped to jq for filtering.

yf <module> <symbol> [queryOptions]

Modules

Quote (Real-time Price & Data)

Get real-time price, change, and basic data.

yf quote AAPL
yf quote AAPL | jq '.regularMarketPrice'

Quote Summary (Fundamentals & More)

Get detailed modules like earnings, financial data, and profiles.

# Get specific sub-modules
yf quoteSummary AAPL '{"modules":["assetProfile", "financialData", "defaultKeyStatistics"]}'

# Common modules to request:
# - assetProfile (Company info, sector)
# - financialData (Target price, margins, cash)
# - defaultKeyStatistics (Enterprise value, float, shares)
# - calendarEvents (Earnings dates)
# - earnings (History and trend)
# - recommendationTrend (Analyst ratings)
# - upgradeDowngradeHistory

Insights

Get technical and fundamental insights (valuation, outlook).

yf insights AAPL

Search

Search for symbols.

yf search "Apple"
yf search "BTC-USD"

Historical Data (Deprecated)

Get historical OHLCV data. Note: historical is deprecated; use chart instead.

# Deprecated - use chart instead
yf historical AAPL '{"period1":"2024-01-01","period2":"2024-12-31"}'

# Recommended: use chart
yf chart AAPL '{"period1":"2024-01-01","period2":"2024-12-31"}'

Trending

See what's trending.

yf trendingSymbols US

Examples

Quick Price Check

# Full JSON then filter with jq
yf quote NVDA | jq '{symbol: .symbol, price: .regularMarketPrice, changePct: .regularMarketChangePercent}'

Next Earnings Date

# Use single quotes around the JSON option in zsh/bash
yf quoteSummary TSLA '{"modules":["calendarEvents"]}' | jq '.calendarEvents.earnings.earningsDate'

Analyst Recommendations

yf quoteSummary AAPL '{"modules":["recommendationTrend"]}'

Company Profile

yf quoteSummary MSFT '{"modules":["assetProfile"]}'

Historical OHLCV

# Using chart (recommended)
yf chart AAPL '{"period1":"2024-01-01","period2":"2024-12-31","interval":"1d"}' | jq '.quotes[0:5]'

# Using historical (deprecated, but still works)
yf historical AAPL '{"period1":"2024-01-01","period2":"2024-12-31","interval":"1d"}' | jq '.[0:5]'

Search for Symbols

yf search 'Apple'
yf search 'BTC-USD'

Trending Symbols (US)

yf trendingSymbols US

Insights (valuation, outlook)

yf insights AAPL

Troubleshooting

  • Cookies: The tool automatically handles cookies (stored in ~/.yf2-cookies.json). If you encounter issues, try deleting this file.
  • JSON Output: The output is pure JSON. Use jq to parse it for scripts or readability.

Additional tips:

  • If you see authentication or parsing errors, delete the cookie file and retry:
rm -f ~/.yf2-cookies.json
yf quote AAPL
  • On macOS with zsh, prefer single quotes around JSON option arguments and use double quotes inside (see examples above).
  • If you want a compact numeric value only (no jq), use a short jq filter, e.g.:
yf quote AAPL | jq -r '.regularMarketPrice'

Files

1 total
Select a file
Select a file to preview.

Comments

Loading comments…