---
name: AlphaEar Stock
slug: alphaear-stock
category: Data
description: AlphaEar Stock searches A-share, HK, and US stock tickers and retrieves historical price data (OHLCV) and fundamentals. Use when a user asks about financial stock codes, recent price changes, or specific company stock info.
github: "https://github.com/RKiding/Awesome-finance-skills/tree/main/skills/alphaear-stock"
language: Python
stars: 2781
forks: 362
install: "npx degit https://github.com/RKiding/Awesome-finance-skills/tree/main/skills/alphaear-stock ~/.claude/skills/alphaear-stock"
installs_to: ~/.claude/skills/alphaear-stock
source_path: skills/alphaear-stock/SKILL.md
collection_size: 10
category_size: 668
collection_url: "https://dirskills.com/collections/RKiding/Awesome-finance-skills"
added: 2026-08-17T07:10:26.657Z
last_synced: 2026-08-17T07:10:26.657Z
canonical_url: "https://dirskills.com/skills/alphaear-stock"
---

# AlphaEar Stock

AlphaEar Stock searches A-share, HK, and US stock tickers and retrieves historical price data (OHLCV) and fundamentals. Use when a user asks about financial stock codes, recent price changes, or specific company stock info.

**Install:**

```bash
npx degit https://github.com/RKiding/Awesome-finance-skills/tree/main/skills/alphaear-stock ~/.claude/skills/alphaear-stock
```

## README

# AlphaEar Stock Skill

## Overview

Search A-Share/HK/US stock tickers and retrieve historical price data (OHLCV).

## Capabilities

### 1. Stock Search & Data

Use `scripts/stock_tools.py` via `StockTools`.

-   **Search**: `search_ticker(query)`
    -   Fuzzy search by code or name (e.g., "Moutai", "600519").
    -   Returns: List of `{code, name}`.
-   **Get Price**: `get_stock_price(ticker, start_date, end_date)`
    -   Returns DataFrame with OHLCV data.
    -   Dates format: "YYYY-MM-DD".
-   **Get Fundamentals**: `get_stock_fundamentals(ticker)`
    -   Returns dict with sector, industry, market cap, PE ratio, and summary.
    -   Supports A-Share/HK/US stocks.

## Dependencies

-   `pandas`, `requests`, `akshare`, `yfinance`
-   `scripts/database_manager.py` (stock tables)

## Notes

-   **Proxy**: For US stock data (via `yfinance`), you may need to set environment variables if your network cannot reach Yahoo Finance directly:
    ```bash
    export HTTP_PROXY="http://<proxy_ip>:<port>"
    export HTTPS_PROXY="http://<proxy_ip>:<port>"
    ```
-   **A-Share/HK**: Data is primarily fetched via `akshare` (EastMoney), which usually works best with a direct connection in China. The tool automatically detects proxy issues and attempts direct connection for these markets.
