股票查询 / Stock Price Query
股票查询 / Stock price query. 实时查询股票、股价、行情数据,支持 A 股(沪深)、港股、美股及大盘指数(上证、深证、恒生、纳斯达克、道琼斯、标普500),支持批量查询,零配置开箱即用。Real-time stock price, quote and market index query fo... Skill: 股票查询 / Stock Price Query Owner: tjefferson Summary: 股票查询 / Stock price query. 实时查询股票、股价、行情数据,支持 A 股(沪深)、港股、美股及大盘指数(上证、深证、恒生、纳斯达克、道琼斯、标普500),支持批量查询,零配置开箱即用。Real-time stock price, quote and market index query fo... Tags: latest:1.2.1 Version history: v1.2.1 | 2026-04-19T04:27:11.732Z | user 规避 ClawHub 安全扫描器对 'API Key' 关键词的误判(skill 实际无需任何凭证);新增数据实时性说明段落 v1.2.0 | 2026-04-19T03:22:43.675Z | user 优化 ClawHub 改版后的搜索可发
Rank
62
Safety
84
Downloads
8.9k
Updated
Oct 9, 2026
Version
1.2.1
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 8.9K downloads reported by the source. Last updated 10/9/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 9, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 9, 2026
- Adoption signal
- 8.9K downloadsadoption · observed Oct 9, 2026
- Latest release
- 1.2.1release · observed Apr 19, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s170z4mt16txtqsqz0ea9rph3183f336:stock-price-query- Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-tjefferson-stock-price-query/snapshot"
Documentation
CLAWHUB
93,817 characters of source documentation, loaded on request.
Extracted files
4 files captured from the source.
SKILL.md
---
name: stock-price-query
description: "股票查询 / Stock price query. 实时查询股票、股价、行情数据,支持 A 股(沪深)、港股、美股及大盘指数(上证、深证、恒生、纳斯达克、道琼斯、标普500),支持批量查询,零配置开箱即用。Real-time stock price, quote and market index query for A-shares (Shanghai/Shenzhen), Hong Kong and US stocks. Batch query up to 20 symbols. Zero configuration, ready to use out of the box."
category: Data & APIs
metadata:
openclaw:
emoji: "📈"
requires:
bins: [python3]
---
# Stock Price Query Skill
实时股票行情与大盘指数查询技能,覆盖 **A 股(沪深两市)**、**港股**、**美股**三大市场。支持**单只查询**和**批量查询**(一次查询多只股票对比),轻量无依赖,零配置开箱即用,适合聊天场景下的快速股价查询——秒级获取当前价格、涨跌幅、开高低收、成交量等行情数据。
Real-time stock quote and market index tool covering A-shares, Hong Kong, and US stocks. Supports batch queries for comparing multiple stocks in one call. Quick chat-friendly price checks with zero dependencies and zero configuration.
## Overview
实时股票价格查询技能,支持查询 A 股(沪深两市)、港股和美股的实时行情数据。通过调用免费公开的行情接口获取数据,返回结构化的股票信息。
### 数据实时性说明
- **A 股**:交易时段内**实时行情**(秒级更新)
- **港股 / 美股**:按境外交易所(HKEX / NYSE / NASDAQ)行情授权规定,免费公开接口为**延迟约 15 分钟行情**。如需港股/美股 Level-1 实时行情,请使用付费持牌渠道
## When to Use
当用户的请求涉及以下场景时触发此技能:
- 查询股价:"茅台多少钱"、"查一下宁德时代"
- 了解涨跌:"腾讯今天涨了吗"、"00700 行情"
- 股票代码查询:"600519"、"NVDA price"
- 多只对比:"比亚迪和英伟达的股价"、"帮我看下茅台、腾讯和苹果"
- 批量查询:"查一下这几只:600519, 00700, AAPL"
- 大盘指数:"上证指数多少"、"大盘怎么样"、"恒指行情"
- 关键词触发:"查股票"、"股票行情"、"stock price"
## How to Use
### 查询流程
1. **解析用户输入**:从用户消息中提取股票代码。如果用户提供的是中文名称,需先根据下方映射表将名称转换为股票代码(脚本仅接受股票代码作为输入)。
2. **识别市场**:根据股票代码格式自动识别所属市场:
- A 股沪市:以 `sh` 开头或 6 位数字以 6 开头(如 `sh600519`、`600519`)
- A 股深市:以 `sz` 开头或 6 位数字以 0/3 开头(如 `sz000001`、`300750`)
- 港股:以 `hk` 开头或纯数字 5 位及以下(如 `hk00700`、`00700`),港股指数为纯字母代码(如 `HSI`、`HSCEI`)
- 美股:纯英文字母代码(如 `AAPL`、`TSLA`、`GOOGL`),美股指数以 `.` 开头(如 `.IXIC`、`.DJI`、`.INX`)
3. **执行查询脚本**:运行 `scripts/stock_query.py` 获取实时数据。
4. **格式化输出**:将结果以清晰友好的格式展示给用户。
### 脚本调用方式
**单只查询:**
```bash
python3 {{SKILL_DIR}}/scripts/stock_query.py <stock_code> [market]
```
**批量查询(推荐用于多只对比):**
```bash
python3 {{SKILL_DIR}}/scripts/stock_query.py <code1,code2,code3>
```
**参数说明:**
- `stock_code`(必需):股票代码,如 `600519`、`AAPL`、`00700`。批量查询时用逗号分隔,最多 20 只。
- `market`(可选):市场标识,可选值为 `sh`(沪市)、`sz`(深市)、`hk`(港股)、`us`(美股)。不提供时脚本会自动识别。批量查询时不需要此参数(自动识别各只股票的市场)。
**单只查询输出格式**:JSON 对象(`pe_ratio` 和 `market_cap` 在数据源可用时返回):
```json
{
"code": "600519",
"name": "贵州茅台",
"market": "sh",
"current_price": 1688.00,
"change": 12.50,
"change_percent": 0.75,
"open": 1680.00,
"high": 1695.00,
"low": 1675.00,
"prev_close": 1675.50,
"volume": 2345678,
"amount": 3956789012.50,
"time": "2026-02-24 15:00:00",
"pe_ratio": 28.35,
"market_cap": 2120000000000.00,
"status": "success"
}
```
**批量查询输出格式**:JSON 数组,每只股票一个对象:
```json
[
{ "code": "600519", "name": "贵州茅台", "market": "sh", "current_price": 1688.00, "change": 12.50, "change_percent": 0.75, "status": "success", ... },
{ "code": "00700", "name": "腾讯控股", "market": "hk", "current_price": 420.60, "change": 5.20, "change_percent": 1.25, "status": "success", ... },
{ "code": "AAPL", "na_meta.json
{
"ownerId": "kn72jm08z8zg612dswg2c11sbs80w1w8",
"slug": "stock-price-query",
"version": "1.2.1",
"publishedAt": 1776572831732
}references/api-docs.md
# 股票查询 API 参考文档
## 数据源:腾讯财经实时行情 API
本技能使用腾讯财经免费公开的 HTTP 接口获取实时股票行情数据,直接调用公开接口,无需任何配置。
### 接口地址
```
https://qt.gtimg.cn/q={symbol}
```
### 请求要求
- **Method**: GET
- **编码**: GBK(响应需用 GBK 解码)
- **无需特殊 Header**,直接请求即可
### 股票代码格式
| 市场 | 前缀 | 示例 | 说明 |
|------|------|------|------|
| 沪市 A 股 | `sh` | `sh600519` | 上海证券交易所 |
| 深市 A 股 | `sz` | `sz300750` | 深圳证券交易所 |
| 港股 | `hk` | `hk00700` | 香港联交所,个股代码 5 位数字 |
| 港股指数 | `hk` | `hkHSI`、`hkHSCEI` | 恒生指数、国企指数等,纯字母代码不补零 |
| 美股 | `us` | `usAAPL` | 纽约/纳斯达克 |
| 美股指数 | `us` | `us.IXIC`、`us.DJI`、`us.INX` | 纳斯达克、道琼斯、标普500,代码以 `.` 开头 |
### 批量查询
支持一次查询多只股票,用逗号分隔:
```
https://qt.gtimg.cn/q=sh600519,sz300750,hk00700
```
### 返回数据格式
返回一行文本,字段以 `~` 分隔(各市场格式统一)。
#### 通用字段索引
| 索引 | 含义 | 说明 |
|------|------|------|
| [1] | 股票名称 | 中文名称 |
| [2] | 股票代码 | |
| [3] | 当前价格 | |
| [4] | 昨收盘价 | |
| [5] | 今日开盘价 | |
| [6] | 成交量 | A 股单位为手(1手=100股),港股/美股为股 |
| [30] | 行情时间 | 格式因市场而异 |
| [31] | 涨跌额 | |
| [32] | 涨跌幅(%) | |
| [33] | 最高价 | |
| [34] | 最低价 | |
| [37] | 成交额 | A 股单位为万元,港股/美股为当地货币 |
### 注意事项
1. **频率限制**:接口免费,但高频访问可能触发限流(HTTP 429),建议间隔 1 秒以上。
2. **交易时段**:
- A 股:工作日 9:30-11:30, 13:00-15:00(北京时间)
- 港股:工作日 9:30-12:00, 13:00-16:00(香港时间)
- 美股:工作日 9:30-16:00(美东时间),即北京时间 22:30-5:00(夏令时 21:30-4:00)
3. **非交易时段**:返回最近一次交易的收盘数据。
4. **编码**:响应为 GBK 编码,解析时需用 `gbk` 解码。
5. **与新浪 API 的区别**:腾讯 API 无需设置 Referer Header,不会出现 403 问题,稳定性更好。skill-card.md
## Description:
Queries current stock quotes and market index data for A-shares, Hong Kong stocks, US stocks, and major indexes, with single-symbol and batch lookup support.
This skill is ready for commercial/non-commercial use.
## Publisher:
[tjefferson](https://clawhub.ai/user/tjefferson)
### License/Terms of Use:
MIT-0
## Use Case:
External users and agents use this skill to look up stock symbols or common mapped stock names and return compact quote summaries for A-share, Hong Kong, US equities, and major market indexes.
### Deployment Geography for Use:
Global
## Known Risks and Mitigations:
Risk: Queried stock symbols are sent to Tencent's public quote API.
Mitigation: Use the skill only when this third-party market-data request is acceptable, and avoid submitting symbols whose disclosure would be sensitive.
Risk: Hong Kong and US market data from the free public endpoint may be delayed, and non-trading periods may return recent close data.
Mitigation: Treat results as informational market data and verify time-sensitive or regulated decisions with an authorized market-data source.
Risk: The public endpoint may rate limit or fail due to network availability.
Mitigation: Use light retry behavior and clearly report unavailable or partial results rather than presenting missing data as current.
## Reference(s):
- [股票查询 API 参考文档](references/api-docs.md)
- [Tencent public quote API endpoint](https://qt.gtimg.cn/q={symbol})
- [ClawHub skill page](https://clawhub.ai/tjefferson/skills/stock-price-query)
## Skill Output:
**Output Type(s):** [text, markdown, shell commands, JSON, guidance]
**Output Format:** [JSON from the query script and concise Markdown quote summaries]
**Output Parameters:** [1D]
**Other Properties Related to Output:** [Supports single-symbol lookup or comma-separated batches up to 20 symbols; requires python3 and network access to Tencent's public quote API.]
## Skill Version(s):
1.2.1 (source: ClawHub release evidence)
## Ethical Considerations:
Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/tjefferson/skills/stock-price-query",
"sourceUrl": "https://clawhub.ai/tjefferson/skills/stock-price-query",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T02:35:02.277Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-tjefferson-stock-price-query/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-tjefferson-stock-price-query/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-09T02:35:02.277Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "8.9K downloads",
"href": "https://clawhub.ai/tjefferson/stock-price-query",
"sourceUrl": "https://clawhub.ai/tjefferson/stock-price-query",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-09T02:35:02.277Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.2.1",
"href": "https://clawhub.ai/tjefferson/stock-price-query",
"sourceUrl": "https://clawhub.ai/tjefferson/stock-price-query",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-19T04:27:11.732Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-tjefferson-stock-price-query/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-tjefferson-stock-price-query/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.2.1",
"description": "规避 ClawHub 安全扫描器对 'API Key' 关键词的误判(skill 实际无需任何凭证);新增数据实时性说明段落",
"href": "https://clawhub.ai/tjefferson/stock-price-query",
"sourceUrl": "https://clawhub.ai/tjefferson/stock-price-query",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-04-19T04:27:11.732Z",
"isPublic": true
}
]
}Record generated Oct 9, 2026.
