zhangxiangliang/stock-api
查询 A 股、美股、港股与场内基金行情,并通过 Node.js、浏览器、CLI 或 MCP 快速接入。
What it solves
It provides a unified, zero-dependency TypeScript tool for querying stock market data across A-shares, Hong Kong stocks, and US stocks, eliminating the need to manually integrate multiple different financial data providers.
How it works
The tool acts as an abstraction layer over several data sources (Tencent, Sina, and Eastmoney). It can be used via a TypeScript API in Node.js or the browser, a command-line interface (CLI), or as a Model Context Protocol (MCP) server. By default, it uses an automatic fallback mechanism (stocks.auto) that attempts to fetch data from available sources in a specific order (Tencent $\rightarrow$ Sina $\rightarrow$ Eastmoney).
Who it’s for
- Developers building financial applications in TypeScript/JavaScript.
- Users who want to query stock prices and K-line charts via the terminal.
- AI agent users who want to give their LLM clients real-time stock data capabilities via MCP.
Highlights
- Multi-platform support: Works in Node.js, browsers (via CDN/bundlers), and CLI.
- AI Integration: Native MCP server support and a dedicated skill guide for AI agents.
- Automatic Fallback: Automatically switches between data providers to ensure availability.
- Comprehensive Queries: Supports single stock quotes, batch quotes, K-line data, and stock searching.
Related
- Project
- Project
- Project
- Project
- Project