stocks

Fetch stock quotes, price history, comparisons, and crypto prices from Yahoo Finance.

Updated Jun 5, 2026
One-click install
npx skills add https://github.com/xu1713/openhorse --skill stocks-xu1713
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stocks
Source: https://github.com/xu1713/openhorse/tree/main/openhorse/openhorse/optional-skills/finance/stocks
Command: npx skills add https://github.com/xu1713/openhorse --skill stocks-xu1713

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Getting quick market data usually requires paid APIs, API keys, or heavy libraries. This Skill retrieves stock quotes, historical prices, ticker search, multi-stock comparisons, and crypto prices using only Python's standard library and Yahoo Finance's public endpoints. ## Core Features & Use Cases - Real-Time Quotes: Get current price, change, volume, 52-week high/low, market cap, and P/E ratio for one or more tickers. - History & Comparison: Pull OHLCV history over ranges from 1 month to 5 years with summary stats, or compare multiple tickers side by side. - Crypto Prices: Query crypto prices like BTC or ETH with automatic -USD suffix handling. - Use Case: Ask for a comparison of AAPL, MSFT, and GOOGL before a portfolio review and receive a JSON table of prices, changes, and 52-week performance. ## Quick Start Ask the agent to get the current stock quote for AAPL using the stocks skill.

Frequently Asked Questions about stocks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get a stock quote from the command line in Python?

Run the stocks_client.py script with the quote command followed by one or more ticker symbols, such as python3 stocks_client.py quote AAPL MSFT. It prints JSON with price, change, volume, and 52-week levels using only the Python standard library.

How to fetch historical stock prices without an API key?

Use the history command with a ticker and a range like 1mo, 6mo, or 5y, for example python3 stocks_client.py history NVDA --range 6mo. It queries Yahoo Finance's public chart endpoint and returns daily OHLCV data plus min, max, average, and total return stats.

Does this stock tool require installing Python packages?

No external packages are required. The script uses only Python 3.8+ standard library modules like urllib, json, and argparse, so there is nothing to pip install and no mandatory API key.

Why do market cap and P/E ratio sometimes return null?

Yahoo Finance protects some quote fields behind a crumb session, so market_cap and pe_ratio can come back null. Setting the ALPHA_VANTAGE_KEY environment variable backfills those fields from Alpha Vantage's free API.

Can I use this for crypto prices like Bitcoin?

Yes, the crypto command accepts symbols like BTC, ETH, or SOL and automatically appends -USD before querying Yahoo Finance. You can also pass --vs EUR to quote against a different currency.

What are the limitations of using Yahoo Finance's unofficial API?

Yahoo's endpoints are unofficial and can rate-limit, change, or break without notice, so requests may intermittently fail. The tool is also strictly read-only with no order placement or brokerage account integration.