中国A股、香港、美国市场的股市数据查询技巧。默认使用腾讯财经HTTP API(轻量级,无需安装),...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install allstock-data或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install allstock-data⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/allstock-data/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: allstock-data description: Stock market data query skill for China A-shares, Hong Kong, and US markets. Uses Tencent Finance HTTP API by default (lightweight, no install needed), with optional adata SDK for more comprehensive data. Supports real-time quotes, K-line history, order book analysis, and more. ---
Two data sources are supported. Tencent Finance HTTP API is used by default:
---
Endpoint:
http://qt.gtimg.cn/q=<stock_code>
Stock Code Format:
| Market | Code Prefix | Example | |--------|-------------|---------| | Shanghai Main Board | sh600xxx | sh600519 (Moutai) | | STAR Market | sh688xxx | sh688111 | | Shenzhen Main Board | sz000xxx | sz000001 (Ping An Bank) | | ChiNext (GEM) | sz300xxx | sz300033 | | ETF | sz159xxx | sz159919 |
Index Codes:
| Index | Code | |-------|------| | SSE Composite (Shanghai) | sh000001 | | SZSE Component (Shenzhen) | sz399001 | | ChiNext Index | sz399006 | | STAR 50 | sz399987 | | CSI 300 | sh000300 |
Examples:
# Single stock
curl -s "http://qt.gtimg.cn/q=sh600519"
# Multiple stocks
curl -s "http://qt.gtimg.cn/q=sh600519,sh000001,sz399001"
Response Fields:
v_sh600519="1~贵州茅台~600519~1460.00~1466.21~1466.99~14146~6374~7772~..."
~ Name ~ Code ~ Open ~ High ~ Low ~ Volume
| Index | Field | |-------|-------| | 0 | Market code | | 1 | Stock name | | 2 | Stock code | | 3 | Current price | | 4 | Open price | | 5 | Low price | | 6 | High price | | 30 | Price change | | 31 | Change % |
---
Endpoint:
http://qt.gtimg.cn/q=hk<stock_code>
Examples:
# Tencent Holdings
curl -s "http://qt.gtimg.cn/q=hk00700"
# Alibaba
curl -s "http://qt.gtimg.cn/q=hk09988"
---
Endpoint:
http://qt.gtimg.cn/q=us<ticker>
Examples:
# Apple
curl -s "http://qt.gtimg.cn/q=usAAPL"
# Tesla
curl -s "http://qt.gtimg.cn/q=usTSLA"
# NVIDIA
curl -s "http://qt.gtimg.cn/q=usNVDA"
---
Endpoint:
https://web.ifzq.gtimg.cn/appstock/app/fqkline/get
Parameters:
| Parameter | Description |
|-----------|-------------|
| _var | Variable name, e.g. kline_dayqfq |
| param | stock_code, kline_type, start_date, end_date, count, adjust_type |
K-Line Types: day / week / month
Adjustment Types: qfqa (forward-adjusted) / qfq (backward-adjusted) / empty (unadjusted)
Examples:
# Moutai daily K-line (last 10 days, forward-adjusted)
curl -s "https://web.ifzq.gtimg.cn/appstock/app/fqkline/get?_var=kline_dayqfq¶m=sh600519,day,,,10,qfqa"
# Ping An Bank weekly K-line (last 5 weeks)
curl -s "https://web.ifzq.gtimg.cn/appstock/app/fqkline/get?_var=kline_weekqfq¶m=sz000001,week,,,5,qfqa"
# ChiNext Index monthly K-line (last 3 months)
curl -s "https://web.ifzq.gtimg.cn/appstock/app/fqkline/get?_var=kline_monthqfq¶m=sz399006,month,,,3,qfqa"
Response Format:
{"day": [["2026-02-27", "1466.99", "1461.19", "1476.21", "1456.01", "13534"], ...]}
Date Open Close High Low Volume
---
Endpoint:
http://qt.gtimg.cn/q=s_pk<stock_code>
Example:
curl -s "http://qt.gtimg.cn/q=s_pksh600519"
Returns: Buy/sell volume ratios (internal vs external trades)
---
adata is an open-source A-share quantitative data library providing more comprehensive data. Requires installation and possibly a proxy.
pip install adata
import adata
adata.proxy(is_proxy=True, ip='your-proxy-ip:port')
| Feature | Description | |---------|-------------| | Stock Basic Info | All A-share codes, share capital, SW industry classification | | K-Line Data | Daily/Weekly/Monthly, forward/backward adjustment | | Real-Time Quotes | Batch real-time pricing | | Level-2 Order Book | Bid/ask depth data | | Capital Flow | Individual stock capital flow analysis | | Concept Sectors | Thematic sector data | | Index Data | Major index quotes | | ETF | ETF quotes |
import adata
# Get all A-share stock codes
df = adata.stock.info.all_code()
# Get K-line data
df = adata.stock.market.get_market(
stock_code='000001',
k_type=1, # 1=daily, 2=weekly, 3=monthly
start_date='2024-01-01',
adjust_type=1 # 0=unadjusted, 1=forward, 2=backward
)
# Real-time quotes
df = adata.stock.market.list_market_current(
code_list=['000001', '600519']
)
---
| Scenario | Recommended Source | |----------|--------------------| | Quick single stock price check | Tencent Finance API | | K-line historical data | Tencent Finance API | | Batch quote queries | Tencent Finance API | | Capital flow data | adata SDK | | Full financial statements | adata SDK | | Concept/sector analysis | adata SDK | | Level-2 order book | Tencent Finance API or adata SDK |
---
v_pv_none_match="1"安装 所有股票数据 后,可以对 AI 说这些话来触发它
Help me get started with allstock-data
Explains what allstock-data does, walks through the setup, and runs a quick demo based on your current project
Use allstock-data to stock market data query skill for China A-shares, Hong Kong, and US...
Invokes allstock-data with the right parameters and returns the result directly in the conversation
What can I do with allstock-data in my finance & investment workflow?
Lists the top use cases for allstock-data, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/allstock-data/ 目录(个人级,所有项目可用),或 .claude/skills/allstock-data/(项目级)。重启 AI 客户端后,用 /allstock-data 主动调用,或让 AI 根据上下文自动发现并使用。
所有股票数据 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
所有股票数据 可免费安装使用。请查阅仓库了解许可证信息。
中国A股、香港、美国市场的股市数据查询技巧。默认使用腾讯财经HTTP API(轻量级,无需安装),...
所有股票数据 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my finance & investment tasks using allstock-data
Identifies repetitive steps in your workflow and sets up allstock-data to handle them automatically